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 145217 - Navigable associations converts to attributes in Class after roundtrip engineering.
Summary: Navigable associations converts to attributes in Class after roundtrip engine...
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Reverse Engineering (show other bugs)
Version: 6.x
Hardware: Other Windows Vista
: P1 blocker (vote)
Assignee: Viktor Lapitski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-26 22:10 UTC by eirik
Modified: 2008-09-11 01:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
classes after code gen and reverse engineering again (108.57 KB, image/png)
2008-08-30 01:48 UTC, Peter Lam
Details
ide log file (41.16 KB, text/plain)
2008-08-30 01:48 UTC, Peter Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eirik 2008-08-26 22:10:02 UTC
The roundtrip process, in this case, is as follows:
1) Reenginering Java source code to UML.
2) Generate code for a Class from the reenginered UML from step 1 without doing any changes in the UML model.
3) Reeinginering the generated class from step 2 without doing any change to the source code generated.

In step 3, navigable associations, converts to attributes in the class in the UML model. I testet it with navigable 
association and nvavigable aggregation. For ease of reproduction the error I've testet it with the Bank application 
bundled with the shipment of NB 6.1. One of the class tested was the BancAccount class associated with the History 
class in the sample application.

Thanks for an exiting product and letting me have insigth to the work through the open source paradigm.
Comment 1 Viktor Lapitski 2008-08-27 09:34:55 UTC
http://hg.netbeans.org/uml-main/rev/d0a9ecd3e287
Comment 2 Trey Spiva 2008-08-27 18:23:09 UTC
Reviewed
Comment 3 Peter Lam 2008-08-30 01:47:19 UTC
verified in build 20080829. 
Using the UML sample project on classes BankAccount and History, after code gen and reverse engineering, the Navigable
Aggregation between the BankAccount and History classes still turned into an attribute with getter and setter. The
Navigable Aggregation is still displayed on the diagram but it's no longer in the model, clicking on also shows empty on
properties window. Reopening the diagram will no longer show the Navigable Aggregation. Before closing, doing a Save
Document from the diagram window tab popped up the following exception. See attached ide log file for complete exception.

Exception for saving the diagram:

java.lang.NullPointerException
	at org.netbeans.modules.uml.diagrams.edges.AssociationConnector.writeAssociationEnd(AssociationConnector.java:458)
	at org.netbeans.modules.uml.diagrams.edges.AssociationConnector.save(AssociationConnector.java:429)
	at org.netbeans.modules.uml.drawingarea.persistence.PersistenceManager.saveDiagram(PersistenceManager.java:107)
	at org.netbeans.modules.uml.drawingarea.persistence.SaveDiagram.save(SaveDiagram.java:70)
...


At another reopen of the same diagram, got the following exception: See attached ide log file.

SEVERE [global]
com.sun.xml.stream.XMLStreamException2: ParseError at [row,col]:[468,1]
Message: XML document structures must start and end within the same entity.
	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:574)
[catch] at
org.netbeans.modules.uml.drawingarea.persistence.DiagramLoader.handleGraphEdgeContainedElements(DiagramLoader.java:1023)
	at org.netbeans.modules.uml.drawingarea.persistence.DiagramLoader.processGraphEdge(DiagramLoader.java:855)
	at org.netbeans.modules.uml.drawingarea.persistence.DiagramLoader.handleStartElement(DiagramLoader.java:272)
	at org.netbeans.modules.uml.drawingarea.persistence.DiagramLoader.readXML(DiagramLoader.java:201)
Comment 4 Peter Lam 2008-08-30 01:48:23 UTC
Created attachment 68691 [details]
classes after code gen and reverse engineering again
Comment 5 Peter Lam 2008-08-30 01:48:50 UTC
Created attachment 68692 [details]
ide log file
Comment 6 Peter Lam 2008-08-30 02:15:19 UTC
Steps to repro:
- create the uml sample project
- from the reverse engineered model, expand the Model down to the bankpack package
- select BankAccount and History classes
- right click and select CDFS to create a class diagram
- right click on the BankAccount class to generate code to the same java project
- right click on the BankAccount class to navigate to the source
- from the source editor, right click and select Reverse Engineer to the same uml project
- click on the class diagram tab now to see the new attribute on the BankAccount class
Comment 7 Viktor Lapitski 2008-09-05 04:04:42 UTC
http://hg.netbeans.org/uml-main/rev/491b60125e6a
Comment 8 Trey Spiva 2008-09-05 18:08:06 UTC
Reviewed
Comment 9 Peter Lam 2008-09-11 01:21:25 UTC
verified in NB 6.5 UML daily build 20080910. Please reopen if problem still exists in latest NB 6.5 build.