Skip to content
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

Open
ptziegler opened this issue Dec 13, 2024 · 1 comment
Open

NullPointerException during Java Search #3451

ptziegler opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working null Issues related to null pointer analysis

Comments

@ptziegler
Copy link
Contributor

ptziegler commented Dec 13, 2024

This happens both in the 2024-12 and the 2024-09, but likely also in older versions of the Eclipse IDE.

image

(Plain stack trace for readability)

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.TypeBinding.leafComponentType()" because "this.resolvedType" is null
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveAnnotations(TypeReference.java:696)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.updateWithAnnotations(TypeReference.java:656)
	at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.updateWithAnnotations(SingleTypeReference.java:164)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.updateParameterizedTypeWithAnnotations(TypeReference.java:662)
	at org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference.updateWithAnnotations(ParameterizedQualifiedTypeReference.java:538)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateWithAnnotations(TypeDeclaration.java:1981)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1947)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1961)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.updateSupertypesWithAnnotations(TypeDeclaration.java:1961)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.integrateAnnotationsInHierarchy(CompilationUnitScope.java:443)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment$CompleteTypeBindingsSteps.perform(LookupEnvironment.java:195)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:565)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1326)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1388)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1508)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:143)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:276)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:620)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:677)
	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:178)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

This is the reference causing the exception:
image

Class scope:
image

Method scope:
image

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.

image

image

@jukzi jukzi added bug Something isn't working null Issues related to null pointer analysis labels Dec 13, 2024
@jukzi
Copy link
Contributor

jukzi commented Dec 13, 2024

cc @stephan-herrmann because of @Nullable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working null Issues related to null pointer analysis
Projects
None yet
Development

No branches or pull requests

2 participants