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 80599 - add "java platform" config item for and support for other than 1.5 platforms in code generation
Summary: add "java platform" config item for and support for other than 1.5 platforms ...
Status: NEW
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-19 13:39 UTC by bugbridge
Modified: 2007-07-06 01:18 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-07-19 13:39:33 UTC
Description:

when the UML project has "enumeration" element, and when the java 
project's source level is 1.4, the generated code should not have the
keyword "enum". The codegen should generate java1.4 specific enumeration
(without the keyword enum).  Actually, the codegen generates with "enum" keyword.
Comment 1 Craig Conover 2006-08-10 21:38:24 UTC
Review: This happens when the UML project is standalone, some enums are created,
and then is associated to a Java 1.4 project, and Generate Code is invoked. If
the UML project is assoc to the Java 1.4 project prior to having any enums, then
enum creation is blocked.
Comment 2 Peter Lam 2007-03-20 20:11:12 UTC
low use case not currently impacting our installed user base.
Comment 3 Viktor Lapitski 2007-07-06 01:18:07 UTC
Starting UML NB5.5 there isn't notion of associated Java Project.
The codegen implemented in UML NB6.0 generates code according 
to Java 1.5 language spec.

It'd look like a natural enhancement to :
- add support for more Java-s than 1.5
- and in particular add "java platform" config item 
  (which would be explicitly configured by user or 
   implicitly figured out base on Java project, if any, 
   owning the target generation directory) 
    

For this specific case - enums in pre1.5 java - current 
template-based codegen allows user to 
easily modify existing or add new template for an enumeration 
that would generate something like this: 

public class AnEnumClass {
  ...
  public static AnEnumClass AN_NTH_LITERAL 
      = new AnEnumClass(<set of specific parameters, if any, for the literal>);
  ...

}

An automated implementation only for this specific case would 
have too much guessing: 
- (without generic implementation of config mentioned above) when to 
   switch to 1.4 
- what constructor, if any, with what specific parameters to use 
  for a literal; thus anyway requiring in any non-trivial case 
  the user's manual intervention that doesn't fall far from the 
  manual template modification mentioned above.