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.
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)
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";
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.
Now, the implements declaration is not generated at all.
low use case not currently impacting our installed user base.
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.
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 { } ---------------------------------------------------
Viktor, this might be more your territory than mine. Maybe a template issue? If not, just reassign back to me.
fixed.
verified at build 070719