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 88124 - No imports are generated and fully qualified class names
Summary: No imports are generated and fully qualified class names
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
Depends on:
Blocks: 78539
  Show dependency tree
 
Reported: 2006-10-27 04:29 UTC by Craig Conover
Modified: 2006-11-29 14:18 UTC (History)
0 users

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 Craig Conover 2006-10-27 04:29:17 UTC
The Generate Code doesn't generate the proper import statements and the classes
that are used are fully qualified making code hard to read.
Comment 1 Craig Conover 2006-10-30 05:04:30 UTC
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.
Comment 2 Alexandr Scherbatiy 2006-11-03 14:05:53 UTC
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
  -----------------------------------------------------------

  
  
Comment 3 Craig Conover 2006-11-28 21:24:18 UTC
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.
Comment 4 Alexandr Scherbatiy 2006-11-29 14:18:50 UTC
verified. 

Some specific problems were filed: 
issue 88499
issue 88588
issue 88794