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
 Assigned to: Matthias Bohlen 


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



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to