Bug 511131 - Name.resolveBinding() throws NullPointerException (in SourceTypeBinding.resolveTypeFor())
Summary: Name.resolveBinding() throws NullPointerException (in SourceTypeBinding.resol...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-26 14:15 EST by Ivan Ivan CLA
Modified: 2022-11-14 12:10 EST (History)
1 user (show)

See Also:


Attachments
Main.java (1.75 KB, application/octet-stream)
2017-01-26 14:15 EST, Ivan Ivan CLA
no flags Details
Sources.zip (1.35 KB, multipart/x-zip)
2017-01-26 14:16 EST, Ivan Ivan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Ivan CLA 2017-01-26 14:15:47 EST
Created attachment 266475 [details]
Main.java

Hi. Behaviour is really weird. I noticed that NPE happen only when I try to get binding of a QualifiedName which source file wasn't send to ASTParser.createASTs(...), but exists in source directory (I set it using ASTParser.setEnvironment(..., HERE, ..., ...)

Exception: 
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypeFor(SourceTypeBinding.java:1729)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getField(SourceTypeBinding.java:1202)
	at org.eclipse.jdt.core.dom.DefaultBindingResolver.resolveName(DefaultBindingResolver.java:1308)
	at org.eclipse.jdt.core.dom.Name.resolveBinding(Name.java:87)
	at ...

I attached two files. Main.java generates the bug, Sources.zip is file that should be unzipped
Replace
static final File srcRoot = new File("C:\\source");
with your own source directory
Comment 1 Ivan Ivan CLA 2017-01-26 14:16:48 EST
Created attachment 266476 [details]
Sources.zip
Comment 2 Ivan Ivan CLA 2017-05-26 08:38:18 EDT
Hi, any changes? I get this exception really often
Comment 3 Stephan Herrmann CLA 2017-05-26 10:03:06 EDT
Sorry, we ran out of time for 4.7.

Putting on our radar for 4.8.
Comment 4 Manoj N Palat CLA 2018-05-17 03:25:17 EDT
bulk move out of 4.8
Comment 5 Ivan Ivan CLA 2019-04-17 09:18:36 EDT
Hi, any changes? Doesn't seem to be fixed, but last comment was long time ago
Comment 6 Eclipse Genie CLA 2022-11-14 12:10:43 EST
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.