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.
Original status: 1-Dispatched; Suggested Status: NEW Original submitter: sunflower Description: Netbeans 5.5 Preview (build 2006.01.31) Steps to reproduce: - Put class element on class diagram and name it 'Class1'. - Put class element on class diagram and name it 'Class2'. - Insert 'Class2 class2;' attribute in to the source code of the 'Class1' class. The 'Aggregation' link is drawn from 'Class1' to 'Class2'. get/set methods are created for 'class2' attribute in the 'Class1' class. - Delete 'Class2' class element from UML project tree. - Push 'Yes' button on 'Delete Associated Methods' dialog. The 'Class2' class element is deleted. get/set methods disappears from 'Class1' class element on the diagram. - Build the java project. The java project is not built. This is source code of the 'Class1' class. The 'class2' attribute was deleted but get/set methods still exists. public class Class1 { public Class1() { } public Class2 getClass2() { return class2; } public void setClass2(Class2 val) { this.class2 = val; } }
This scenario is obsolete because of the Roundtrip Redisgn: issue 84855
You could use Generate Code/Reverse Engineering even if live roundtrip is removed. Steps to reproduce: - Create a Class diagram - Put a Class element on the diagram and name it 'Class1'. - Put a Class element on the diagram and name it 'Class2'. - Generate code for the elements into Java project - Insert 'Class2 class2;' attribute in to the source code of the 'Class1' class. - Right click on the class, select Refactor -> Encapsulate Fields -> Opens a new window "Encapsulate Fields" -> Check the Create Setter & Create Getter for the fields which you want generate setters/getters methods -> Next -> Do Refactoring. The set/get methods are created: ---------------------------------------------------------------- public class Class1 { private Class2 class2; public Class1() { } public Class2 getClass2() { return class2; } public void setClass2(Class2 class2) { this.class2 = class2; } } ---------------------------------------------------------------- - Reverse Engineer the Java project into existing UML project An 'Aggregation' link is drawn from 'Class1' to 'Class2'. The get/set methods are created for 'Class1' element. - Delete 'Class2' class element from UML project tree. The get/set methods are not removed from 'Class1' element.
Not reproducible in 6.5