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 85777 - Enumeration Literal is inserted twice into enumeration
Summary: Enumeration Literal is inserted twice into enumeration
Status: VERIFIED INVALID
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@uml
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2006-09-26 13:59 UTC by Alexandr Scherbatiy
Modified: 2006-10-19 08:29 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-09-26 13:59:22 UTC
Steps to reproduce:

- Create an empty Java project
- Create a Java-Platform Model UML project which has 
  a Source-Model Synchronization with the Java project
- Create a Class diagram
- Add a Enumeration element on the diagram and name it 'E'
- Select the Enumeration element and invoke 'Insert Enumeration Literal'
- Type 'Literal1' and press enter
- Go to the source of the enumeration element
  The Enumeration literal was added twice into source code:
  ----------------------------------------------
  public enum E {Literal1, Literal1
  }
  ----------------------------------------------
  
  The java project is not compiled:

  JavaApplication1\src\E.java:2: Literal1 is already defined in E
  public enum E {Literal1, Literal1
  1 error
  BUILD FAILED (total time: 2 seconds)
Comment 1 Peter Lam 2006-10-18 06:10:11 UTC
This bug is now invalid because there's no more live round-trip feature. When I
manually generated code, I got the following which is correct.
public enum E {Literal1
}
Comment 2 Andrew Korostelev 2006-10-18 10:50:30 UTC
issue is reproducible in all-nbms-griffin-061016_9
User will meet problems if generics described in class declaration were used in
operations/attributes.

steps:
1) create the following class in java project:
------------------------------
import java.util.List;

public class NewClass <T extends List> {

    public T get() {
        return null;
    }

    public void set(T op) {
    }
}
----------------------
2) RE java project into java-paltform UML project
3) Generate code.
BUG: generic is lost from class declaration, but is remaining in operations.
That makes class uncompilable.
Comment 3 Andrew Korostelev 2006-10-18 10:52:43 UTC
Sorry for the last comment.
Typed into incorrect issue.
Comment 4 Craig Conover 2006-10-18 17:46:50 UTC
I see that this issue is already closed, but for documentation sake... this
issue was solved by resolution of issue 87029.
Comment 5 Andrew Korostelev 2006-10-19 08:29:37 UTC
verified in all-nbms-griffin-061018_35