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 33199

Summary: IllegalStateException if IMT closed prematurely
Product: java Reporter: _ gtzabari <gtzabari>
Component: UnsupportedAssignee: issues@java <issues>
Status: RESOLVED WONTFIX    
Severity: blocker CC: genero, jkovar
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed patch to fix this bug.
Corrected patch for this bug.

Description _ gtzabari 2003-04-23 22:26:42 UTC
dev build 200304160100
Sun JDK 1.4.1

   If I invoke the Import Management Tool and hit
FINISHED before it finishes initializing (it reads
"please wait" on the main panel) I get the
following exception:

java.lang.IllegalStateException: Cannot initialize
-1th child of node null; it already belongs to
node
org.netbeans.modules.java.imptool.ImpDataSourceNode@13a98d3[Name=Class,
displayName=Class Name]
	at org.openide.nodes.Node.assignTo(Node.java:247)
	at
org.openide.nodes.Children$Array.refreshImpl(Children.java:1232)
	at
org.openide.nodes.Children$2.run(Children.java:1244)
	at org.openide.util.Mutex.postRequest(Mutex.java:875)
	at
org.openide.util.Mutex.postWriteRequest(Mutex.java:375)
	at
org.openide.nodes.Children$Array.refresh(Children.java:1242)
	at
org.openide.nodes.Children$Array.add(Children.java:1284)
	at
org.netbeans.modules.java.imptool.ImpDataSource.createRootFQNNode(ImpDataSource.java:278)
	at
org.netbeans.modules.java.imptool.ImpToolExecutor.finished(ImpToolExecutor.java:135)
[catch] at
org.openide.util.AsyncInitSupport.run(AsyncInitSupport.java:107)
	at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at
java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Comment 1 genero 2003-09-04 11:53:02 UTC
This (or similar) bug appears randomly on S1S5. Here is exception I've
got after numerous attempts to reproduce it:

S1S5
jdk1.4.1_02
Annotation: Exception occurred in Request Processor
java.lang.NullPointerException
	at
org.netbeans.modules.java.imptool.ImpDataSource.createRootFQNNode(ImpDataSource.java:278)
	at
org.netbeans.modules.java.imptool.ImpDataSource.runSilentFromNextStage(ImpDataSource.java:552)
	at
org.netbeans.modules.java.imptool.ImpToolExecutor.execute(ImpToolExecutor.java:85)
	at
org.netbeans.modules.java.imptool.ImpToolAction.performAction(ImpToolAction.java:41)
	at org.openide.util.actions.NodeAction.performAction(NodeAction.java:184)
	at
org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:175)
	at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:97)
	at org.openide.util.Task.run(Task.java:136)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)

Comment 2 genero 2003-09-04 12:05:57 UTC
Gili could you please add a testcase for this bug?
Comment 3 genero 2003-09-12 10:59:26 UTC
The problem is a variant of reader/writer mistiming. If Initializazion 
of data source called during asynchronious GUI job hasn't finished at
the moment when user press "Finish" button then one of the earlier 
reported exception may appear. 

To fix this problem I propose to disable "Finish" and "Next" buttons 
during asynchronious initilalization of data source. Once data has
initialized buttons are enabled again. This fix is doesn't lock 
"Cancel" button so user still have an option to interrupt the process.
Comment 4 genero 2003-09-12 11:01:24 UTC
Created attachment 11607 [details]
Proposed patch to fix this bug.
Comment 5 genero 2003-09-17 10:54:46 UTC
Created attachment 11645 [details]
Corrected patch for this bug.
Comment 6 Tomas Hurka 2003-10-10 12:03:16 UTC
*** Issue 36508 has been marked as a duplicate of this issue. ***
Comment 7 _ gtzabari 2003-10-31 13:41:42 UTC
Evgeni, is this issue solved?
Comment 8 psuk 2004-06-22 17:45:35 UTC
Closing as WONTFIX.
Import Management Tool was replaced by Fix Imports action