-
Notifications
You must be signed in to change notification settings - Fork 136
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
NullPointerException during Java Search #3451
Comments
cc @stephan-herrmann because of |
@ptziegler could you please provide a self-contained reproducer as text, so we can copy-and-paste it to a unit test? It would also be good to know if you have annotation-based null analysis enabled and with which details. Thanks |
package test;
import java.io.File;
public class Test {
public static Object create(File f) {
return null;
}
} recording.webmThe project is a simple Plugin with only Guava as a dependency:
This is from a fresh installation, so I don't think any annotations are enabled. |
As a side note: I don't think this exception has anything to do with the null-analysis. It just happens to be the |
I can reproduce, thanks. |
Internally, at the time of the exception we already recorded these problems:
The same problems are also in the list of errors if I import com.google.common.util.concurrent.MoreExecutors into the test project. But while compilation raises these errors, I don't see the NPE during compilation, only during search. |
Here's the reason for the hierarchy problem: com.google.common.util.concurrent.internal.InternalFutureFailureAccess cannot be resolved as a supertype for com.google.common.util.concurrent.AbstractFuture. |
events contributing to the NPE:
I believe the difference between search and compilation lies in the order of events: when directly resolving the hierarchy of NeverSuccessfulListenableFutureTask the missing grand-parent does not set It will be a bit tricky to create a unit test reproducing the bad sequence of events. The fix will probably just be adding a check for |
For completeness:
Right, it's not related to null analysis, any annotation in that position will do, and the not-found type causing the NPE is neither |
Resolve all type arguments even when the main type has an error Fixes eclipse-jdt#3451
This happens both in the 2024-12 and the 2024-09, but likely also in older versions of the Eclipse IDE.
(Plain stack trace for readability)
This is the reference causing the exception:
Class scope:
Method scope:
I believe that this issue is caused by the Nullable annotations of the Checker Framework used by Guava. The packages are not specified in the bundle manifest, it is not included in the target platform/Eclipse installation and therefore not in the classpath.
The text was updated successfully, but these errors were encountered: