emf uml2 implementation of EnumerationFacadeLogicImpl modifies the underlying 
meta object in handleGetMemberVariables
---------------------------------------------------------------------------------------------------------------------

         Key: UMLMETA-87
         URL: http://jira.andromda.org/browse/UMLMETA-87
     Project: UML Metafacades
        Type: Bug

 Environment: 3.3-SNAPSHOT
    Reporter: Marcio Silva
 Assigned to: Wouter Zoons 


Using typeSafeEnumerations and UML2 Enumerations in the model results in java 
enum's that don't contain any enumeration literals.

The cause can be traced to a call to retrieve the member variables on line 20 
of TypeSafeEnumeration.vsl

#set ($hasMemberVariables = !(${enumeration.memberVariables.empty()}))

The underlying call to EnumerationFacadeLogic.getMemberVariables() ends up 
emptying the underlying metaObjet's ownedLiterals collection through an 
incorrect application of CollectioUtils.filter()

handleGetMemberVariables() has the following two defects:

1) the call below  should be to getOwnedAttributes instead of getOwnedLiterals

   85         final Collection variables = (this.metaObject instanceof 
Enumeration
   86                 ? ((Enumeration)this.metaObject).getOwnedLiterals()
   87                 : CollectionUtils.collect(this.getAttributes(), 
UmlUtilities.ELEMENT_TRANSFORMER));


2) The call to CollectionUtils.filter ends up filtering the underlying 
metaObject's ownedLiteral collection, removing all reference to the 
Enumeration's owned literals.  If filtering is desired, it's best done on a 
copy of the Collection not the collection retrieved from metaObject.

The same erroneous filtering occurs in handleGetLiterals it just ends up being 
side effect free as the evaluation method always returns true.


-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

Reply via email to