-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
NPE in noclasspath #406
Comments
This bug is already fixed in the version 4.4.0 but there is another bug with anonymous class in noclasspath. This is the anonymous class: new Lock.With(directory.makeLock("commit.lock")) {
public Object doBody() throws IOException {
if (create)
segmentInfos.write(directory);
else
segmentInfos.read(directory);
return null;
}
}.run(); This is the stacktrace: java.lang.NullPointerException
at spoon.support.compiler.jdt.JDTTreeBuilder.createType(JDTTreeBuilder.java:973)
at spoon.support.compiler.jdt.JDTTreeBuilder.visit(JDTTreeBuilder.java:3004)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1374)
at spoon.support.compiler.jdt.JDTTreeBuilder.visit(JDTTreeBuilder.java:2542)
at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.traverse(QualifiedAllocationExpression.java:604)
at spoon.support.compiler.jdt.JDTTreeBuilder.visit(JDTTreeBuilder.java:2341)
at org.eclipse.jdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:1031)
at org.eclipse.jdt.internal.compiler.ast.Block.traverse(Block.java:139)
at org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement.traverse(SynchronizedStatement.java:212)
at spoon.support.compiler.jdt.JDTTreeBuilder.visit(JDTTreeBuilder.java:1989)
at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.traverse(ConstructorDeclaration.java:605)
at spoon.support.compiler.jdt.JDTTreeBuilder.visit(JDTTreeBuilder.java:3085)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1319)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:748)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:709)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildSources(JDTBasedSpoonCompiler.java:227)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:480)
at spoon.Launcher.buildModel(Launcher.java:664)
at spoon.Launcher.run(Launcher.java:616)
at spoon.test.invocations.InvocationTest.testInvocation(InvocationTest.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) |
We have a problem here. In noclasspath, JDT returns 0 information about the class which covers the anonymous class. |
can we simply work around the exception and having at least an |
We can create a |
OK for me. |
spoon4.3 -x -i IndexWriter.java (attached
IndexWriter.java.txt
)
results in
The text was updated successfully, but these errors were encountered: