Bug 572979 - java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.TypeBinding.needsUncheckedConversion(org.eclipse.jdt.internal.compiler.lookup.TypeBinding)" because "argumentType" is null
Summary: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compi...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-04-19 13:40 EDT by Pedro Lamarão CLA
Modified: 2024-03-20 00:29 EDT (History)
2 users (show)

See Also:


Attachments
About > Installation Details > Configuration (772.57 KB, text/plain)
2021-04-19 13:42 EDT, Pedro Lamarão CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Lamarão CLA 2021-04-19 13:40:49 EDT
I get this error systematically when trying to run JUnit 5 tests for a JDT + Buildship project. Lombok plugins is installed.


eclipse.buildId=4.19.0.I20210303-1800
java.version=15.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

org.eclipse.jdt.junit
Error
Mon Apr 19 14:31:15 BRT 2021
Error

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.TypeBinding.needsUncheckedConversion(org.eclipse.jdt.internal.compiler.lookup.TypeBinding)" because "argumentType" is null
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.checkInvocationArgument(ASTNode.java:362)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.checkInvocationArguments(ASTNode.java:448)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:953)
	at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:390)
	at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:259)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:131)
	at org.eclipse.jdt.internal.compiler.ast.LambdaExpression.resolveType(LambdaExpression.java:458)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolvePolyExpressionArguments(ASTNode.java:721)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1024)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:838)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1113)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:144)
	at org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:1209)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:661)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:362)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:570)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1493)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1618)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:662)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:875)
	at org.eclipse.jdt.internal.core.hierarchy.RegionBasedHierarchyBuilder.createTypeHierarchyBasedOnRegion(RegionBasedHierarchyBuilder.java:86)
	at org.eclipse.jdt.internal.core.hierarchy.RegionBasedHierarchyBuilder.build(RegionBasedHierarchyBuilder.java:55)
	at org.eclipse.jdt.internal.core.hierarchy.RegionBasedTypeHierarchy.compute(RegionBasedTypeHierarchy.java:79)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1319)
	at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:94)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:740)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:806)
	at org.eclipse.jdt.core.JavaCore.newTypeHierarchy(JavaCore.java:5034)
	at org.eclipse.jdt.internal.junit.launcher.JUnit5TestFinder.findTestsInContainer(JUnit5TestFinder.java:217)
	at org.eclipse.jdt.internal.junit.util.TestSearchEngine.lambda$0(TestSearchEngine.java:42)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Comment 1 Pedro Lamarão CLA 2021-04-19 13:42:07 EDT
Created attachment 286171 [details]
About > Installation Details > Configuration
Comment 2 Manoj N Palat CLA 2021-04-22 12:20:50 EDT
Could you please attach a self contained reproducible test case?
Comment 3 raisercostin grigore CLA 2022-03-17 03:27:57 EDT
I've got a similar problem while using `lombok.val` feature. Triggering an `open hierarchy` on any type in that file produced the error.

Fortunately we are on java15 so we could replace all lombok's `val` with java's `var`.
Comment 4 Eclipse Genie CLA 2024-03-20 00:29:49 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.