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 87140 - Unnamed elements have code generated for them.
Summary: Unnamed elements have code generated for them.
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-13 18:28 UTC by Craig Conover
Modified: 2006-10-17 11:48 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 Craig Conover 2006-10-13 18:28:26 UTC
Unnamed elements should be skipped over in the code generation process.
Comment 1 Craig Conover 2006-10-13 18:29:55 UTC
Added a condition to skip "Unnamed" elements.
Also localized all of Generate Code process.
Comment 2 Alexandr Scherbatiy 2006-10-16 11:28:23 UTC
The issue is still reproduced.
This is a Generate Code log:
------------------------------------------------------------
Begin processing Generate Code: 2 items

MSG_CodeGenSelectedOptions
  UMLProject1Sources\src

Processing element 1 of 2: Skipping "Unnamed" element
Processing element 2 of 2: Class MyClass

================================
Task Successful (total time: 0 seconds)
------------------------------------------------------------

But the source code is generated for 'Unnamed' element:
------------------------------------------------------------
MyClass.java
Unnamed.java
Unnamed.java1
------------------------------------------------------------

I think that 'Generate Code' menu is not necessary for 'Unnamed' elements.
Should I file a separate issue on it?

Comment 3 Sergey Petrov 2006-10-16 15:01:19 UTC
I saw in attempt to fix "Unnamed" was hardcoded in message and second part was
from bundle file most likely not affected by UML Options.
In fact the issue isn't fully valid and should be rephrased as "Not yet named
object shouldn't have generated code" because user can change default element
name to any value with UML|New Project|Default Element Name option.
unfortunatly in previous release it worked as "Object with name equal to default
have no source code", I don't know if issue was filed (but it's better than
hardcoded 'Unnamed')
Comment 4 Craig Conover 2006-10-16 23:37:46 UTC
Yes, I understand and agree. I will reword the message in the output window.
Comment 5 Craig Conover 2006-10-17 02:55:15 UTC
Change message to say "Skipping element with default element name: Unnamed"
where Unnamed is whatever the global option preference is set to.

I also removed the Generate Code action for elements with the default element name.
Comment 6 Alexandr Scherbatiy 2006-10-17 11:48:51 UTC
The 'Code Generation' menu item is removed for unnamed elements.

Source code is not generated for unnamed elements if preferences were 
changed only once before code generation. See issue 87275 .