[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL] inconsistency in handling of enums in emfvm

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$
	}
}