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 226027 - NullPointerException at org.netbeans.modules.groovy.editor.api.ElementUtils.normalizeTypeName
Summary: NullPointerException at org.netbeans.modules.groovy.editor.api.ElementUtils.n...
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-12 15:44 UTC by Martin Janicek
Modified: 2013-02-19 01:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 198536


Attachments
stacktrace (2.46 KB, text/plain)
2013-02-12 15:44 UTC, Martin Janicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Janicek 2013-02-12 15:44:26 UTC
This issue was reported manually by mjanicek.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 20130207-f82543088efe)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07
OS: Linux

User Comments:
mjanicek: Finding usages of Tester class (invoked from Tester.something() method call)




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.groovy.editor.api.ElementUtils.normalizeTypeName(ElementUtils.java:297)
   at org.netbeans.modules.groovy.refactoring.findusages.impl.FindTypeUsagesVisitor.<init>(FindTypeUsagesVisitor.java:73)
   at org.netbeans.modules.groovy.refactoring.findusages.impl.FindTypeUsages.getVisitors(FindTypeUsages.java:61)
   at org.netbeans.modules.groovy.refactoring.findusages.impl.AbstractFindUsages$AddFindUsagesElementsTask.run(AbstractFindUsages.java:132)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:584)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:153)
Comment 1 Martin Janicek 2013-02-12 15:44:27 UTC
Created attachment 131301 [details]
stacktrace
Comment 2 Martin Janicek 2013-02-12 15:47:57 UTC
Might be related to the issue 226016.

Steps to reproduce:

1) Create Maven application
2) Create Groovy script in default package

def name='martin'
println "Hello $name!"
Tes^ter.something()

3) Create Groovy class in package "whatever"

package whatever

class Tester {

    public static void something() {
        Tester.something()
    }
}

..trying to run Find usages from the script (on the ^ position) the NPE occurs. If we add missing import for whatever.Tester, the exception does not occurs..
Comment 3 Martin Janicek 2013-02-18 14:49:45 UTC
Fixed in: web-main #92d11194b55c
Comment 4 Quality Engineering 2013-02-19 01:51:30 UTC
Integrated into 'main-golden', will be available in build *201302182300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/92d11194b55c
User: Martin Janicek <mjanicek@netbeans.org>
Log: #226027 - NullPointerException at org.netbeans.modules.groovy.editor.api.ElementUtils.normalizeTypeName