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 199917 - NullPointerException at org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.containsDeclaredType
Summary: NullPointerException at org.netbeans.modules.editor.java.JavaCodeTemplateProc...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0.1
Hardware: All All
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 10:46 UTC by gtg
Modified: 2011-08-05 14:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 179724


Attachments
stacktrace (4.58 KB, text/plain)
2011-07-06 10:46 UTC, gtg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gtg 2011-07-06 10:46:44 UTC
Build: NetBeans IDE Dev (Build 201106280600)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03
OS: Linux

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.containsDeclaredType(JavaCodeTemplateProcessor.java:849)
   at org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.getProposedValue(JavaCodeTemplateProcessor.java:401)
   at org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.parameterValueChanged(JavaCodeTemplateProcessor.java:159)
   at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.notifyParameterUpdate(CodeTemplateInsertHandler.java:446)
   at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.stateChanged(CodeTemplateInsertHandler.java:512)
   at org.netbeans.lib.editor.codetemplates.textsync.TextRegionManager.fireEvent(TextRegionManager.java:240)
Comment 1 gtg 2011-07-06 10:46:48 UTC
Created attachment 109253 [details]
stacktrace
Comment 2 err 2011-07-29 16:45:40 UTC
Given:
    for(AttributeSet c : categories) {
        System.err.println("" + c.getAttribute(StyleConstants.NameAttribute));
        fore<TAB>
    }

With the "fore" expansion, tab to collection and enter "c.g<Ctrl- >", select getAttributeName (which is an enumerator) and hit ENTER. This produces the exception. 

This is in the exception report I just made
    http://statistics.netbeans.org/exceptions/exception.do?id=521433
It seems to be reproducible.
Comment 3 err 2011-07-29 16:47:34 UTC
Forgot to say. This is with 7.0.1 that I built a week or so ago.

Product Version: NetBeans IDE 7.0.1 (Build 20110719-dab2794e0789)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\7.0.1rc1
Comment 4 err 2011-07-29 16:54:50 UTC
The exception is also produced with
        for(AttributeSet c : categories) {
            System.err.println("" + c.getAttribute(StyleConstants.NameAttribute));
            Enumeration<?> attributeNames = c.getAttributeNames();
            whilen<TAB>
        }
Comment 5 Jiri Prox 2011-08-01 09:40:12 UTC
reproducible


Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Users\jprox\.netbeans\7.0
Comment 6 Dusan Balek 2011-08-04 09:26:29 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/db7d90f92bf3
Comment 7 Quality Engineering 2011-08-05 14:38:44 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/db7d90f92bf3
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #199917: NullPointerException at org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.containsDeclaredType - fixed.