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 = twofiles Output Parameters: Click Add Template: Filename Format = {name}Foo Template File = foo.txt Click Add Template: Filename Format = {name}Bar Template File = bar.txt - Create a UML project with a Class Diagram - 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. The first file should contain the text "foo" and the second should contain "bar". But they both contain the text "foo". Obviously, only the first template file is being used. I debugged this and all the code in the UML module appears to be correct. I suspect the embedded Freemarker template engine is at fault, but not 100% sure.
Forgot one thing... Don't forget to enable the Domain Template for the UML Project before generating code.
fixed in trunk and unstable_uml_visualcomponent branch
As the result after generate code, TestClassBar now contains bar, and TestClassFoo contains foo. Fix verified in 6.1 build 200802191203
Please also see a related issue 123186
The fix has been ported into the release601_fixes branch Checking in JavaCodegen.java; /cvs/uml/codegen/src/org/netbeans/modules/uml/codegen/java/Attic/JavaCodegen.java,v <-- JavaCodegen.java new revision: 1.39.6.2; previous revision: 1.39.6.1 done