Author: tfmorris
Date: 2007-10-25 10:47:14-0700
New Revision: 13691
Modified:
trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java
trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java
trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java
trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java
trunk/src_new/org/argouml/uml/StereotypeUtility.java
Log:
Fix another NullPointerException in Notation StringBuilder usage
Modified: trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java?view=diff&rev=13691&p1=trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java&r1=13690&r2=13691
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java (original)
+++ trunk/src_new/org/argouml/notation/providers/uml/AssociationEndNameNotationUml.java 2007-10-25 10:47:14-0700
@@ -167,12 +167,12 @@
Model.getCoreHelper().setName(role, name);
}
- StereotypeUtility.dealWithStereotypes(role,
- stereotype.toString(), true);
+ StereotypeUtility.dealWithStereotypes(role, stereotype, true);
}
/*
- * @see org.argouml.notation.providers.NotationProvider#toString(java.lang.Object, java.util.HashMap)
+ * @see org.argouml.notation.providers.NotationProvider#toString(java.lang.Object,
+ * java.util.HashMap)
*/
@Override
public String toString(Object modelElement, Map args) {
Modified: trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java?view=diff&rev=13691&p1=trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java&r1=13690&r2=13691
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java (original)
+++ trunk/src_new/org/argouml/notation/providers/uml/AttributeNotationUml.java 2007-10-25 10:47:14-0700
@@ -482,9 +482,7 @@
NotationUtilityUml.attributeSpecialStrings);
}
- StereotypeUtility.dealWithStereotypes(attribute,
- stereotype != null ? stereotype.toString() : null,
- true);
+ StereotypeUtility.dealWithStereotypes(attribute, stereotype, true);
}
/*
Modified: trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java?view=diff&rev=13691&p1=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&r1=13690&r2=13691
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java (original)
+++ trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java 2007-10-25 10:47:14-0700
@@ -53,7 +53,7 @@
static PropertySpecialString[] attributeSpecialStrings;
/**
- * The vector of CustomSeparators to use when tokenizing attributes.
+ * The list of CustomSeparators to use when tokenizing attributes.
*/
static List<CustomSeparator> attributeCustomSep;
@@ -68,7 +68,7 @@
static final List<CustomSeparator> operationCustomSep;
/**
- * The vector of CustomSeparators to use when tokenizing parameters.
+ * The list of CustomSeparators to use when tokenizing parameters.
*/
private static final List<CustomSeparator> parameterCustomSep;
@@ -367,7 +367,7 @@
Model.getCoreHelper().setName(me, name);
}
- StereotypeUtility.dealWithStereotypes(me, stereotype.toString(), false);
+ StereotypeUtility.dealWithStereotypes(me, stereotype, false);
if (path != null) {
Object nspe =
Modified: trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java?view=diff&rev=13691&p1=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&r1=13690&r2=13691
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java (original)
+++ trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java 2007-10-25 10:47:14-0700
@@ -351,9 +351,7 @@
// but create any other parsed stereotypes as needed
if (!Model.getFacade().isAReception(op)
|| !RECEPTION_KEYWORD.equals(stereotype.toString())) {
- StereotypeUtility.dealWithStereotypes(op,
- stereotype != null ? stereotype.toString() : null,
- true);
+ StereotypeUtility.dealWithStereotypes(op, stereotype, true);
}
}
Modified: trunk/src_new/org/argouml/uml/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/StereotypeUtility.java?view=diff&rev=13691&p1=trunk/src_new/org/argouml/uml/StereotypeUtility.java&p2=trunk/src_new/org/argouml/uml/StereotypeUtility.java&r1=13690&r2=13691
==============================================================================
--- trunk/src_new/org/argouml/uml/StereotypeUtility.java (original)
+++ trunk/src_new/org/argouml/uml/StereotypeUtility.java 2007-10-25 10:47:14-0700
@@ -233,17 +233,38 @@
}
}
}
-
+
/**
- * This function shall replace the previous set of stereotypes
- * of the given modelelement with a new set,
- * given in the form of a "," separated string of stereotype names.
- *
+ * Replace the previous set of stereotypes applied to the given modelelement
+ * with a new set, given in the form of a "," separated string of stereotype
+ * names.
+ *
+ * @param element the UML element to modify
+ * @param stereotype Comma separated list of stereotype names. Empty string
+ * or <code>null</code> represents no stereotypes.
+ * @param removeCurrent true if all current stereotypes should be removed
+ * before adding the new stereotypes, false if new
+ * stereotypes should be added to existing ones.
+ */
+ public static void dealWithStereotypes(Object element,
+ StringBuilder stereotype, boolean removeCurrent) {
+ if (stereotype == null) {
+ dealWithStereotypes(element, (String) null, removeCurrent);
+ } else {
+ dealWithStereotypes(element, stereotype.toString(), removeCurrent);
+ }
+ }
+
+ /**
+ * This function shall replace the previous set of stereotypes of the given
+ * modelelement with a new set, given in the form of a "," separated string
+ * of stereotype names.
+ *
* @param umlobject the UML element to adapt
- * @param stereotype Comma separated list stereotype names. Empty string
- * or <code>null</code> represents no stereotypes.
- * @param full false if stereotypes are only added,
- * true if removal should be done, too.
+ * @param stereotype Comma separated list stereotype names. Empty string or
+ * <code>null</code> represents no stereotypes.
+ * @param full false if stereotypes are only added, true if removal should
+ * be done, too.
*/
public static void dealWithStereotypes(Object umlobject, String stereotype,
boolean full) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.