eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Internal compiler error since 2026-09: NPE: Cannot read the array length because "typeArguments" is null
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 49
Description
Under quite special circumstances, I get an internal compiler error.
I have a separate JPMS-Module containing only my own annotations for null specifications.
It is referenced by another module, which contains a class
```
public class MyClass>
{
private @NonNull Set mySet = new HashSet<>();
public class MyInnerClass
{
public MyInnerClass()
{
mySet.add(this);
}
}
}
```
The exact error message is:
`Internal compiler error: java.lang.RuntimeException: Internal Error compiling /MyProject/src/mypackage/MyClass.java at org.eclipse.jdt.internal.compiler.ProcessTaskManager.processing(ProcessTaskManager.java:139)`
If `mySet.add(this);` or `>` are removed, the project compiles without an error.
Also the error depends on some settings, which I could not specifically find out (configuring the annotations for null specifications is not enough).
You find attached a stripped down workspace, which shows the problem:
[workspace.tar.gz](https://github.com/user-attachments/files/32050901/workspace.tar.gz)
There is an NPE in the log:
ava.lang.NullPointerException: Cannot read the array length because "typeArguments" is null
at org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.mergeTypeAnnotations(NullAnnotationMatching.java:815)
at org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.weakerTypes(NullAnnotationMatching.java:797)
at org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.methodWithMergedNullAnnotations(NullAnnotationMatching.java:858)
at org.eclipse.jdt.internal.compiler.lookup.Scope.mostSpecificMethodBinding(Scope.java:4816)
at org.eclipse.jdt.internal.compiler.lookup.Scope.findDefaultAbstractMethod(Scope.java:1277)
at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1909)
at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1645)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3106)
at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1125)
at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:869)
at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1057)
at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:526)
at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:705)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:729)
at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.resolveStatements(ConstructorDeclaration.java:803)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:628)
at org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration.resolve(ConstructorDeclaration.java:766)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1460)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1602)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1350)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1611)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:661)
at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:975)
at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1017)
at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:296)
at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:362)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:244)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:108)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:751)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:816)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1431)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:132)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:94)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:91)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:189)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:125)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:139)
at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:98)
at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:398)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundWorker.lambda$0(AbstractReconciler.java:239)
at org.eclipse.jface.text.reconciler.AbstractReconciler$ReconcilerJob.run(AbstractReconciler.java:697)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Contributor guide
Assessment
This issue has not been assessed yet.