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 202071 - NullPointerException at org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem$5.run
Summary: NullPointerException at org.netbeans.modules.editor.java.JavaCompletionItem$M...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 13:43 UTC by jocke
Modified: 2011-09-17 14:24 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 181041


Attachments
stacktrace (3.24 KB, text/plain)
2011-09-13 13:43 UTC, jocke
Details
stacktrace (3.19 KB, text/plain)
2011-09-13 13:45 UTC, Maksim Khramov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jocke 2011-09-13 13:43:06 UTC
Build: NetBeans IDE Dev (Build 201109120600)
VM: Java HotSpot(TM) 64-Bit Server VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Linux

User Comments:
jocke: editing java source file




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem$5.run(JavaCompletionItem.java:1699)
   at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:314)
   at org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem.substituteText(JavaCompletionItem.java:1695)
   at org.netbeans.modules.editor.java.JavaCompletionItem.processKeyEvent(JavaCompletionItem.java:291)
   at org.netbeans.modules.editor.completion.CompletionImpl.dispatchKeyEvent(CompletionImpl.java:637)
   at org.netbeans.modules.editor.completion.CompletionImpl.keyTyped(CompletionImpl.java:392)
Comment 1 jocke 2011-09-13 13:43:11 UTC
Created attachment 110711 [details]
stacktrace
Comment 2 Maksim Khramov 2011-09-13 13:45:01 UTC
Created attachment 110712 [details]
stacktrace
Comment 3 torsten_paul 2011-09-14 16:33:31 UTC
The following steps can reproduce this in dev version 201109100600

1) Create a java class file that looks like so:

import javax.swing.JComponent;

public class Test {
void test() {
JComponent comp;

comp
}
}

2) Place the cursor at the end of the line with just the "comp"

3) Press '.' Key and wait for Code-Completion and JavaDoc windows to pop-up or invoke them with Ctrl-Space

4) Enter setFont so the line looks like "comp.setFont"

5) Enter '(' Key which causes the NullPointerException to be thrown
Comment 4 Selpi 2011-09-14 17:10:17 UTC
Yep, worked for me. Got a NPE for

Product Version         = NetBeans IDE Dev (Build 201109120600) (#c50ade4b58c7)
  Operating System        = Linux version 2.6.38-11-generic-pae running on i386
  Java; VM; Vendor        = 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_26-b03
  Java Home               = /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Comment 5 Exceptions Reporter 2011-09-15 07:56:23 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=181041
Comment 6 Dusan Balek 2011-09-15 08:50:43 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/34b979483344
Comment 7 Quality Engineering 2011-09-17 14:24:52 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/34b979483344
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #202071: NullPointerException at org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem$5.run - fixed.