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 78452

Summary: Generate code action does not propagate template parameters to source
Product: uml Reporter: bugbridge <bugbridge>
Component: Code GenerationAssignee: Craig Conover <conover>
Status: VERIFIED FIXED    
Severity: blocker CC: sunflower
Priority: P1 Keywords: REGRESSION
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 78562    

Description bugbridge 2006-06-20 04:59:34 UTC
Original status: 1-Dispatched; Suggested Status: NEW

Original submitter: sunflower

Description:
Step to reproduce:

- Create a uml project 
- Create a Class diagram
- Put a Template class on the diagram and name it 'Class1'
- Add 'Type1' template parameter to the template class

- Create a java project
- Associate the uml project to the java project
- Select the uml project and invoke 'Generate Code'
- Go to the source of 'Class1' class

  Generic 'Class1<Type1>' is not generated.
Comment 1 Craig Conover 2006-08-09 19:51:29 UTC
This issue is a Code Generation issue, not a synchronization issue - changed
subcomponent.
Comment 2 Craig Conover 2006-08-10 00:50:18 UTC
*** Issue 82251 has been marked as a duplicate of this issue. ***
Comment 3 Peter Lam 2006-10-17 22:41:57 UTC
regression from JSE 8.1 UML tool.
Comment 4 Peter Lam 2006-10-17 22:48:01 UTC
New step to reproduce:

- Create a uml project 
- Create a Class diagram
- Put a Template class on the diagram and name it 'Class1'
- Add 'Type1' template parameter to the template class through Properties
Result: "Type1" is displayed as template parameter on "Class1"
- Right-click on "Class1" and select "Generate Code..."
- Open and view the source file for "Class1" which is the following without
"Type1" template parameter:

public class Class1 {
    public Class1() {
    }
}

The generate code should be 
public class Class1<Type1> {
    public Class1() {
    }
}
Comment 5 Peter Lam 2006-10-18 00:24:15 UTC
Agreed by Trey to raise to P1. This issue blocks the following issues:
78562 P2 Renaming generic through template parameters adds superfluous generic
86840 P2 Initial value is not properly generated for Generic attributes
Comment 6 Craig Conover 2006-10-19 02:12:53 UTC
The createJavaClass method of the JavaClassClass class (oh boy) in the JMI API
has a parameter for template parameters, but it causes and exception to be
thrown. Perhaps I am feeding it an inappropriate format, but it is a List type
as needed.

For quick fix, just going to attempt to generate the template params as a string
and append it to the class name.
Comment 7 Craig Conover 2006-10-19 02:20:26 UTC
Appending list of template params on the end of the class name worked just fine.
Comment 8 Andrew Korostelev 2006-10-19 11:18:36 UTC
verified in all-nbms-griffin-061018_35