Author: mvw
Date: 2012-06-30 12:37:55-0700
New Revision: 19892
Modified:
trunk/src/argouml-app/src/org/argouml/i18n/label.properties
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Log:
Fix for issue 6436: Unwanted {sequential} concurrency shown for operation.
Modified: trunk/src/argouml-app/src/org/argouml/i18n/label.properties
Url:
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/label.properties?view=diff&pathrev=19892&r1=19891&r2=19892
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/label.properties (original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/label.properties 2012-06-30
12:37:55-0700
@@ -129,6 +129,7 @@
label.concurrency-concurrent = concurrent
label.concurrency-guarded = guarded
label.concurrency-sequential = sequential
+label.concurrency-undefined = undefined
label.concurrent = Concurrent
label.concurrent.region=Concurrent Region
label.concurrent.composite.state=Concurrent Composite State
Modified:
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Url:
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java?view=diff&pathrev=19892&r1=19891&r2=19892
==============================================================================
---
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
(original)
+++
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
2012-06-30 12:37:55-0700
@@ -1,6 +1,6 @@
/* $Id$
*****************************************************************************
- * Copyright (c) 2009-2011 Contributors - see below
+ * Copyright (c) 2009-2012 Contributors - see below
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2780,7 +2780,8 @@
public void setConcurrency(Object handle, Object concurrencyKind) {
if (handle instanceof Operation
- && concurrencyKind instanceof CallConcurrencyKind) {
+ && (concurrencyKind == null
+ || concurrencyKind instanceof CallConcurrencyKind)) {
((Operation) handle).
setConcurrency((CallConcurrencyKind) concurrencyKind);
return;
Modified: trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java
Url:
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java?view=diff&pathrev=19892&r1=19891&r2=19892
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java
(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/CoreHelper.java
2012-06-30 12:37:55-0700
@@ -1,6 +1,6 @@
/* $Id$
*******************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2009-2012 Contributors - see below
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -999,6 +999,7 @@
* @param concurrencyKind
* a {@link ConcurrencyKind} of Concurrent, Guarded, or
* Sequential returned from {@link Model#getConcurrencyKind()}.
+ * null is allowed
*/
void setConcurrency(Object handle, Object concurrencyKind);
Modified:
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Url:
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java?view=diff&pathrev=19892&r1=19891&r2=19892
==============================================================================
---
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
(original)
+++
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
2012-06-30 12:37:55-0700
@@ -1,6 +1,6 @@
/* $Id$
*******************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2012 Contributors - see below
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* Contributors:
* Bob Tarling - Original implementation
* Thomas Neustupny
+ * Michiel van der Wulp
*******************************************************************************
*/
@@ -623,17 +624,23 @@
*/
public static final String CONCURRENT = "concurrent";
+ /**
+ * Identifier for no defined concurrency.
+ */
+ public static final String UNDEFINED = "undefined";
+
public ConcurrencyGetterSetter() {
setOptions(Arrays.asList(new String[] {
SEQUENTIAL,
GUARDED,
- CONCURRENT}));
+ CONCURRENT,
+ UNDEFINED}));
}
public Object get(Object modelElement, Class<?> type) {
Object kind = Model.getFacade().getConcurrency(modelElement);
if (kind == null) {
- return null;
+ return UNDEFINED;
} else if
(kind.equals(Model.getConcurrencyKind().getSequential())) {
return SEQUENTIAL;
} else if (kind.equals(Model.getConcurrencyKind().getGuarded())) {
@@ -641,7 +648,7 @@
} else if
(kind.equals(Model.getConcurrencyKind().getConcurrent())) {
return CONCURRENT;
} else {
- return SEQUENTIAL;
+ return UNDEFINED;
}
}
@@ -651,7 +658,7 @@
kind = Model.getConcurrencyKind().getSequential();
} else if (value.equals(GUARDED)) {
kind = Model.getConcurrencyKind().getGuarded();
- } else {
+ } else if (value.equals(CONCURRENT)) {
kind = Model.getConcurrencyKind().getConcurrent();
}
Model.getCoreHelper().setConcurrency(modelElement, kind);
@@ -663,7 +670,7 @@
/**
* Identifier for addonly changeability.
- * TODO: Note this should not be ni UML2 version
+ * TODO: Note this should not be in UML2 version
*/
public static final String ADDONLY = "addonly";
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2974144
To unsubscribe from this discussion, e-mail:
[[email protected]].