Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] inconsistency in handling of enums in emfvm
[ATL] inconsistency in handling of enums in emfvm [message #108416] Thu, 16 July 2009 06:52 Go to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi,

in line 598 of org.eclipse.m2m.atl.engine.emfvm.adapter.EMFModelAdapter
(from the Galileo release)I found

EEnumLiteral literal = eenum.getEEnumLiteral(settableValue.toString());

Shouldn't that be replaced for consistency reasons with a call to

getEEnumLiteralByLiteral()

which compares with the literal rather than with the name feature?

Regards,
Henrik

-------------------------------------------------------

EEnum eenum = (EEnum)type;
if (settableValue != null) {
EEnumLiteral literal =
eenum.getEEnumLiteralByLiteral(settableValue.toString());
if (literal != null) {
eo.eSet(feature, literal.getInstance());
} else {
throw new VMException(
frame,
Messages
.getString(
"EMFModelAdapter.LITERALERROR", new Object[] {settableValue,
eenum.getName()})); //$NON-NLS-1$
}
}
Re: [ATL] inconsistency in handling of enums in emfvm [message #484477 is a reply to message #108416] Mon, 07 September 2009 15:58 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

To solve some bugs and prevent compatibility issues, literal handling
has now the same behavior within both VM's:
- first try to retrieve the literal by the literal attribute
(getEEnumLiteralByLiteral)
- if not found, try to resolve by the name attribute (getEEnumLiteral).

Best regards,

William

Henrik Rentz-Reichert a écrit :
> Hi,
>
> in line 598 of org.eclipse.m2m.atl.engine.emfvm.adapter.EMFModelAdapter
> (from the Galileo release)I found
>
> EEnumLiteral literal = eenum.getEEnumLiteral(settableValue.toString());
>
> Shouldn't that be replaced for consistency reasons with a call to
>
> getEEnumLiteralByLiteral()
>
> which compares with the literal rather than with the name feature?
>
> Regards,
> Henrik
>
> -------------------------------------------------------
>
> EEnum eenum = (EEnum)type;
> if (settableValue != null) {
> EEnumLiteral literal =
> eenum.getEEnumLiteralByLiteral(settableValue.toString());
> if (literal != null) {
> eo.eSet(feature, literal.getInstance());
> } else {
> throw new VMException(
> frame,
> Messages
> .getString(
> "EMFModelAdapter.LITERALERROR", new Object[] {settableValue,
> eenum.getName()})); //$NON-NLS-1$
> }
> }
>
Previous Topic:Syntax for Math.pow() funtion in ATL
Next Topic:succesive "collect"
Goto Forum:
  


Current Time: Thu Apr 18 04:10:44 GMT 2024

Powered by FUDForum. Page generated in 0.06332 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top