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.
it is allowed in Java-Model uml project to add generalization link from class element to it's nested class. The same for implementing nested interface. While we restrict relations, unsupported in java, these should also be prohibited. Code generated for such relation is uncompilable. steps to reproduce: - create Java-Model uml project - create class diagram - put two classes and name them A and B. - add nested link from B to A (B is nested class of A) - add Generalization link from A to B This relation generates the following uncompilable code and should not be allowed: public class A extends A.B { public class B { } }
If UML allows it, we should continue to allow it in the model, and let the modeler decide that it is the right thing to do, but code gen will have to simply ignore these violations for Java and not generation the extends or implements to nested classes. I'll test these implementations to see if this is the right thing to do.
UML also allows an interface to generalize its own inner interface, and Java doesn't support that either. I will fix that as well.
I rephrased the summary and reclassified as Code Generation since the diagram is actually working to UML spec. A fix is ready, but waiting for the go ahead on integration.
Integrated
Verified in build 070216_4. The original bug has been fixed and the generated code is below. public class A { public A() { } public class B { public B() { } } } As for "UML also allows an interface to generalize its own inner interface, and Javadoesn't support that either. I will fix that as well." It's not yet fixed and the following uncompilable code is generated. I'll open a separate issue for this but the original bug here is fixed. public interface I1 extends I1.I2 { public interface I2 { } }
the interface case has been filed in issue 95865.