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 86687 - Reverse Engineer action should auto-save dirty Java source files before RE process
Summary: Reverse Engineer action should auto-save dirty Java source files before RE pr...
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Reverse Engineering (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords:
: 107282 (view as bug list)
Depends on:
Blocks: 107278 78626
  Show dependency tree
 
Reported: 2006-10-06 15:45 UTC by Alexandr Scherbatiy
Modified: 2007-10-19 21:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2006-10-06 15:45:35 UTC
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
Comment 1 Craig Conover 2006-10-10 06:32:58 UTC
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.
Comment 2 Craig Conover 2006-10-10 06:34:06 UTC
My last comment said "we can assume..." but should have read "we can NOT assume...".
Comment 3 Alexandr Scherbatiy 2006-10-10 10:30:16 UTC
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.
Comment 4 Craig Conover 2006-10-12 20:50:20 UTC
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.
Comment 5 Craig Conover 2006-10-17 06:16:56 UTC
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.
Comment 6 Alexandr Scherbatiy 2006-10-17 14:10:00 UTC
Change priority to P2. Nobody remembers that java file should be saved
before RE to show changes in model. So workaround is not obvious.
Comment 7 Yang Su 2007-06-20 19:54:29 UTC
*** Issue 107282 has been marked as a duplicate of this issue. ***
Comment 8 Yang Su 2007-08-14 00:13:21 UTC
raise it to p2 as it blocks issue 78626
Comment 9 Yang Su 2007-08-14 20:53:48 UTC
add logic to save modified files in the source project before RE 
Comment 10 Yang Su 2007-08-14 20:55:48 UTC
fixed
Comment 11 Peter Lam 2007-09-06 09:44:27 UTC
verified in beta1 build 070905