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.
Reproduction steps: - Create two template files to be used for code generation. For a really simple example, create a file called foo.txt with the contents "foo". Another file named bar.txt with the contents "bar". - Goto Tools->Templates: navigate to UML/Code Generation - Add the two files: foo.txt and bar.txt - Goto Tools->Options, UML, Templates tab - Add a new domain (select Java node and click Add button) - Set properties for the domain: Element type = Class Stereotype = foobar Output Parameters: Click Add Template: Filename Format = {name}Foo Template File = foo.txt - Add another new domain (select Java node and click Add button) - Set properties for the domain: Element type = Class Stereotype = foobar Output Parameters: Click Add Template: Filename Format = {name}Bar Template File = bar.txt - Create a UML project with a Class Diagram - In project customizer, enable the two new Domain Templates - Add one Class element, name it TestClass - Add a Stereotype to the class element called twofiles - Create a Java project - Generate code for the class element The result should be two files: TestClassFoo.txt and TestClassBar.txt. Only the TestClassBar.txt file is created. Cause: the hashmap of domain templates is keyed, but elementType:stereotype pairs and each duplicate pairing overwrites the previous one so only the final one is used for code generation.
Solution was to check if a particular elementType:stereotype key already existed in the domain template hashmap. If so, get the value (list of templates) and add the new templates to the end of that list and add back to the hashmap.
fix checked in to trunk and unstable_uml_visualcomponent branch
The bug wasn't verified before cut-off date for 6.0.1patch1 and will be included in 6.0.1patch2.
verified in NB 6.1 build 200802191203. Also verified in latest Meteora build (unstable_uml_visualcomponent branch).
http://hg.netbeans.org/main/rev/a1a217c9c090
The fix has been ported into the release601_fixes branch Checking in DomainTemplatesManagerPanel.form; /cvs/uml/codegen/src/org/netbeans/modules/uml/codegen/ui/Attic/DomainTemplatesManagerPanel.form,v <-- DomainTemplatesManagerPanel.form new revision: 1.13.6.1; previous revision: 1.13 done Checking in DomainTemplatesManagerPanel.java; /cvs/uml/codegen/src/org/netbeans/modules/uml/codegen/ui/Attic/DomainTemplatesManagerPanel.java,v <-- DomainTemplatesManagerPanel.java new revision: 1.27.6.1; previous revision: 1.27 done Checking in DomainTemplatesRetriever.java; /cvs/uml/codegen/src/org/netbeans/modules/uml/codegen/dataaccess/Attic/DomainTemplatesRetriever.java,v <-- DomainTemplatesRetriever.java new revision: 1.7.6.1; previous revision: 1.7 done