This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51070 - [gjast] NPE from "Fix Imports"
Summary: [gjast] NPE from "Fix Imports"
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-02 11:43 UTC by vtec
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide session log (21.48 KB, patch)
2004-11-02 11:49 UTC, vtec
Details | Diff
Source file causing the NPE (8.51 KB, text/plain)
2004-11-04 08:35 UTC, vtec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vtec 2004-11-02 11:43:40 UTC
I have got this NPE when invoking "Fix Imports".
Afterwards the feature is unusable - have to
restart the IDE.

java.lang.NullPointerException
	at java.lang.String.concat(String.java:1503)
	at
org.netbeans.modules.javacore.parser.MemberClassScope.lookup(MemberClassScope.java:60)
	at
org.netbeans.modules.javacore.parser.Scope.lookupMembers(Scope.java:85)
	at
org.netbeans.modules.javacore.parser.Scope.lookup(Scope.java:48)
	at
org.netbeans.modules.javacore.parser.MDRParser.getMemberOf(MDRParser.java:2076)
	at
org.netbeans.modules.javacore.parser.MDRParser.processMultiPartId(MDRParser.java:2041)
	at
org.netbeans.modules.javacore.parser.MDRParser.processMultiPartId(MDRParser.java:2038)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1910)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1892)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1927)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1573)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1927)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1573)
	at
org.netbeans.modules.javacore.parser.MDRParser.processASTBody(MDRParser.java:1540)
	at
org.netbeans.modules.javacore.parser.MDRParser.enterBody(MDRParser.java:180)
	at
org.netbeans.modules.javacore.parser.MDRParser.doAttribution(MDRParser.java:154)
	at
org.netbeans.modules.javacore.parser.MDRParser.isVariableAccess(MDRParser.java:982)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getElementProxy(MetadataElement.java:577)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.createElement(MetadataElement.java:498)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.initOrCreate(MetadataElement.java:983)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.LocalVarDeclarationImpl.initChildren(LocalVarDeclarationImpl.java:91)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.LocalVarDeclarationImpl.getVariables(LocalVarDeclarationImpl.java:75)
	at
org.netbeans.jmi.javamodel.LocalVarDeclaration$Impl.getVariables(Unknown
Source)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.LocalVarDeclarationImpl.getChildren(LocalVarDeclarationImpl.java:81)
	at
org.netbeans.jmi.javamodel.LocalVarDeclaration$Impl.getChildren(Unknown
Source)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:497)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:503)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:503)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:503)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:503)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.findPotentialClassNames(JavaFixAllImports.java:511)
	at
org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeededImports(JavaFixAllImports.java:116)
	at
org.netbeans.modules.editor.java.JavaFixAllImports$1.run(JavaFixAllImports.java:67)
Comment 1 vtec 2004-11-02 11:49:34 UTC
Created attachment 18665 [details]
ide session log
Comment 2 Martin Roskanin 2004-11-02 12:09:33 UTC
Reassigning to java module
Comment 3 Martin Matula 2004-11-02 17:17:19 UTC
Tomas, please evaluate.
Comment 4 Tomas Hurka 2004-11-03 13:27:32 UTC
Please attach the source file, where you invoked "Fix Imports". Thanks.
Comment 5 vtec 2004-11-04 08:34:02 UTC
Here is the file, it now looks different from the time when I have
encountered the NPE however "Fix Imports" still fails with the same
NPE whenever invoked witch is not the case with other source files in
the same project. The file is OK and compilable, so ho knows what is
going on?
Comment 6 vtec 2004-11-04 08:35:14 UTC
Created attachment 18716 [details]
Source file causing the NPE
Comment 7 Tomas Hurka 2004-11-04 14:56:32 UTC
Thanks for the file. I can reproduce it. 
Comment 8 Tomas Hurka 2004-11-04 15:28:19 UTC
It seems to me like gjast problem. Somehow MULTI_PART_ID has second part (subtree with 
index 1) which is not IDENTIFIER. Please investigate. 
Comment 9 _ tball 2004-11-10 03:55:06 UTC
Fixed support for trees for the source pattern
"<multi-part-id>.super.<identifier>".  Tests had already verified that
"<multi-part-id>.super" and "super.<identifier>" worked.
Comment 10 Martin Matula 2004-11-10 19:47:59 UTC
P3->P2 - this needs to be fixed in release40 branch
Comment 11 Martin Matula 2004-11-10 21:42:23 UTC
I reviewed the diff and it seems to be OK. I also verified that this
issue is no longer reproducible.
Comment 12 Martin Matula 2004-11-11 09:21:44 UTC
Fix merged to release40 on behalf of Tom.

Checking in external/gjast.jar.scrambled;
/cvs/java/external/gjast.jar.scrambled,v  <--  gjast.jar.scrambled
new revision: 1.89.4.1; previous revision: 1.89
done
Comment 13 Quality Engineering 2007-09-20 10:46:36 UTC
Reorganization of java component