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.
My Java class has 'void test(Class<Integer> cls)' method. I reverse engineer the class and generate code for them. The result method is 'void test(pack.Class<Integer> cls)'. But 'Class' should be from 'java.lang' package or should have default package, not 'pack' package. Steps to reproduce: - Create an empty Java project - Add 'pack' package into the Java project - Add 'MyClass' class under the package -------------------------------------------------------------------------------------------------- public class MyClass { void test(Class<Integer> cls) throws InstantiationException, IllegalAccessException { Integer i = cls.newInstance(); } } -------------------------------------------------------------------------------------------------- - Reverse Engineer the Java project into UML project - Generate code for the UML project The generated source for 'MyClass' class is -------------------------------------------------------------------------------------------------- package pack; public class MyClass { void test(pack.Class<Integer> cls) throws InstantiationException, IllegalAccessException { } } -------------------------------------------------------------------------------------------------- Note that 'test' method has 'pack.Class<Integer>' argument type instead of 'Class<Integer>' - Build the generated code: The code is not compiled: -------------------------------------------------------------------------------------------------- JavaApplication1-ModelSources\src\pack\MyClass.java:4: cannot find symbol symbol : class Class location: package pack void test(pack.Class<Integer> cls) throws InstantiationException, IllegalAccessException { 1 error BUILD FAILED (total time: 0 seconds) --------------------------------------------------------------------------------------------------
Fixed with the collection override code gen overhaul mods.
The import lines are generated instead of Fully qualified names.