Community
Participate
Working Groups
Hi, there are two valid Java sources which cause the core to crash with stacktrace: Exception in thread "main" java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ClassFile.getNewTypeBinding(ClassFile.java:5965) at org.eclipse.jdt.internal.compiler.ClassFile.traverse(ClassFile.java:6937) at org.eclipse.jdt.internal.compiler.ClassFile.generateStackMapTableAttribute(ClassFile.java:4826) at org.eclipse.jdt.internal.compiler.ClassFile.completeCodeAttribute(ClassFile.java:1519) at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.internalGenerateCode(ConstructorDeclaration.java:459) at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.generateCode(ConstructorDeclaration.java:297) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:579) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:649) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:412) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:912) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1044) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:662) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1013) Used the latest JDT core version from master branch File "x/EnsureImpl$1.java" package x; class EnsureImpl$1 { } File "x/C9947f.java" package x; public final class C9947f { public C9947f() { try { new x.EnsureImpl$1(); } catch (Throwable unused) { } } }
Caused by private TypeBinding getNewTypeBinding(char[] typeConstantPoolName, Scope scope) { char[] typeName = typeConstantPoolName; if (isLikelyLocalTypeName(typeName)) { // find local type in innerClassesBindings: Set<TypeBinding> innerTypeBindings = this.innerClassesBindings.keySet(); // innerClassesBindings is null
Is this a regression in 4.15? Can you attach a simple code example that triggers the error? Do you want to provide a patch?
> Can you attach a simple code example that triggers the error? Already attached > Do you want to provide a patch? No, I want the Eclipse team to fix it
(In reply to Sergey Toshin from comment #3) > > Can you attach a simple code example that triggers the error? > > Already attached Sorry, missed after flying over the stack. Thanks.
Thanks, I can reproduce. It's caused by the fix for bug 534223.
New Gerrit change created: https://git.eclipse.org/r/154931
(In reply to Eclipse Genie from comment #6) > New Gerrit change created: https://git.eclipse.org/r/154931 The fix is straight forward: when innerClassesBindings == null, we have no business interpreting EnsureImpl$1 as the name of an inner/local class. As usual, it was the test that took a little longer than the fix...
Gerrit change https://git.eclipse.org/r/154931 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=77745aef3d0522476f7e972af1db6be761f02986
(In reply to Eclipse Genie from comment #8) > Gerrit change https://git.eclipse.org/r/154931 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=77745aef3d0522476f7e972af1db6be761f02986 Released for 4.15 M1