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 - Generate code action does not propagate template parameters to source
Summary: Generate code action does not propagate template parameters to source
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Craig Conover
URL:
Keywords: REGRESSION
: 82251 (view as bug list)
Depends on:
Blocks: 78562
  Show dependency tree
 
Reported: 2006-06-20 04:59 UTC by bugbridge
Modified: 2006-10-19 11:18 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-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