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 93030 - NPE and CreationFailedException on generating code for enum element with extension link
Summary: NPE and CreationFailedException on generating code for enum element with exte...
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: Craig Conover
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 14:19 UTC by Andrew Korostelev
Modified: 2007-02-09 14:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception 1 - npe (531 bytes, text/plain)
2007-01-23 14:20 UTC, Andrew Korostelev
Details
exception 2 - CreationFailedException (1.77 KB, application/octet-stream)
2007-01-23 14:20 UTC, Andrew Korostelev
Details
exception 2 - CreationFailedException (1.77 KB, text/plain)
2007-01-23 14:20 UTC, Andrew Korostelev
Details
exception 3 - CreationFailedException (1.67 KB, text/plain)
2007-01-23 14:21 UTC, Andrew Korostelev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Korostelev 2007-01-23 14:19:05 UTC
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.
Comment 1 Andrew Korostelev 2007-01-23 14:19:48 UTC
workaround: invoke code generation on the whole project (not on one diagram
element).
Comment 2 Andrew Korostelev 2007-01-23 14:20:25 UTC
Created attachment 37599 [details]
exception 1 - npe
Comment 3 Andrew Korostelev 2007-01-23 14:20:46 UTC
Created attachment 37600 [details]
exception 2 - CreationFailedException
Comment 4 Andrew Korostelev 2007-01-23 14:20:55 UTC
Created attachment 37601 [details]
exception 2 - CreationFailedException
Comment 5 Andrew Korostelev 2007-01-23 14:21:18 UTC
Created attachment 37602 [details]
exception 3 - CreationFailedException
Comment 6 Craig Conover 2007-02-08 05:02:51 UTC
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.
Comment 7 Craig Conover 2007-02-08 05:03:35 UTC
Forgot to mark as fixed.
Comment 8 Craig Conover 2007-02-08 05:05:36 UTC
I updated the wrong issue, so reopening. Ignore comments starting with "Fixed as
follows:"
Comment 9 Craig Conover 2007-02-09 00:27:53 UTC
Turns out that this is indeed fixed.
Comment 10 Andrew Korostelev 2007-02-09 14:16:16 UTC
verified in all-nbms-griffin-070208_1