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 82479 - Necessary Fully Qualified Names are not added in to source code
Summary: Necessary Fully Qualified Names are not added in to source code
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Viktor Lapitski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-11 13:30 UTC by Alexandr Scherbatiy
Modified: 2007-07-19 23:54 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 Alexandr Scherbatiy 2006-08-11 13:30:15 UTC
Steps to reproduce:


                               
- Create a Class diagram
- Put Package element on the diagram and name it 'mypack'
- Put Class element on the 'mypack' package and mame it 'A'
- Put Package element on the 'mypack' package and mame it 'pp'
- Put interface element on the 'pp' package and mame it 'A'
- Draw 'Implementation' link from 'A' Class element to 'A' Interface element

  Here is the code which was generated for 'A'  class
  ------------------------------------------------------------------------
  package mypack;

  import mypack.pp.*;

  public class A implements A {
    public A() {
    }
  }
  ------------------------------------------------------------------------
 
  The code is not compiled:

  JavaApplication1\src\mypack\A.java:5: interface expected here
  public class A implements A {
  1 error
  BUILD FAILED (total time: 1 second)
Comment 1 Craig Conover 2006-08-14 19:18:36 UTC
Review: bug is as stated. 
Also note: the import is a "*" import and not a Class import:
i.e. - "import mypack.pp.*;" should be "import mypack.pp.A";
Comment 2 Alexandr Scherbatiy 2006-10-24 10:07:23 UTC
Reproduced in Griffin:

Steps to reproduce:

- Create a Java-Platform UML project
- Create a Class diagram
- Put Package element on the diagram and name it 'mypack'
- Put Class element on the 'mypack' package and mame it 'A'
- Put Package element on the 'mypack' package and mame it 'pp'
- Put interface element on the 'pp' package and mame it 'A'
- Draw 'Implementation' link from 'A' Class element to 'A' Interface element
- Generate code for the UML project

  Here is the code which was generated for 'A'  class
  ------------------------------------------------------------------------
  package mypack;

  import mypack.pp.*;

  public class A implements A {
    public A() {
    }
  }
  ------------------------------------------------------------------------
  The code is not compiled.




Comment 3 Craig Conover 2006-10-31 02:12:25 UTC
Now, the implements declaration is not generated at all.
Comment 4 Peter Lam 2007-03-20 23:12:32 UTC
low use case not currently impacting our installed user base.
Comment 5 Craig Conover 2007-04-20 02:51:09 UTC
This is working now, but Java doesn't seem to like it when you import a class
from another package that has the same name as the class doing the import so a
choice has to be made. If class A implements interface A from another package,
then the implements declaration must use a fully qualified A interface instead
of an import. All scenarios fixed for this.

Comment 6 Alexandr Scherbatiy 2007-04-27 13:46:47 UTC
The generated code is:
---------------------------------------------------
package mypack;

import mypack.pp.A; 

public class A implements A {

    public A () {
    }

}
---------------------------------------------------
The code is not compiled.  The import line does not help.
The right code should be:
---------------------------------------------------
public class A implements mypack.pp.A {
}
---------------------------------------------------
Comment 7 Craig Conover 2007-07-18 18:35:37 UTC
Viktor, this might be more your territory than mine. Maybe a template issue? If not, just reassign back to me.
Comment 8 Viktor Lapitski 2007-07-19 05:16:55 UTC
fixed.
Comment 9 Sherry Zhou 2007-07-19 23:54:51 UTC
verified at build 070719