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 78710 - get/set methods are not deleted automatically if class has aggregation link
Summary: get/set methods are not deleted automatically if class has aggregation link
Status: RESOLVED WORKSFORME
Alias: None
Product: uml
Classification: Unclassified
Component: Reverse Engineering (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-21 05:21 UTC by bugbridge
Modified: 2008-06-20 00:14 UTC (History)
1 user (show)

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 bugbridge 2006-06-21 05:21:16 UTC
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;
    }
  }
Comment 1 Craig Conover 2006-10-12 01:07:47 UTC
This scenario is obsolete because of the Roundtrip Redisgn: issue 84855
Comment 2 Alexandr Scherbatiy 2006-11-14 10:55:19 UTC
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.








Comment 3 Joanne Lau 2008-06-20 00:14:07 UTC
Not reproducible in 6.5