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.
The Generate Code doesn't generate the proper import statements and the classes that are used are fully qualified making code hard to read.
I have overhauled all of the import statement code generating logic. I have considered complicated cases such as nested classes from same and different packages, self-referencing classes and more. For QA, I recommend complete rigorous testing of all scenarios related to import code gen. There may be some edge cases that need some fine tuning.
The import statement is not added when add method which has multiplicity parameters. For example: - Put a Class element on a Class diagram - Name the Class element - Insert 'public void op(String str[*])' operation into the Class element - Generate code for the Class element Go to the generated source code The import line is not added for the generated Collection ----------------------------------------------------------- MyClass.java:7: cannot find symbol symbol : class LinkedList location: class pack.MyClass public void op(LinkedList<String> str) { ^ 1 error -----------------------------------------------------------
The Collection specified in the Colllection Override Default preference will now be imported properly. It seems that the method's return type was being referenced for all of the methods parameters when it came time to add imports.
verified. Some specific problems were filed: issue 88499 issue 88588 issue 88794