-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPEFix on Closure throws a "spoon.SpoonException: Cannot create MethodTypingContext" #20
Comments
It seems that if I update spoon-core to version 8.1.0 the java -jar "$NPEFIX_JAR" \
--test "com.google.javascript.jscomp.CommandLineRunnerTest:com.google.javascript.jscomp.CompilerTest:com.google.javascript.jscomp.IntegrationTest:com.google.javascript.jscomp.OptimizeCallsTest:com.google.javascript.jscomp.RemoveUnusedVarsTest:com.google.javascript.jscomp.jsonml.SecureCompilerTest" \
--iteration 100 \
--complianceLevel 8 \
--workingdirectory . \
--source "$src_dir:$test_dir" \
--classpath "$classpath" \
--repairStrategy "fr.inria.spirals.npefix.main.all.DefaultRepairStrategy"
[main] INFO spoon.Launcher - Running in NOCLASSPATH mode (doc: http://spoon.gforge.inria.fr/launcher.html).
TernarySplitter in 440ms
return (mismatchA == null) && (mismatchB == null)
return (mismatchA == null) && (mismatchB == null)
return (key != null) && (key.length() > 0)
Preconditions.checkState(references != null)
Preconditions.checkState(key != null)
Preconditions.checkState(id != null)
...
Preconditions.checkState((currentTracer != null) && (currentPassName != null))
Preconditions.checkState((currentTracer != null) && (currentPassName != null))
Preconditions.checkState(injectableBlock != null)
CheckNotNull in 2740ms
ForceNullInit in 183ms
AddImplicitCastChecker --> 15 in 557ms
BeforeDeref --> 20352 (failed:0) in 4607ms
target--> 23537 (failed:0) in 39152ms
TryRegister # Try: 95 in 384ms
Assign --> 9678 (failed: 0) in 18111ms
VarInit --> 3030 in 4123ms
MethodEncapsulation # Method: 7470 in 64593ms
ConstructorEncapsulation # Constructor: 771 in 22042ms
VariableFor in 1210ms
spoon.support.compiler.SnippetCompilationError: The import com.google.debugging.sourcemap.proto.Mapping.OriginalMapping.Builder collides with another import statement at SourceMapConsumerV1.java:11
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblemsWhenCompiling(JDTBasedSpoonCompiler.java:609)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.compile(JDTBasedSpoonCompiler.java:167)
at fr.inria.spirals.npefix.main.all.Launcher.instrument(Launcher.java:109)
at fr.inria.spirals.npefix.main.run.Main.run(Main.java:70)
at fr.inria.spirals.npefix.main.run.Main.main(Main.java:50)
Usage: java -jar npefix.jar
(-s|--source) source1:source2:...:sourceN (-c|--classpath) <classpath> (-t|--test) test1:test2:...:testN [--complianceLevel <complianceLevel>] [(-i|--iteration) <iteration>] [(-w|--workingdirectory) <workingdirectory>] [--repairStrategy <repairStrategy>]
(-s|--source) source1:source2:...:sourceN
Define the path to the source code of the project.
(-c|--classpath) <classpath>
Define the classpath of the project.
(-t|--test) test1:test2:...:testN
Define the tests of the project (both failing and passing),
fully-qualified, separated with ':' (even if the classpath contains
other tests, only those are considered.
[--complianceLevel <complianceLevel>]
The compliance level of the project. (default: 7)
[(-i|--iteration) <iteration>]
The maximum number of npefix iteration. (default: 100)
[(-w|--workingdirectory) <workingdirectory>]
Define the location where npefix will put its files. (default: .)
[--repairStrategy <repairStrategy>]
Define the repair strategy used by NPEFix. (default:
fr.inria.spirals.npefix.main.all.DefaultRepairStrategy)
Exception in thread "main" spoon.support.compiler.SnippetCompilationError: The import com.google.debugging.sourcemap.proto.Mapping.OriginalMapping.Builder collides with another import statement at SourceMapConsumerV1.java:11
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblemsWhenCompiling(JDTBasedSpoonCompiler.java:609)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.compile(JDTBasedSpoonCompiler.java:167)
at fr.inria.spirals.npefix.main.all.Launcher.instrument(Launcher.java:109)
at fr.inria.spirals.npefix.main.run.Main.run(Main.java:70)
at fr.inria.spirals.npefix.main.run.Main.main(Main.java:50) |
It is probably a case that we don't handle properly in NPEFix, we will need to debug and fix NPEFix to handle this case (if possible). NPEFix does a LOT of code instrumentation and it is difficult to be 100% compatible with all existing java projects. |
Thanks @tdurieux. Looking forward for that fix. |
Dear NPEFix's maintainers,
I've been trying to run NPEFix on Closure from the Defects4J benchmark but no success so far. I'm getting a "spoon.SpoonException: Cannot create MethodTypingContext" exception for every single repair attempt.
Please find below a step-by-step to reproduce the exception.
Get NPEfix
Get Defects4J
Checkout and compile Closure-1b
Repair Closure-1b
Is this a known issue or am I running NPEFix incorrectly?
--
Best
Jose
The text was updated successfully, but these errors were encountered: