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 78335 - "java.lang.ArrayIndexOutOfBoundsException: -1" on Remove Satisfier with more than 1 satisfier
Summary: "java.lang.ArrayIndexOutOfBoundsException: -1" on Remove Satisfier with more ...
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Design Center (show other bugs)
Version: 5.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Thuy.d Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-19 21:57 UTC by bugbridge
Modified: 2008-01-24 21:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-06-19 21:57:43 UTC
Original status: 1-Dispatched; Suggested Status: NEW

Description:
To reproduce:
- drag a requirement onto at least a couple of classes
- remove the satifiers alltogether by using "Remove Satisfier" item of context menu 
  of "Satisfiers" node of the requirement
BUG: exception thrown in the output:

java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.Vector.elementAt(Vector.java:435)
	at
javax.swing.tree.DefaultMutableTreeNode.getChildAt(DefaultMutableTreeNode.java:230)
	at
javax.swing.tree.VariableHeightLayoutCache.treeNodesRemoved(VariableHeightLayoutCache.java:543)
	at
javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesRemoved(BasicTreeUI.java:3703)
	at
com.sun.tools.ide.modeling.designpattern.DesignCenterSwingModel.fireTreeNodesRemoved(DesignCenterSwingModel.java:786)
	at
com.sun.tools.ide.modeling.designpattern.DesignCenterSwingModel.notifyOfRemovedChildren(DesignCenterSwingModel.java:527)
	at
com.sun.tools.ide.modeling.designpattern.DesignCenterSwingModel.removeNodeFromParent(DesignCenterSwingModel.java:1123)
	at
com.embarcadero.uml.ui.swing.projecttree.JProjectTree.removeFromTree(JProjectTree.java:1684)
	at
com.sun.tools.ide.modeling.requirements.RemoveSatisfierAction.actionPerformed(RemoveSatisfierAction.java:128)
	at
com.sun.tools.ide.modeling.designpattern.BaseActionWrapper.actionPerformed(BaseActionWrapper.java:57)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
	at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5253)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Max Sauer 2006-08-24 13:16:13 UTC
I'm getting this exception fairly often when working with UML designer.

---
Product Version         = NetBeans 5.5 Dev (Build 200608240000)
Operating System        = SunOS version 5.10 running on sparcv9
Java; VM; Vendor; Home  = 1.5.0_06; Java HotSpot(TM) 64-Bit Server VM
1.5.0_06-b05; Sun Microsystems Inc.; /usr/jdk1.5.0_06/jre
System Locale; Encoding = en (nb); ISO646-US
netbeans-ent_pack-5_5-beta-main-060822-solaris-sparc
creatorPack-qbuild2-bin-200608180000-solsparc-18_Aug_2006_0000
Comment 2 Thuy.d Nguyen 2007-11-02 00:41:26 UTC
This issue still exists in UML NB 6.0 and occurs on all platforms, not just linux or solaris.
Comment 3 Thuy.d Nguyen 2007-11-02 17:24:55 UTC
The same "Satisfiers" node was mistakenly removed multiple times if the node has more than one child nodes, which causes
the ArrayIndexOutOfBoundsException.  Fixed the code to assure the node being removed only once.
Comment 4 Joanne Lau 2008-01-24 21:53:41 UTC
Fix verified in NB 6.1 M1 build (200801222102)