Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » problems with undo on setting default value for a paremeter
problems with undo on setting default value for a paremeter [message #628449] Mon, 17 May 2010 11:29 Go to next message
Ioana is currently offline IoanaFriend
Messages: 10
Registered: April 2010
Junior Member
Hi,

I have the following problem: I set the default value to a parameter using the set command:


SetCommand.create(editingDomain, parameter, UMLPackage.eINSTANCE.getParameter_Default(), defaultValue)


and it's working ok, but when I try to undo, I've seen that the unsetDefault (of ParameterOperations) is trying to do this:

parameter.eUnset(UMLPackage.Literals.PROPERTY__DEFAULT_VALUE );


though the PROPERTY__DEFAULT was not set -- I thought maybe I should set this feature also, but it does not work like this.
And my problem is that it searches for this feature - Property__Default for the parameter, and it does not exist, so the "undo" throws an nullpointerexception.
FYI:

at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1208)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1197)
at org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1598)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)
at org.eclipse.uml2.uml.internal.operations.ParameterOperations .unsetDefault(ParameterOperations.java:292)
at org.eclipse.uml2.uml.internal.impl.ParameterImpl.unsetDefaul t(ParameterImpl.java:834)
at org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1583)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)

So is something that I might have missed on doing on setting the parameter default value?

Thanks,
Ioana
Re: problems with undo on setting default value for a paremeter [message #628450 is a reply to message #628449] Mon, 17 May 2010 12:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090807080001030709060908
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Ioana,

That looks wrong to me. I think it should be

public static void unsetDefault(Parameter parameter) {

if (parameter.isSetDefault()) {

parameter.eUnset(UMLPackage.Literals.PARAMETER__DEFAULT_VALU E);
}
}

Try changing it to see if that fixes the problem and then open a bugzilla.


Ioana wrote:
> Hi,
>
> I have the following problem: I set the default value to a parameter
> using the set command:
>
>
> SetCommand.create(editingDomain, parameter,
> UMLPackage.eINSTANCE.getParameter_Default(), defaultValue)
>
>
> and it's working ok, but when I try to undo, I've seen that the
> unsetDefault (of ParameterOperations) is trying to do this:
>
> parameter.eUnset(UMLPackage.Literals.PROPERTY__DEFAULT_VALUE );
>
>
> though the PROPERTY__DEFAULT was not set -- I thought maybe I should
> set this feature also, but it does not work like this.
> And my problem is that it searches for this feature -
> Property__Default for the parameter, and it does not exist, so the
> "undo" throws an nullpointerexception.
> FYI:
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1208)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1197)
>
> at
> org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1598)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)
>
> at
> org.eclipse.uml2.uml.internal.operations.ParameterOperations .unsetDefault(ParameterOperations.java:292)
>
> at
> org.eclipse.uml2.uml.internal.impl.ParameterImpl.unsetDefaul t(ParameterImpl.java:834)
>
> at
> org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1583)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)
>
>
> So is something that I might have missed on doing on setting the
> parameter default value?
>
> Thanks,
> Ioana

--------------090807080001030709060908
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ioana,<br>
<br>
That looks wrong to me.  I think it should be<br>
<blockquote><small>    public static void unsetDefault(Parameter
parameter) {</small><br>
<br>
<small>        if (parameter.isSetDefault()) {</small><br>
<small>           
parameter.eUnset(UMLPackage.Literals.PARAMETER__DEFAULT_VALU E); </small><br>
<small>        }</small><br>
<small>    }</small><br>
</blockquote>
Try changing it to see if that fixes the problem and then open a
bugzilla.<br>
<br>
<br>
Ioana wrote:
<blockquote cite="mid:hsr9au$gjo$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I have the following problem: I set the default value to a parameter
using the set command:
<br>
<br>
<br>
SetCommand.create(editingDomain, parameter,
UMLPackage.eINSTANCE.getParameter_Default(), defaultValue)
<br>
<br>
<br>
and it's working ok, but when I try to undo, I've seen that the
unsetDefault (of ParameterOperations) is trying to do this:
<br>
<br>
parameter.eUnset(UMLPackage.Literals.PROPERTY__DEFAULT_VALUE );
<br>
<br>
<br>
though the PROPERTY__DEFAULT was not set -- I thought maybe I should
set this feature also, but it does not work like this.
<br>
And my problem is that it searches for this feature - Property__Default
for the parameter, and it does not exist, so the "undo" throws an
nullpointerexception.
<br>
FYI:
<br>
<br>
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1208)
<br>
    at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicUnset(Ba sicEObjectImpl.java:1197)
<br>
    at
org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1598)
<br>
    at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)
<br>
    at
org.eclipse.uml2.uml.internal.operations.ParameterOperations .unsetDefault(ParameterOperations.java:292)
<br>
    at
org.eclipse.uml2.uml.internal.impl.ParameterImpl.unsetDefaul t(ParameterImpl.java:834)
<br>
    at
org.eclipse.uml2.uml.internal.impl.ParameterImpl.eUnset(Para meterImpl.java:1583)
<br>
    at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1156)
<br>
<br>
So is something that I might have missed on doing on setting the
parameter default value?
<br>
<br>
Thanks,
<br>
Ioana </blockquote>
</body>
</html>

--------------090807080001030709060908--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:missing MARTE stereotypes with deserialized UML2 models
Next Topic:problems with undo on setting default value for a paremeter
Goto Forum:
  


Current Time: Fri Apr 26 23:11:11 GMT 2024

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

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

Back to the top