[ http://jira.andromda.org/browse/JAVA-17?page=comments#action_11782 ]
     
Chad Brandon commented on JAVA-17:
----------------------------------

What's wrong with throwing the IllegalArgumentException like we already do?

> Enumeration method from* should return static final object instance
> -------------------------------------------------------------------
>
>          Key: JAVA-17
>          URL: http://jira.andromda.org/browse/JAVA-17
>      Project: Java Cartridge
>         Type: Bug
>     Reporter: Jens Vagts
>     Assignee: Chad Brandon

>
> The Enumeration method from* returns a new object instance which is not 
> compareable against the static final instances via "==" operator. The 
> following code replaces the current (cvs) code and returns a already created 
> instance:
>     public static $enumeration.name $enumeration.fromOperationSignature
>     {
> #set ($value = "value")
> #if($enumeration.literalType.primitive)
> #set ($value = "new ${enumeration.literalType.wrapperName}(value)")
> #end
>         ${enumeration.name} typeValue = (${enumeration.name}) 
> values.get($value);
>         if (typeValue == null)
>         {
>             throw new IllegalArgumentException(
>                 "invalid value '" + value + "', possible values are: " + 
> literals);
>         }
>         
>         return typeValue;
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to