Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ClassCastException when assigning enum literal to attribute
ClassCastException when assigning enum literal to attribute [message #574046] Thu, 13 August 2009 17:28
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
This is a multi-part message in MIME format.
--------------040603060700070605090205
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello everyone,

This EOL script produces an ClassCastException in its very last line,
saying it can't convert an EEnumLiteralImpl into a LabelAccessMethod:

var lm := new GmfMap!FeatureLabelMapping;
var y := GmfMap!LabelTextAccessMethod#PRINTF;
y.println();
lm.viewMethod := y; -- ** here **

I've looked around and it seems to be as simple as applying the attached
patch, so we use the enumeration instance itself instead of the wrapper,
but I'm not sure if that's the right way to do it. I've sent a bug
report with more information and a test project over here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=286549

Cheers,
Antonio

--------------040603060700070605090205
Content-Type: text/x-patch;
name="fix-enum-classcastexception.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="fix-enum-classcastexception.patch"

SW5kZXg6IHNyYy9vcmcvZWNsaXBzZS9lcHNpbG9uL2VtYy9lbWYvQWJzdHJh Y3RFbWZNb2Rl
bC5qYXZhCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT0KLS0tIHNyYy9vcmcvZWNsaXBzZS9lcHNp bG9uL2VtYy9l
bWYvQWJzdHJhY3RFbWZNb2RlbC5qYXZhCShyZXZpc2lvbiA1MjIpCisrKyBz cmMvb3JnL2Vj
bGlwc2UvZXBzaWxvbi9lbWMvZW1mL0Fic3RyYWN0RW1mTW9kZWwuamF2YQko d29ya2luZyBj
b3B5KQpAQCAtMTIxLDcgKzEyMSw3IEBACiAJCQkJCQlFRW51bSBlRW51bSA9 IChFRW51bSkg
Y2xhc3NpZmllcjsNCiAJCQkJCQlFRW51bUxpdGVyYWwgbGl0ZXJhbCA9IGVF bnVtLmdldEVF
bnVtTGl0ZXJhbChsYWJlbCk7DQogCQkJCQkJDQotCQkJCQkJaWYgKGxpdGVy YWwgIT0gbnVs
bCkgcmV0dXJuIGxpdGVyYWw7DQorCQkJCQkJaWYgKGxpdGVyYWwgIT0gbnVs bCkgcmV0dXJu
IGxpdGVyYWwuZ2V0SW5zdGFuY2UoKTsNCiAJCQkJCX0NCiAJCQkJfQ0KIAkJ CX0NCg==
--------------040603060700070605090205--
Previous Topic:Enumeration arguments in operations
Next Topic:ClassCastException when assigning enum literal to attribute
Goto Forum:
  


Current Time: Fri Dec 19 00:49:55 GMT 2014

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

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