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 147314 - java.lang.AssertionError popped up while pasting a copied composite to activity diagram
Summary: java.lang.AssertionError popped up while pasting a copied composite to activi...
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General Diagram (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 22:37 UTC by Peter Lam
Modified: 2008-09-19 22:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide log file (42.20 KB, text/plain)
2008-09-15 22:38 UTC, Peter Lam
Details
ide log file (22.51 KB, text/plain)
2008-09-18 01:39 UTC, Peter Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Lam 2008-09-15 22:37:34 UTC
build 20080915

while verifying issue 143108, the following exception popped up during pasting of a composite state element to an
activity diagram unintentionally. see attached ide log file for complete exception.

- create a state diagram and add a composite state
- copy the composite state
- create an activity diagram
- paste the composite to the activity diagram

java.lang.AssertionError
	at org.netbeans.modules.uml.diagrams.nodes.CompositeNodeWidget.duplicate(CompositeNodeWidget.java:118)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:296)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:205)
	at org.netbeans.modules.uml.drawingarea.actions.DiagramSceneAcceptAction.mouseClicked(DiagramSceneAcceptAction.java:78)
	at org.netbeans.api.visual.action.WidgetAction$Chain.mouseClicked(WidgetAction.java:752)
	at org.netbeans.api.visual.widget.SceneComponent$Operator$1.operate(SceneComponent.java:541)
...
Comment 1 Peter Lam 2008-09-15 22:38:08 UTC
Created attachment 69909 [details]
ide log file
Comment 2 Peter Lam 2008-09-15 22:55:17 UTC
The same error below also occurred if I pasted a copied partition to the state diagram. Note that is says
"CompositeNodeWidget.duplicate" instead of partition even though I copied and pasted the partition.

java.lang.AssertionError
	at org.netbeans.modules.uml.diagrams.nodes.CompositeNodeWidget.duplicate(CompositeNodeWidget.java:118)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:296)
	at org.netbeans.modules.uml.drawingarea.actions.SceneAcceptProvider.accept(SceneAcceptProvider.java:205)
	at org.netbeans.modules.uml.drawingarea.actions.DiagramSceneAcceptAction.mouseClicked(DiagramSceneAcceptAction.java:78)
	at org.netbeans.api.visual.action.WidgetAction$Chain.mouseClicked(WidgetAction.java:752)
Comment 3 Trey Spiva 2008-09-16 14:51:37 UTC
The element that was being copied into the activity diagram is not valid for the activity diagram.  Therefore a widget is not created to represent the model 
element.  However the copy logic was not handling the case of an invalid model element and therefore tried to duplicate the a null widget.  The duplicate 
method was then throwing an exception because the passed in widget was null.

http://hg.netbeans.org/uml-main?cmd=changeset;node=119c2af4b2ad
Comment 4 Trey Spiva 2008-09-16 18:52:28 UTC
Reviewed
Comment 5 Peter Lam 2008-09-18 01:38:41 UTC
verified in build 20080917.
Now if I pasted a partition to the state diagram, it doesn't work and no exception - that's good.
I then went back to the activity diagram and do a paste there, the following exception popped up. See attached ide log
file for complete exception.

java.lang.NullPointerException
	at
org.netbeans.modules.uml.core.metamodel.infrastructure.RelationFactory$RelationRetriever.addToElementMap(RelationFactory.java:1043)
	at
org.netbeans.modules.uml.core.metamodel.infrastructure.RelationFactory$RelationRetriever.<init>(RelationFactory.java:1021)
	at
org.netbeans.modules.uml.core.metamodel.infrastructure.RelationFactory.determineCommonRelations3(RelationFactory.java:568)
	at org.netbeans.modules.uml.diagrams.UMLRelationshipDiscovery.createCommonRelations(UMLRelationshipDiscovery.java:257)
...
Comment 6 Peter Lam 2008-09-18 01:39:16 UTC
Created attachment 70070 [details]
ide log file
Comment 7 Peter Lam 2008-09-18 01:40:49 UTC
I also got this same exception if I copied a composite state and pasted it to the activity diagram which doesn't work.
Then, going back to the state diagram and do paste there. The exception popped up.
Comment 8 Trey Spiva 2008-09-18 18:00:55 UTC
Fixed

http://hg.netbeans.org/uml-main/rev/60848149959c

Comment 9 Trey Spiva 2008-09-18 22:05:04 UTC
Reviewed
Comment 10 Peter Lam 2008-09-19 22:27:28 UTC
verified in build 20080919.