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 18055 - Exception thrown from new Java wizard, Override Inherited Methods page.
Summary: Exception thrown from new Java wizard, Override Inherited Methods page.
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Dialogs&Wizards (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Peter Zavadsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-23 15:37 UTC by iformanek
Modified: 2008-12-22 16:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Suggested patch (3.13 KB, patch)
2001-12-05 14:26 UTC, Peter Zavadsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description iformanek 2001-11-23 15:37:13 UTC
Not sure what I was doing, I cannot reproduce anymore, perhaps something could 
be seen from the exception:

Fri Nov 23 16:33:29 CET 2001: java.lang.ArrayIndexOutOfBoundsException: <no 
message>
java.lang.ArrayIndexOutOfBoundsException
        at javax.swing.plaf.basic.BasicListUI.updateLayoutState
(BasicListUI.java:717)
        at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState
(BasicListUI.java:660)
        at javax.swing.plaf.basic.BasicListUI.getCellBounds
(BasicListUI.java:536)
        at javax.swing.JList.getCellBounds(JList.java:800)
        at javax.swing.JList.ensureIndexIsVisible(JList.java:750)
        at org.openide.WizardDescriptor$WizardPanel.setSelectedIndex
(WizardDescriptor.java:1285)
        at org.openide.WizardDescriptor$PropL.propertyChange
(WizardDescriptor.java:997)
        at org.openide.WizardDescriptor$2.run(WizardDescriptor.java:408)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:131)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:98)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
Comment 1 Svata Dedic 2001-11-23 16:05:58 UTC
IMHO this seems more like the wizard subsystem. Which template did you
tried to use ? Wasn't it the Interface one ?
Comment 2 Jan Chalupa 2001-11-27 12:49:24 UTC
Target milestone -> 3.3.1.
Comment 3 Tomas Hurka 2001-11-29 11:21:34 UTC
Moving to openide.
Comment 4 Peter Zavadsky 2001-11-29 17:29:31 UTC
From the code it seems to be a synch problem. 
While providing method BasicListUI.updateState, there has to be
changed list model concurrently (performing code between lines 691 and
703 in the UI), i.e. its size. 
Since the updateLayout runs always in the AWT thread (see WD line
about 406, used Mutex.EVENT), the quilty should be some another thread.

To change the list model is possible via WD.updateState method, which
can be called via WD.setTitleFormat, WD.setPanels which are both
public methods (also from WD.Listener). So there could be more
problematic code.

There should be found if setTitleFormat or setPanels could be called
from another than AWT thread and if yes probably fix it there.

CC Svata. Please have a look in java wizard impl if something like
that is not possible.

Comment 5 Peter Zavadsky 2001-12-05 14:26:04 UTC
Created attachment 3695 [details]
Suggested patch
Comment 6 Peter Zavadsky 2001-12-05 14:31:10 UTC
I looked at it again and guess better it would be to synchronize in WD
directly. There are two entry points which needs to be synchronized. 
The pieces in WizardPanel.setContent and setSelectedIndex method.
I think the most natural way is ensure the critical codes are perfomed
in AWT thread, see the attachment.
I'll ask somebody on [nbdev] to revise the patch., if it is correct
method.
Comment 7 Jaroslav Tulach 2001-12-07 09:15:32 UTC
The fix seems to make things just better. 
Comment 8 Peter Zavadsky 2001-12-07 09:27:52 UTC
Fixed in [release33].

Fix:
openide/../openide/WizardDescriptor.java [1.56.2.1]

Note: I looked at it again, tested a bit and decided to put in.
Note the fix has just slight "syntax" difference from the patch. 
(EVENT.readAccess(Runnable) -> EVENT.writeAccess(Runnable) in
setContent to be cosher, the inside impl's are same).
Comment 9 Marian Mirilovic 2003-01-15 13:01:47 UTC
verified, closed