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.
I have reverse engineered a UML project from my java project and created a class diagram by creating a diagram from selected elements. Then I created another class diagram and copied all elements from the first diagram to the second. The NPE pops and there are no any links on the second diagram. java.lang.NullPointerException at org.netbeans.modules.uml.ui.products.ad.drawengines.ETNodeDrawEngine.resize(ETNodeDrawEngine.java:1461) at org.netbeans.modules.uml.ui.products.ad.drawengines.ETNodeDrawEngine.sizeToContents(ETNodeDrawEngine.java:1638) at org.netbeans.modules.uml.ui.products.ad.drawengines.ETDrawEngine.delayedSizeToContents(ETDrawEngine.java:661) at org.netbeans.modules.uml.ui.support.applicationmanager.ProductGraphPresentation.reconnectPresentationElement(ProductGraphPresentation.java:201) at org.netbeans.modules.uml.ui.swing.drawingarea.ADDrawingAreaControl.clonePresentationElements(ADDrawingAreaControl.java:3758) at org.netbeans.modules.uml.ui.swing.drawingarea.ADDrawingAreaControl.crossDiagramPaste(ADDrawingAreaControl.java:3636) at org.netbeans.modules.uml.ui.swing.drawingarea.diagramtools.CrossDiagramPasteTool.onMouseReleased(CrossDiagramPasteTool.java:53) at com.tomsawyer.editor.TSEWindowInputTool.mouseReleasedEvent(DashoA9*..) at com.tomsawyer.editor.TSEWindowInputTool.access$400(DashoA9*..) at com.tomsawyer.editor.g6.mouseReleased(DashoA9*..) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232) 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) [catch] 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)
Created attachment 30488 [details] create diagram from selected elements
Created attachment 30489 [details] copy all elements to another diagram
I tried to reproduce the problem on my Windows XP
ops, I pressed the Enter key after adding myself to the cc list before completing my comment. Here it is. I tried several times but not able to replicate the problem. I reverse engineered the sample application from the following URL, created class diagram (called it cld#1) from all elements selected in the bankpack package including the bankpack itself, create a new class diagram, I then selected all elements from cld#1, selected Edit->Copy, and then pasted (Edit->Paste) to the new diagram. The result is that all copied elements are pasted to the new class diagram. No exception and no error from the ide log file either. Could you please provide more detail on how to reproduce the problem. Thanks. http://developers.sun.com/prodtech/javatools/jsenterprise/learning/tutorials/jse8/uml_re/BankApp.zip
Created attachment 30541 [details] Simple Graph Editor application
I have attached my SimpleGraphEditor application. Try to do the next actions: - Create a UML project by reverse engineering my app - Select all elements under 'diagram.element' package - Create class diagram from selected elements - Create a class diagram under UML Model tree - Select all elements from the first digram and copy them to the second diagram. The issue still exists.
Thanks for providing your app. I am able to reproduce the problem with your app now. I got the same exception which seems to indicate problem with redrawing. As for the links not showing, you can click on the "Relationship Discovery" toolbar button on the diagram window which draws all the existing links on the diagram. I also tried other things after dismissing the exception dialog and so far everything else I tried seemed to work ok functionally which can be used as a workaround for now. What is strange is that I tried with a few other java projects, but I was not able to reproduce this problem. Looks like there might be something used in your project that caused the problem but I can't tell yet.
The problem are the deverivation classifier. When being copied, the compartments are not being initialized correctly
The derivation classifier draw engine is now copying correctly.
*** Issue 78369 has been marked as a duplicate of this issue. ***
verified on uml nbms 20060926.