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 235652

Summary: NullPointerException at org.netbeans.modules.java.hints.suggestions.NameAndPackagePanel$2$1$1.run
Product: java Reporter: bb2eb
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal Keywords: THREAD
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203682
Attachments: stacktrace

Description bb2eb 2013-09-08 11:26:01 UTC
Build: NetBeans IDE 7.4 Beta (Build 201307092200)
VM: Java HotSpot(TM) Client VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7

User Comments:
bb2eb: package org.apache.commons.net.ftp;

public abstract interface Configurable{
    public abstract void configure(FTPClientConfig paramFTPClientConfig);
}




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.java.hints.suggestions.NameAndPackagePanel$2$1$1.run(NameAndPackagePanel.java:172)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
   at java.awt.EventQueue.access$200(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:688)
   at java.awt.EventQueue$3.run(EventQueue.java:686)
Comment 1 bb2eb 2013-09-08 11:26:03 UTC
Created attachment 139798 [details]
stacktrace
Comment 2 Svata Dedic 2013-09-09 13:43:58 UTC
I assume the fix "Create Subclass" was applied. The fix run from a RP, initializing an unsynchronized errorListener from a thread "A". Constructor spawns another task in a thread "B", which can execute immediately (in parallel to "A") and invoke the Runnable in RP. The Runnable COULD eventually run before "A" returns and sets up the Error Listener, though it does not seem likely.

It's more probable that since errorListener variable is not synchronized and it is initialized from "A" thread, the EDT sees still a stale null value.

Changed initialization / synchronization.

Fixed in http://hg.netbeans.org/jet-main/rev/d79d04993cd0
Comment 3 Quality Engineering 2013-09-15 01:26:12 UTC
Integrated into 'main-silver', will be available in build *201309150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d79d04993cd0
User: Svata Dedic <sdedic@netbeans.org>
Log: #235652: ensured visibility of errorListener after initialization