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 82473

Summary: Changing interface operation return type removes operation body from child
Product: uml Reporter: Alexandr Scherbatiy <sunflower>
Component: SynchronizationAssignee: Kris Richards <krichard>
Status: VERIFIED INVALID    
Severity: blocker    
Priority: P1    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Alexandr Scherbatiy 2006-08-11 11:27:24 UTC
Steps to reproduce:

- Create a Class diagram
- Put Interface element on the diagram and name it 'MyInterface'
- Insert 'void op()' operation into Interface element
- Put Class element on the diagram and name it 'MyClass'
- Draw 'Implementation' link from Class element to Interface element
- Go to source of 'MyClass' class element
- Insert 'System.out.println("Hello World!");' line into 'void op()' 
  operation
  ----------------------------------------------------------
  public class MyClass implements MyInterface{
    public MyClass() {
    }

    public void op() {
        System.out.println("Hello World!");
    }
  }
  ----------------------------------------------------------
- Go to the diagram
- Select 'MyInterface' interface element
- Change 'op' operation type from 'void' to 'int' for Interface element
- Go to the source of 'MyClass' class element
  'op' operation body was removed

  ----------------------------------------------------------
  public class MyClass implements MyInterface{
    public MyClass() {
    }

    public int op() {
        return 0;
    }
  }
  ----------------------------------------------------------
Comment 1 Craig Conover 2006-08-14 19:09:34 UTC
Review: bug is as stated. Source code body should never be overwritten, or at
least should be prompted to do something with it, like leave in method, but
comment it out, or keep old operation but commented out.
Comment 2 Kris Richards 2006-10-06 22:29:11 UTC
with the new "generate code" feature, this bug is no longer valid.
Comment 3 Kris Richards 2006-10-06 22:29:53 UTC
this bug is no longer valid
Comment 4 Andrew Korostelev 2006-10-16 09:35:26 UTC
all-nbms-griffin-061015