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.
Steps to reproduce: - Create a Java-Platform Model UML project - Add a package with scoped Class diagram - Put a Class element on the diagram and name It - Generate code for the UML project - Insert an operation to the element - Generate code for the UML project Java file which contains the operation is generated for the element - Delete the operation from the element - Generate code for the UML project The operation is not removed from the java code
There is one more problem with operation/attribution modifying: - Add 'public void op()' operation to the class element - Generate code Java code is: ---------------------------- public class MyClass { public MyClass() { } public void op() { } } --------------------------- - Insert 'int a' argument in to the operation - Generate code Java code is: --------------------------- public class MyClass { public MyClass() { } public void op() { } public void op(int arg) { } } --------------------------- The java code contains 'public void op()' operation. Is it another issue or the problem is the same as for operation deleting issue?
This is as designed. We may address this in FCS, however, but it is not a regression. Here's why... When you generate code for an element, it is just adding what is not already there. So if you gen code for an element, then delete an attribute or an operation from the element, and then gen code again, it is not "re-generating" the deleted attr/ops, it just isn't removing them from the current source file. I realize this is not intuitive, but it is known and expected at this stage of the roundtrip redesign. Same goes for a deleted Class element. If you gen code for an entire project, then delete a class element, and gen code again for the project, the class is not removed from the source folder, rather it is left as is. Basically, the RE and GC actions do not support subtractive actions at this point. This will be addressed probably for FCS, and definitely for the next release.
This is now addressed. We are deleting the contents of the current source file and regenerating all existing members of the element (literals, attr, ops, etc). This is addressed in issue 87423
verified in all-nbms-griffin-061018_35