2017-08-30 1 views
0

Ich bin ein neuer Benutzer von Spoon und Astor. Kürzlich benutze ich Astor (SpoonLabs/astor), um einige automatische Fehlerbehebungsarbeiten durchzuführen.So verwenden Sie Löffel, um Hadoop-Projekte zu kompilieren

Der Astor wird zunächst die Spoon-Bibliothek verwenden, um den Quellcode des Projekts zu kompilieren und zu analysieren. Jetzt kann ich Spoon verwenden, um kleine Projekte erfolgreich zu erstellen, aber es kann kein Hadoop Submodul kompilieren (z. B. hadoop/hadoop-common-project/hadoop-auth).

Ich fand, dass Spoon Probleme beim Kompilieren des Modells hat. Scheint, dass Spoon den deklarierten Typ nicht von der Datei package-info.java bekommen kann. Weiß jemand, wie man dieses Problem beheben kann? Danke vielmals!

2017-08-30 17:59:15,128 INFO main - building model: /Users/someone/git/astor/./outputMutation/AstorMain-11859hadp//src//default, compliance level: 8 
2017-08-30 17:59:15,136 INFO main - Classpath for building SpoonModel [too long to list all of them] 
2017-08-30 17:59:16,885 ERROR main - Problem compiling the model with compliance level 8 
2017-08-30 17:59:16,885 ERROR main - inconsistent compilation unit: '/Users/someone/git/astor/outputMutation/AstorMain-11859hadp/src/default/org/apache/hadoop/security/authentication/server/package-info.java': declared types are [] 
2017-08-30 17:59:16,885 INFO main - building model: /Users/someone/git/astor/./outputMutation/AstorMain-11859hadp//src//default, compliance level: 7 
2017-08-30 17:59:16,887 INFO main - Classpath for building SpoonModel [too long to list all of them] 
Exception in thread "main" java.lang.RuntimeException: inconsistent compilation unit: '/Users/someone/git/astor/outputMutation/AstorMain-11859hadp/src/default/org/apache/hadoop/security/authentication/server/package-info.java': declared types are [] 
    at spoon.support.reflect.cu.CompilationUnitImpl.getMainType(CompilationUnitImpl.java:68) 
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.generateProcessedSourceFilesUsingCUs(JDTBasedSpoonCompiler.java:498) 
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.generateProcessedSourceFiles(JDTBasedSpoonCompiler.java:203) 
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.generateProcessedSourceFiles(JDTBasedSpoonCompiler.java:192) 
    at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:90) 
    at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:71) 
    at fr.inria.astor.approaches.jgenprog.JGenProg.initModel(JGenProg.java:152) 
    at fr.inria.astor.approaches.jgenprog.JGenProg.createInitialPopulation(JGenProg.java:62) 
    at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:97) 
    at fr.inria.main.evolution.AstorMain.run(AstorMain.java:142) 
    at fr.inria.main.AbstractMain.executeExample(AbstractMain.java:708) 
    at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:209) 
    at fr.inria.main.evolution.AstorMain.main(AstorMain.java:199) 
    at fr.inria.main.evolution.MainjGenProg.main(MainjGenProg.java:14) 

Die package-info.java Datei:

wird die Protokollinformationen unten aufgeführten

/* 
* Licensed to the Apache Software Foundation (ASF) under one 
* or more contributor license agreements. See the NOTICE file 
* distributed with this work for additional information 
* regarding copyright ownership. The ASF licenses this file 
* to you under the Apache License, Version 2.0 (the 
* "License"); you may not use this file except in compliance 
* with the License. You may obtain a copy of the License at 
* 
*  http://www.apache.org/licenses/LICENSE-2.0 
* 
* Unless required by applicable law or agreed to in writing, software 
* distributed under the License is distributed on an "AS IS" BASIS, 
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License. 
*/ 

/** 
* Provides the server-side framework for authentication. 
*/ 
@InterfaceAudience.LimitedPrivate({ "HBase", "HDFS", "MapReduce" }) 
@InterfaceStability.Evolving 
package org.apache.hadoop.security.authentication.server; 

import org.apache.hadoop.classification.InterfaceAudience; 
import org.apache.hadoop.classification.InterfaceStability; 

Antwort

0

Ich glaube nicht Stackoverflow für Ihr Problem hier ist der richtige Ort: es ist entweder ein Fehler in Spoon oder in Astor. Ich schlage vor, Sie zuerst das Problem in Astor (https://github.com/SpoonLabs/astor/issues) zu öffnen und wir werden sehen, ob es Astor oder Löffel verwandt ist. Wenn Sie können, wenn Sie das Problem erstellen, stellen Sie das vollständige Befehlszeilenargument bereit, das Sie mit Astor verwendet haben, damit ich Ihren Fehler leicht replizieren kann.

+0

Es ist ein Problem mit aster, die Package-Informationen nicht korrekt behandelt. –

+0

Thx, habe es gerade gepostet. https://github.com/SpoonLabs/astor/issues/59 – Euphie

Verwandte Themen