svn commit: r18091 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
Bob Tarling <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bobtarling
Date: 2010-03-12 18:21:13-0800
New Revision: 18091
Modified:
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
Log:
The UML2 launcher now uses the property panels module which now has the panels xml duplicated and modifications started for UML2
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java?view=diff&pathrev=18091&r1=18090&r2=18091
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java 2010-03-12 18:21:13-0800
@@ -7,7 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * mvw
+ * Michiel van der Wulp
+ * Bob Tarling
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -52,6 +53,10 @@
public UMLInitialValueExpressionModel(Object target) {
super(target, "initialValue");
+ if (!Model.getFacade().isAAttribute(target)) {
+ throw new IllegalArgumentException(
+ "The target must be an attribute we got a " + target.getClass().getName());
+ }
}
/**
@@ -60,12 +65,7 @@
*/
@Override
public Object getExpression() {
- Object target = getTarget();
- if (target == null) {
- return null;
- }
- assert Model.getFacade().isAAttribute(target);
- return Model.getFacade().getInitialValue(target);
+ return Model.getFacade().getInitialValue(getTarget());
}
@Override
@@ -80,7 +80,6 @@
@Override
public void setExpression(Object expression) {
Object target = getTarget();
- assert Model.getFacade().isAAttribute(target);
assert (expression == null) || Model.getFacade().isAExpression(expression);
/* If we do not set it to null first, then we get a MDR DebugException: */
Model.getCoreHelper().setInitialValue(target, null);
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2458946
To unsubscribe from this discussion, e-mail: [[email protected]].