eclipse-jdt / eclipse-jdt/eclipse.jdt.core
NPE: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.MethodBinding.original()" because "p.accessorMethod" is null
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
```
java.lang.RuntimeException: Internal Error compiling /my/project/ThisClass.java
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.processing(ProcessTaskManager.java:139)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.MethodBinding.original()" because "p.accessorMethod" is null
at org.eclipse.jdt.internal.compiler.ast.RecordPattern.generateCode(RecordPattern.java:236)
at org.eclipse.jdt.internal.compiler.ast.CaseStatement.generateCode(CaseStatement.java:337)
at org.eclipse.jdt.internal.compiler.ast.SwitchStatement$SwitchTranslator.generateSwitchBlock(SwitchStatement.java:826)
at org.eclipse.jdt.internal.compiler.ast.SwitchStatement$SwitchTranslator.generateCode(SwitchStatement.java:891)
at org.eclipse.jdt.internal.compiler.ast.SwitchStatement.generateCode(SwitchStatement.java:1075)
at org.eclipse.jdt.internal.compiler.ast.SwitchExpression.generateCode(SwitchExpression.java:309)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.generateCode(LocalDeclaration.java:173)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:402)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:338)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:633)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:703)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:403)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:822)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.processing(ProcessTaskManager.java:135)
... 5 more
```
Haven't managed to isolate the cause yet. This happens in a class with a switch expression and a record pattern "deconstructor", unsurprisingly. There're several valid compilation errors in the (modular) project, so I assume there's some ill cascade because when the compilation errors are fixed there's no issue. Not sure if there's enough info to investigate where the `null` comes from.
eclipse.buildId=4.38.0.I20250927-1800
java.version=25
Contributor guide
Assessment
This issue has not been assessed yet.