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 to draw Generalization link to and from Enumeration element on class diagram. Filed issue 78453 was moved to 'diagram class'. But related problem still exists in Code Generation area: If user Invokes 'Generate Code' on diagram element 'enumeration' that extends class, or on class element that extends enumeration, three following exceptions will appear: NullPointerException and two org.netbeans.api.mdr.CreationFailedException. steps to reproduce: - create java-model uml project - create class diagram - put class 'c1' and enumeration 'e1' elements on diagram from palette. - add 'generalization' link from enum to class. - invoke 'generate code' on enumeration element on diagram. three attached exceptions will rise. On the second attempt to invoke code generation exceptions list will be different.
workaround: invoke code generation on the whole project (not on one diagram element).
Created attachment 37599 [details] exception 1 - npe
Created attachment 37600 [details] exception 2 - CreationFailedException
Created attachment 37601 [details] exception 2 - CreationFailedException
Created attachment 37602 [details] exception 3 - CreationFailedException
Fixed as follows: 1) UML allows Enumeration elements to generalize (extend) Class elements, but Java does not, so during Java code gen, ignore those generalizations from Enumerations to Classes. 2) UML allows Class elements to generalize Enumeration elements, but Java does not, so during Java code gen, ignore generalization from Classes to Enumerations. 3) UML *may* allow an Enumeration element to generalize an Interface element and does not allow an Enumeration element to implement an Interface element (strange, but true) but our tool currently isn't allowing it to do either. And Java allows an Enumeration to implement an Interface, so when our tool finally allow Enumeration elements to generalize (not implement) an Interface element, Java code gen will interpret the generalization from the Enumeration element to the Interface element as an *implements* instead of an *extends*. This has been implemented, but not tested since our tool prohibits it.
Forgot to mark as fixed.
I updated the wrong issue, so reopening. Ignore comments starting with "Fixed as follows:"
Turns out that this is indeed fixed.
verified in all-nbms-griffin-070208_1