Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Illegal Argument setting a stereotype property
Illegal Argument setting a stereotype property [message #477100] Mon, 17 March 2008 20:09 Go to next message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Hi,
it has been a long time since the last time a posted a message here, but
I'm still struggling with profiles and stereotypes.
My newest problem is related to set a value for a stereotype property,
more specificaly, the PAdemand property of the PAstep stereotype
conetained in the UML SPT profile. I used the PAschdPolicy property of
PAhost stereotype without problem, but the PAdemand is triggering an
IllegalArgumentException whenever I try to use setValue method. My code is
basicaly:
// st is PAstep
void setProperties( NamedElement elem, Stereotype st ) {
elem.applyStereotype( st );
String key = "PAdemand";
String value = "('assm','mean',(0.8,'s'))"
elem.setValue( st, key, value );
}
I took a look at the profile.uml file and the PAdemand is defined as a
string, so the contents of the variable value should not matter (I think).

Does anyone have any idea on how to discover what's going on ?

thanks,
Flávio
Re: Illegal Argument setting a stereotype property [message #477103 is a reply to message #477100] Tue, 18 March 2008 14:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Ok,
I managed to "solve" the problem. Basically I had to change the profile.
I would like to have some comments from the experts here in this forum
about my workaround. The relevant lines are:
<eStructuralFeatures xmi:type="ecore:EAttribute"
xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
upperBound="-1">
<eType xmi:type="ecore:EDataType"
href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
...
<ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
name="PAdemand" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
</ownedAttribute>

In the first set I removed the 'upperBound="-1"' and in the second set
I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
upperBound="-1" means.
It's also worth to say that the original profile was designed to UML 2.1
and I converted it to 2.0 following an advice posted in this newsgroup.

thanks,
Flávio
Re: Illegal Argument setting a stereotype property [message #477124 is a reply to message #477103] Tue, 25 March 2008 14:55 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Flavio,

An upper bound of -1 means '*', so you would have a collection of strings.
It could be that you were trying to set a singleton string instead of a list
of strings.

Cheers,
- James.



"Flavio Duarte" <flavio.p.duarte@gmail.com> wrote in message
news:a94ec6dd9ad2c83468f3ecd1235282df$1@www.eclipse.org...
> Ok,
> I managed to "solve" the problem. Basically I had to change the profile.
> I would like to have some comments from the experts here in this forum
> about my workaround. The relevant lines are:
> <eStructuralFeatures xmi:type="ecore:EAttribute"
> xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
> upperBound="-1">
> <eType xmi:type="ecore:EDataType"
> href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eStructuralFeatures>
> ..
> <ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
> name="PAdemand" visibility="private">
> <type xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
> </ownedAttribute>
>
> In the first set I removed the 'upperBound="-1"' and in the second set
> I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
> upperBound="-1" means.
> It's also worth to say that the original profile was designed to UML 2.1
> and I converted it to 2.0 following an advice posted in this newsgroup.
>
> thanks,
> Fl
Re: Illegal Argument setting a stereotype property [message #626232 is a reply to message #477100] Tue, 18 March 2008 14:25 Go to previous message
Eclipse UserFriend
Originally posted by: flavio.p.duarte.gmail.com

Ok,
I managed to "solve" the problem. Basically I had to change the profile.
I would like to have some comments from the experts here in this forum
about my workaround. The relevant lines are:
<eStructuralFeatures xmi:type="ecore:EAttribute"
xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
upperBound="-1">
<eType xmi:type="ecore:EDataType"
href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
...
<ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
name="PAdemand" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
</ownedAttribute>

In the first set I removed the 'upperBound="-1"' and in the second set
I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
upperBound="-1" means.
It's also worth to say that the original profile was designed to UML 2.1
and I converted it to 2.0 following an advice posted in this newsgroup.

thanks,
Flávio
Re: Illegal Argument setting a stereotype property [message #626259 is a reply to message #477103] Tue, 25 March 2008 14:55 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Flavio,

An upper bound of -1 means '*', so you would have a collection of strings.
It could be that you were trying to set a singleton string instead of a list
of strings.

Cheers,
- James.



"Flavio Duarte" <flavio.p.duarte@gmail.com> wrote in message
news:a94ec6dd9ad2c83468f3ecd1235282df$1@www.eclipse.org...
> Ok,
> I managed to "solve" the problem. Basically I had to change the profile.
> I would like to have some comments from the experts here in this forum
> about my workaround. The relevant lines are:
> <eStructuralFeatures xmi:type="ecore:EAttribute"
> xmi:id="_U57BXcXKEdybOP4NOZDt8g" name="PAdemand" ordered="false"
> upperBound="-1">
> <eType xmi:type="ecore:EDataType"
> href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eStructuralFeatures>
> ..
> <ownedAttribute xmi:id="_8f8028c_1072170912682_690982_2939"
> name="PAdemand" visibility="private">
> <type xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_10_0_be00301_1127808747156_845613_154" name="" value="*"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_10_0_be00301_1127808747156_472049_153" name=""/>
> </ownedAttribute>
>
> In the first set I removed the 'upperBound="-1"' and in the second set
> I've changed 'value="*"' to 'value="1"'. I'm not really sure what an
> upperBound="-1" means.
> It's also worth to say that the original profile was designed to UML 2.1
> and I converted it to 2.0 following an advice posted in this newsgroup.
>
> thanks,
> Fl
Previous Topic:extension and visualisation
Next Topic:Private Class from different Namespace as property type
Goto Forum:
  


Current Time: Thu Mar 28 10:54:30 GMT 2024

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

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

Back to the top