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 87511 - Code generation doubles constructor for nested classes
Summary: Code generation doubles constructor for nested classes
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-19 13:21 UTC by Alexandr Scherbatiy
Modified: 2007-10-19 21:06 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-19 13:21:03 UTC
Steps to reproduce:

- Reverse Engineer the MyClass java class into UML project:
------------------------------------------------------------------
package pack;

public class MyClass    
    private class Node{
        
        Node next;
        Object element;
        
        Node(Object element, Node next){
            this.element = element;
            this.next = next;
        }
        
        Object getElement(){
            return element;
        }
        
        Node getNext(){
            return next;
        }
    }        
}
------------------------------------------------------------------
- Create a Class diagram from the 'MyClass' element
- Generate code for the 'MyClass' element
 The source code is:
------------------------------------------------------------------
package pack;

public class MyClass {
    private class Node {
        Object element;

        Node(Object element, pack.MyClass$Node next) {
        }

        Node(Object element, pack.MyClass$Node next) {
        }

        Object getElement() {
            return null;
        }

        pack.MyClass$Node getNext() {
            return null;
        }
    }
}
------------------------------------------------------------------

The 'Node' nested class has two identical constructors.
Comment 1 Peter Lam 2006-10-19 18:42:16 UTC
This is the basic of code generation. change to P1.
Comment 2 Craig Conover 2006-10-20 01:21:29 UTC
Observation: If you Gen Code for whole project, the inner class constructor gets
duplicated. But if you Gen Code directly on the element, inner class constructor
only get created once. ???
Comment 3 Trey Spiva 2006-10-21 00:09:25 UTC
We where not resolving types names that where inner classes.
Comment 4 Andrew Korostelev 2006-10-23 11:26:00 UTC
verified in all-nbms-griffin-061023