svn commit: r13660 - trunk/src_new/org/argouml/notation/providers/uml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-10-10 16:59:22-0700
New Revision: 13660

Modified:
   trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java
   trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java

Log:
Strengthen typing.  Switch to interfaces instead of implementation types.

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=13660&p1=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&r1=13659&r2=13660
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java	(original)
+++ trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java	2007-10-10 16:59:22-0700
@@ -28,9 +28,9 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
@@ -38,6 +38,7 @@
 import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.Model;
 import org.argouml.uml.StereotypeUtility;
+import org.argouml.util.CustomSeparator;
 import org.argouml.util.MyTokenizer;
 
 /**
@@ -54,7 +55,7 @@
     /**
      * The vector of CustomSeparators to use when tokenizing attributes.
      */
-    static Vector attributeCustomSep;
+    static List<CustomSeparator> attributeCustomSep;
 
     /**
      * The array of special properties for operations.
@@ -64,12 +65,12 @@
     /**
      * The vector of CustomSeparators to use when tokenizing attributes.
      */
-    static Vector operationCustomSep;
+    static List<CustomSeparator> operationCustomSep;
 
     /**
      * The vector of CustomSeparators to use when tokenizing parameters.
      */
-    private static Vector parameterCustomSep;
+    private static List<CustomSeparator> parameterCustomSep;
 
     /**
      * The character with a meaning as a visibility at the start
@@ -86,19 +87,19 @@
     static {
         attributeSpecialStrings = new PropertySpecialString[2];
 
-        attributeCustomSep = new Vector();
+        attributeCustomSep = new ArrayList<CustomSeparator>();
         attributeCustomSep.add(MyTokenizer.SINGLE_QUOTED_SEPARATOR);
         attributeCustomSep.add(MyTokenizer.DOUBLE_QUOTED_SEPARATOR);
         attributeCustomSep.add(MyTokenizer.PAREN_EXPR_STRING_SEPARATOR);
 
         operationSpecialStrings = new PropertySpecialString[8];
 
-        operationCustomSep = new Vector();
+        operationCustomSep = new ArrayList<CustomSeparator>();
         operationCustomSep.add(MyTokenizer.SINGLE_QUOTED_SEPARATOR);
         operationCustomSep.add(MyTokenizer.DOUBLE_QUOTED_SEPARATOR);
         operationCustomSep.add(MyTokenizer.PAREN_EXPR_STRING_SEPARATOR);
 
-        parameterCustomSep = new Vector();
+        parameterCustomSep = new ArrayList<CustomSeparator>();
         parameterCustomSep.add(MyTokenizer.SINGLE_QUOTED_SEPARATOR);
         parameterCustomSep.add(MyTokenizer.DOUBLE_QUOTED_SEPARATOR);
         parameterCustomSep.add(MyTokenizer.PAREN_EXPR_STRING_SEPARATOR);
@@ -268,7 +269,7 @@
         throws ParseException {
         MyTokenizer st;
 
-        Vector path = null;
+        List<String> path = null;
         String name = null;
         StringBuilder stereotype = null;
         String token;
@@ -307,7 +308,7 @@
                     }
 
                     if (path == null) {
-                        path = new Vector();
+                        path = new ArrayList<String>();
                     }
                     if (name != null) {
                         path.add(name);
@@ -700,7 +701,7 @@
     }
 
     /**
-     * Applies a Vector of name value pairs of properties to a model element.
+     * Applies a List of name/value pairs of properties to a model element.
      * The name is treated as the tag of a tagged value unless it is one of the
      * PropertySpecialStrings, in which case the action of the
      * PropertySpecialString is invoked.
@@ -708,11 +709,11 @@
      * @param elem
      *            An model element to apply the properties to.
      * @param prop
-     *            A Vector with name, value pairs of properties.
+     *            A List with name, value pairs of properties.
      * @param spec
      *            An array of PropertySpecialStrings to use.
      */
-    static void setProperties(Object elem, Vector prop,
+    static void setProperties(Object elem, List<String> prop,
             PropertySpecialString[] spec) {
         String name;
         String value;
@@ -720,8 +721,8 @@
 
     nextProp:
         for (i = 0; i + 1 < prop.size(); i += 2) {
-            name = (String) prop.get(i);
-            value = (String) prop.get(i + 1);
+            name = prop.get(i);
+            value = prop.get(i + 1);
 
             if (name == null) {
                 continue;
@@ -733,7 +734,7 @@
             }
 
             for (j = i + 2; j < prop.size(); j += 2) {
-                String s = (String) prop.get(j);
+                String s = prop.get(j);
                 if (s != null && name.equalsIgnoreCase(s.trim())) {
                     continue nextProp;
                 }

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=13660&p1=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&p2=trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java&r1=13659&r2=13660
==============================================================================
--- trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java	(original)
+++ trunk/src_new/org/argouml/notation/providers/uml/OperationNotationUml.java	2007-10-10 16:59:22-0700
@@ -25,11 +25,12 @@
 package org.argouml.notation.providers.uml;
 
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.NoSuchElementException;
-import java.util.Vector;
 
 import org.argouml.application.events.ArgoEventPump;
 import org.argouml.application.events.ArgoEventTypes;
@@ -194,7 +195,7 @@
         String token;
         String type = null;
         String visibility = null;
-        Vector<String> properties = null;
+        List<String> properties = null;
         int paramOffset = 0;
 
         s = s.trim();
@@ -382,14 +383,14 @@
      * @return updated vector of properties
      * @throws ParseException
      */
-    private Vector tokenOpenBrace(MyTokenizer st, Vector properties)
+    private List<String> tokenOpenBrace(MyTokenizer st, List<String> properties)
         throws ParseException {
         String token;
         StringBuilder propname = new StringBuilder();
         String propvalue = null;
 
         if (properties == null) {
-            properties = new Vector();
+            properties = new ArrayList<String>();
         }
         while (true) {
             token = st.nextToken();
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.