-
Notifications
You must be signed in to change notification settings - Fork 130
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 org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode #1621
Comments
Unfortunately, this very code locations throws billions of expected NPEs, which are then caught in The following patch makes the specific situation directly observable using a simple breakpoint on the added sysout statement:
I would attach the file, but for something.patch as well as something.PATCH github simple tells me:
If a patch is not a patch then github doesn't look like a tool for software development. |
We (actually my colleague @jvalkeal did) found the exact piece of code that causes this issue:
The problem seems to be the method reference
the compiler doesn't throw a NPE. The referenced method looks like this:
You can reproduce the error also by opening the source file for the type
|
Minimal reproducer:
|
Actually, all these need to meet to trigger the bug:
In that case the synthetic lambda was unable to resolve that flow-scoped variable, causing Indeed different from any previous reports about NPE at this line of code. |
Thanks a lot finding the low level root cause! I suspected it has to do something with varargs but totally failed to create a minimal sample out from spring-integration code. |
Thanks for pointing in the right direction in the first place! :) Indeed creating a minimal sample can be quite tricky. In this case I started with just the offending method and then stubbed lots of types from spring (marveling at all those generic hierarchies :) ), just to make it compilable. How little of that was used for reproducing came as a surprise for myself. I couldn't understand the low level connections by looking at the example, though, I needed to debug it, to discover the chain of causes and effects, but that's our business as JDT committers :) |
Any chance to get this into the 2023-12 release? I saw RC2 is already out the door. Maybe a candidate for a RC2a or RC3? |
@stephan-herrmann Thanks so much for looking into this, very very much appreciated, and awesome to see that you already got this fixed!!! |
Hi, which release will be including this fix? |
2024-03 (it was the first commit after 2023-12). |
Follow up from #452 (comment)
JDT core compiler throws a
Steps to reproduce:
Initial build runs and error popup appears. Same happens when doing a
Project -> Clean...
on all projects or on thespring-integration-core
project individually.(Unfortunately, I haven't tracked this down to the exact code snippet that causes this, but I hope this helps to reproduce this nevertheless)
The text was updated successfully, but these errors were encountered: