Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » The feature is not a valid feature. (java.lang.IllegalArgumentException)
The feature is not a valid feature. (java.lang.IllegalArgumentException) [message #1692003] Sat, 11 April 2015 19:05 Go to next message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 91
Registered: March 2015
Member
Hi folks,

a common Exception is arguing with me.
It is thrown through thoses lignes (which don't need any context, I'd say) :
EStructuralFeature [b]esfInstance [/b]= instance.eClass().getEStructuralFeature(esfRefName);
EcoreEList<DynamicEObjectImpl> listSonsInst = (EcoreEList<DynamicEObjectImpl>)instance.eClass().eGet([b]esfInstance[/b]);


Well, I just take the EReference out and, to add some stuff into it, I do the eGet on the meta from the ref I got from it.... Nothing fancy.
And this is the rising exception :
Exception in thread "main" java.lang.IllegalArgumentException: The feature 'subsubtopics' is not a valid feature
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1062)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1015)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998)
	at tcore.messages.Match.connectElement(Match.java:286)
	...
	at Main.main(Main.java:135)


I found on this forum a few clues about "containement" but I don't understand how I could play with that here...

Any body knows the definition of a "valid" feature ?

Thanks for your attention,
Edouard
Re: The feature is not a valid feature. (java.lang.IllegalArgumentException) [message #1692005 is a reply to message #1692003] Sat, 11 April 2015 19:11 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 108
Registered: April 2014
Location: USA
Senior Member
Try doing the eGet on instance rather than on instance.eClass().
Re: The feature is not a valid feature. (java.lang.IllegalArgumentException) [message #1692006 is a reply to message #1692005] Sat, 11 April 2015 21:15 Go to previous message
Edoaurd Batot is currently offline Edoaurd BatotFriend
Messages: 91
Registered: March 2015
Member
Hey, Erick, Thanks...
I'm playing so much with those eGet/eClass/getESF... I'm getting lost !

Thanks Erick, your promptness is astonishing !
Good day.
Previous Topic:Ecore model generator - use tab or white spaces for indentation
Next Topic:Dynamic EMF
Goto Forum:
  


Current Time: Sat Aug 24 03:24:43 GMT 2019

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

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

Back to the top