I am using Astor to do some automated bug repair work. Now I have problems compiling Hadoop submodule (i.e. hadoop/hadoop-common-project/hadoop-auth).
Seems that Spoon can NOT get the declared type from package-info.java file. Is there anyone knowing how to fix this issue? Thanks a lot!
I add an option in AbstractMain.java to run this bug, the folder 11859hadp is the a submodule of Hadoop project (hadoop/hadoop-common-project/hadoop-auth), which can be compiled and tested separately:
if (cmd.hasOption("hadoop11859")) {
dependenciespath = gatherDependencies(
"libBugs/11859hadp/lib/");
folder = "11859hadp";
failing = "org.apache.hadoop.security.authentication.server.TestPseudoAuthenticationHandler";
location = ("libBugs/11859hadp/");
packageToInstrument = "org.apache.hadoop.security.authentication.server";
faultLocalizationThreshold = 0.5;
}
As for other configuration, I just use the configuration.properties file, only change the alternativecompliancelevel from 4 to 7.
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)