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 project - Add 'MyClass' class into the java project: ------------------------------------------------------ public class MyClass { /** Creates a new instance of MyClass */ public MyClass() { } } ------------------------------------------------------ - Reverse engineer the Java project - Go to the source of the 'MyClass' class - Insert attribute and operation into the source code. Do not save the file. ------------------------------------------------------ public class MyClass { int a; /** Creates a new instance of MyClass */ public MyClass() { } public void test(){ } } ------------------------------------------------------ - Reverse engineer the 'MyClass' class - Expand the 'MyClass' element under the UML project Attribute and operation are not propagated in to the element. See also issue 78626 RE Operation: Created Sequence diagram is empty for new added operation
The key here is that the source file is not saved. We can assume that the file should be auto-saved. If in fact we should assume the clas should be auto-saved before RE is performed, please enter that as an Enhancement issue. However, this is currently working as expected/designed.
My last comment said "we can assume..." but should have read "we can NOT assume...".
The issue embarrasses users. I think that my snippet of code will be reverse engineered if I write it in to the java file. But it is not so. We do not need to assume that the class should be auto-saved. UML module should save the class before reverse engineering if it needs.
Changing summary to reflect core issue, because the RE process does RE all methods and attributes of the selected files, but it operates on the save file, not on unsaved modifications. This is working as designed. I have asked the iTeam to discuss and decide if the Java files should be auto-saved.
The decision is to save all dirty source files when RE action is invoked. As an extra enhancement, a dialog will be prompted to save files when the RE action is invoked. A global pref can be set to dismiss this dialog. Setting to P3 because this is as designed, no exceptions are thrown and the workaround is very simple. Workaround: Save All to save modified Java files to disk before invoking RE action.
Change priority to P2. Nobody remembers that java file should be saved before RE to show changes in model. So workaround is not obvious.
*** Issue 107282 has been marked as a duplicate of this issue. ***
raise it to p2 as it blocks issue 78626
add logic to save modified files in the source project before RE
fixed
verified in beta1 build 070905