svn commit: r12950 - trunk/src_new/org/argouml: cognitive cognitive/checklist cognitive/checklist/ui cognitive/critics cognitive/critics/ui cognitive/ui persistence uml/cognitive uml/cognitive/checklist uml/cognitive/critics

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-07-01 01:10:04-0700
New Revision: 12950

Added:
   trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedNameJava.java   (contents, props changed)
Modified:
   trunk/src_new/org/argouml/cognitive/Agency.java
   trunk/src_new/org/argouml/cognitive/CompoundCritic.java
   trunk/src_new/org/argouml/cognitive/ControlMech.java
   trunk/src_new/org/argouml/cognitive/Critic.java
   trunk/src_new/org/argouml/cognitive/Decision.java
   trunk/src_new/org/argouml/cognitive/DecisionModel.java
   trunk/src_new/org/argouml/cognitive/Designer.java
   trunk/src_new/org/argouml/cognitive/GoalModel.java
   trunk/src_new/org/argouml/cognitive/ItemUID.java
   trunk/src_new/org/argouml/cognitive/Poster.java
   trunk/src_new/org/argouml/cognitive/ResolvedCritic.java
   trunk/src_new/org/argouml/cognitive/StandardCM.java
   trunk/src_new/org/argouml/cognitive/ToDoItem.java
   trunk/src_new/org/argouml/cognitive/ToDoList.java
   trunk/src_new/org/argouml/cognitive/ToDoListEvent.java
   trunk/src_new/org/argouml/cognitive/ToDoListListener.java
   trunk/src_new/org/argouml/cognitive/checklist/Checklist.java
   trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java
   trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java
   trunk/src_new/org/argouml/cognitive/critics/Wizard.java
   trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java
   trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java
   trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java
   trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java
   trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java
   trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java
   trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java
   trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java
   trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java
   trunk/src_new/org/argouml/persistence/TodoParser.java
   trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java
   trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java
   trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java
   trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java
   trunk/src_new/org/argouml/uml/cognitive/critics/Init.java
   trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java
   trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java
   trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java
   trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java
   trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java
   trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java

Log:
Modernize Critics API.  Lists instead of Vectors.  Generics where appropriate.

Modified: trunk/src_new/org/argouml/cognitive/Agency.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Agency.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/Agency.java&p2=trunk/src_new/org/argouml/cognitive/Agency.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Agency.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Agency.java	2007-07-01 01:10:04-0700
@@ -27,9 +27,8 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Observable;
 import java.util.Observer;
 import java.util.Vector;
@@ -52,8 +51,14 @@
  * TODO: I am moving toward a more reactionary scheme in
  * which specific design manipulations in the editor cause critics
  * relevant to those manipulations to be applied.  This transition is
- * still half done.  Trigger's are the critiquing requests.  The code
- * for triggers is currently dormant (latent?).
+ * still half done.  Triggers are the critiquing requests.  The code
+ * for triggers is currently dormant (latent?).<p>
+ * 
+ * TODO: There is a strong dependency cycle between Agency and Designer.  They
+ * either need to be merged into a single class or partitioned differently, 
+ * perhaps using an interface to break the cycle.  The Designer singleton gets
+ * passed to almost every single part of the Critic subsystem, creating strong
+ * coupling throughout. - tfm 20070620
  *
  * @author Jason Robbins
  */
@@ -67,19 +72,22 @@
     // instance variables
 
     /**
-     * A registery of all critics that are currently loaded into the
+     * A registry of all critics that are currently loaded into the
      * design environment.
      */
-    private static Hashtable criticRegistry = new Hashtable(100);
-    private static Vector critics = new Vector();
+    private static Hashtable<Class, List<Critic>> criticRegistry = 
+        new Hashtable<Class, List<Critic>>(100);
+    
+    private static List<Critic> critics = new ArrayList<Critic>();
 
-    //   private static boolean _hot = false;
     /**
      * The main control mechanism for determining which critics should
      * be active.
      */
     private ControlMech controlMech;
-    private static Hashtable singletonCritics = new Hashtable(40);
+    
+    private static Hashtable<String, Critic> singletonCritics = 
+        new Hashtable<String, Critic>(40);
 
     ////////////////////////////////////////////////////////////////
     // constructor and singleton methdos
@@ -122,23 +130,33 @@
 	}
         return dsgr.getAgency();
     }
+    
     ////////////////////////////////////////////////////////////////
     // accessors
 
     /**
      * @return the registery.
      */
-    private static Hashtable getCriticRegistry() {
+    private static Hashtable<Class, List<Critic>> getCriticRegistry() {
         return criticRegistry;
     }
 
     /**
      * @return the critics
+     * @deprecated for 0.25.4 by tfmorris - use {@link #getCriticList()}.
      */
-    public static Vector getCritics() {
-        return critics;
+    @Deprecated
+    public static Vector<Critic> getCritics() {
+        return new Vector<Critic>(critics);
     }
 
+    /**
+     * @return the critics
+     */
+    public static List<Critic> getCriticList() {
+        return critics;
+    }
+    
     ////////////////////////////////////////////////////////////////
     // critic registration
     /**
@@ -149,13 +167,11 @@
             return;
 	}
         if (!(cr instanceof CompoundCritic)) {
-            critics.addElement(cr);
+            critics.add(cr);
 	} else {
-            Vector subs = ((CompoundCritic) cr).getCritics();
-            Enumeration subCritics = subs.elements();
-            while (subCritics.hasMoreElements()) {
-                addCritic((Critic) subCritics.nextElement());
-	    }
+            for (Critic c : ((CompoundCritic) cr).getCriticList()) {
+                addCritic(c);
+            }
             return;
         }
     }
@@ -172,7 +188,7 @@
             LOG.error("Error loading dm " + dmClassName, e);
             return;
         }
-        Critic cr = (Critic) singletonCritics.get(crClassName);
+        Critic cr = singletonCritics.get(crClassName);
         if (cr == null) {
             Class crClass;
             try {
@@ -206,20 +222,30 @@
      * @param cr the critic to register
      * @param clazz the design material class that is to be criticized
      */
-    public static void register(Critic cr, Object clazz) {
-        Vector theCritics = (Vector) getCriticRegistry().get(clazz);
+    public static void register(Critic cr, Class clazz) {
+        List<Critic> theCritics = getCriticRegistry().get(clazz);
         if (theCritics == null) {
-            theCritics = new Vector();
+            theCritics = new ArrayList<Critic>();
             criticRegistry.put(clazz, theCritics);
         }
-        theCritics.addElement(cr);
+        theCritics.add(cr);
         notifyStaticObservers(cr);
         LOG.debug("Registered: " + theCritics.toString());
         cachedCritics.remove(clazz);
         addCritic(cr);
     }
 
-    private static Hashtable cachedCritics = new Hashtable();
+    /**
+     * Transitional method for migration purposes.  Don't use!
+     * @param cr the critic to register
+     * @param clazz the UML class to be criticized
+     */
+    public static void register(Critic cr, Object clazz) {
+        register(cr, (Class) clazz);
+    }
+    
+    private static Hashtable<Class, Collection<Critic>> cachedCritics = 
+        new Hashtable<Class, Collection<Critic>>();
 
     /**
      * Return a collection of all critics that can be applied to the
@@ -228,21 +254,20 @@
      * @param clazz the design material to criticize
      * @return the collection of critics
      */
-    public static Collection criticsForClass(Class clazz) {
-        Collection col = (Collection) cachedCritics.get(clazz);
+    public static Collection<Critic> criticsForClass(Class clazz) {
+        Collection<Critic> col = cachedCritics.get(clazz);
         if (col == null) {
-            col = new ArrayList();
-	    col.addAll(criticsForSpecificClass(clazz));
-	    Collection classes = new ArrayList();
+            col = new ArrayList<Critic>();
+	    col.addAll(criticListForSpecificClass(clazz));
+	    Collection<Class> classes = new ArrayList<Class>();
 	    if (clazz.getSuperclass() != null) {
 		classes.add(clazz.getSuperclass());
 	    }
 	    if (clazz.getInterfaces() != null) {
 		classes.addAll(Arrays.asList(clazz.getInterfaces()));
 	    }
-	    Iterator it = classes.iterator();
-	    while (it.hasNext()) {
-		col.addAll(criticsForClass((Class) it.next()));
+            for (Class c : classes) {
+		col.addAll(criticsForClass(c));
 	    }
 	    cachedCritics.put(clazz, col);
         }
@@ -258,16 +283,31 @@
      *
      * @param clazz the design material
      * @return the critics
+     * @deprecated for 0.25.4 by tfmorris - use 
+     * {@link #criticListForSpecificClass(Class)}.
+     */
+    @Deprecated
+    protected static Vector<Critic> criticsForSpecificClass(Class clazz) {
+        return new Vector<Critic>(criticListForSpecificClass(clazz));
+    }
+
+    /**
+     * Return the List of all critics that are directly
+     * associated with the given design material subclass.<p>
+     *
+     * If there aren't any an empty List is returned.
+     *
+     * @param clazz the design material
+     * @return the critics
      */
-    protected static Vector criticsForSpecificClass(Class clazz) {
-        Vector theCritics = (Vector) getCriticRegistry().get(clazz);
+    protected static List<Critic> criticListForSpecificClass(Class clazz) {
+        List<Critic> theCritics = getCriticRegistry().get(clazz);
         if (theCritics == null) {
-            theCritics = new Vector();
+            theCritics = new ArrayList<Critic>();
             criticRegistry.put(clazz, theCritics);
         }
         return theCritics;
     }
-
     ////////////////////////////////////////////////////////////////
     // criticism control
 
@@ -288,7 +328,7 @@
         Designer d,
         long reasonCode) {
         Class dmClazz = dm.getClass();
-        Collection c = criticsForClass(dmClazz);
+        Collection<Critic> c = criticsForClass(dmClazz);
         applyCritics(dm, d, c, reasonCode);
     }
 
@@ -298,7 +338,7 @@
      */
     public static void applyAllCritics(Object dm, Designer d) {
         Class dmClazz = dm.getClass();
-        Collection c = criticsForClass(dmClazz);
+        Collection<Critic> c = criticsForClass(dmClazz);
         applyCritics(dm, d, c, -1L);
     }
 
@@ -311,12 +351,10 @@
     public static void applyCritics(
         Object dm,
         Designer d,
-        Collection theCritics,
+        Collection<Critic> theCritics,
         long reasonCode) {
 
-        Iterator it = theCritics.iterator();
-        while (it.hasNext()) {
-            Critic c = (Critic) it.next();
+        for (Critic c : theCritics) {
             if (c.isActive() && c.matchReason(reasonCode)) {
                 try {
                     c.critique(dm, d);
@@ -346,9 +384,7 @@
         //     Enumeration clazzEnum = getCriticRegistry().keys();
         //     while (clazzEnum.hasMoreElements()) {
         //       Class clazz = (Class) (clazzEnum.nextElement());
-        Enumeration criticEnum = critics.elements();
-        while (criticEnum.hasMoreElements()) {
-            Critic c = (Critic) (criticEnum.nextElement());
+        for (Critic c : critics) {
             if (controlMech.isRelevant(c, d)) {
                 c.beActive();
             } else {

Modified: trunk/src_new/org/argouml/cognitive/CompoundCritic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/CompoundCritic.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/CompoundCritic.java&p2=trunk/src_new/org/argouml/cognitive/CompoundCritic.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/CompoundCritic.java	(original)
+++ trunk/src_new/org/argouml/cognitive/CompoundCritic.java	2007-07-01 01:10:04-0700
@@ -24,6 +24,8 @@
 
 package org.argouml.cognitive;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 import javax.swing.Icon;
 
@@ -54,7 +56,7 @@
     /**
      * The sub-critics that make up this CompoundCritic.
      */
-    private Vector critics = new Vector();
+    private List<Critic> critics = new ArrayList<Critic>();
 
     ////////////////////////////////////////////////////////////////
     // constructor
@@ -74,8 +76,8 @@
      */
     public CompoundCritic(Critic c1, Critic c2) {
 	this();
-	critics.addElement(c1);
-	critics.addElement(c2);
+	critics.add(c1);
+	critics.add(c2);
     }
 
     /**
@@ -87,7 +89,7 @@
      */
     public CompoundCritic(Critic c1, Critic c2, Critic c3) {
 	this(c1, c2);
-	critics.addElement(c3);
+	critics.add(c3);
     }
 
     /**
@@ -100,32 +102,62 @@
      */
     public CompoundCritic(Critic c1, Critic c2, Critic c3, Critic c4) {
 	this(c1, c2, c3);
-	critics.addElement(c4);
+	critics.add(c4);
     }
 
     ////////////////////////////////////////////////////////////////
     // accessors
 
     /**
+     * @param c
+     *            the new list of critics that completely replaces the old list
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #setCritics(List)}.
+     *             Unused in ArgoUML. Can be scheduled for speedy removal.
+     */
+    @Deprecated
+    public void setCritics(Vector<Critic> c) {
+        critics = c;
+    }
+
+    /**
      * @param c the new list of critics that completely
      *                replaces the old list
      */
-    public void setCritics(Vector c) { critics = c; }
+    public void setCritics(List<Critic> c) {
+        critics = c;
+    }
+
+    /**
+     * @return the complete list of critics
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getCriticList()}. Unused
+     *             in ArgoUML. Can be scheduled for speedy removal.
+     */
+    @Deprecated
+    public Vector<Critic> getCritics() {
+        return new Vector<Critic>(critics);
+    }
 
     /**
      * @return the complete list of critics
      */
-    public Vector getCritics() { return critics; }
+    public List<Critic> getCriticList() {
+        return critics;
+    }
 
+    
     /**
      * @param c the critic to be added at the end of the current list
      */
-    public void addCritic(Critic c) { critics.addElement(c); }
+    public void addCritic(Critic c) {
+        critics.add(c);
+    }
 
     /**
      * @param c the critic to be removed
      */
-    public void removeCritic(Critic c) { critics.removeElement(c); }
+    public void removeCritic(Critic c) {
+        critics.remove(c);
+    }
 
     ////////////////////////////////////////////////////////////////
     // critiquing
@@ -134,10 +166,9 @@
      * @see org.argouml.cognitive.critics.Critic#critique(java.lang.Object,
      * org.argouml.cognitive.Designer)
      */
+    @Override
     public void critique(Object dm, Designer dsgr) {
-	int size = critics.size();
-	for (int i = 0; i < size; ++i) {
-	    Critic c = (Critic) critics.elementAt(i);
+	for (Critic c : critics) {
 	    if (c.isActive() && c.predicate(dm, dsgr)) {
 		ToDoItem item = c.toDoItem(dm, dsgr);
 		postItem(item, dm, dsgr);
@@ -149,10 +180,9 @@
     /*
      * @see org.argouml.cognitive.Poster#supports(org.argouml.cognitive.Decision)
      */
+    @Override
     public boolean supports(Decision d) {
-	int size = critics.size();
-	for (int i = 0; i < size; ++i) {
-	    Critic c = (Critic) critics.elementAt(i);
+        for (Critic c : critics) {
 	    if (c.supports(d)) {
 		return true;
 	    }
@@ -163,13 +193,15 @@
     /*
      * @see org.argouml.cognitive.Poster#getSupportedDecisions()
      */
-    public Vector getSupportedDecisions() {
+    @Override
+    public List<Decision> getSupportedDecisions() {
 	throw new UnsupportedOperationException();
     }
 
     /*
      * @see org.argouml.cognitive.critics.Critic#addSupportedDecision(org.argouml.cognitive.Decision)
      */
+    @Override
     public void addSupportedDecision(Decision d) {
 	throw new UnsupportedOperationException();
     }
@@ -177,10 +209,9 @@
     /*
      * @see org.argouml.cognitive.Poster#supports(org.argouml.cognitive.Goal)
      */
+    @Override
     public boolean supports(Goal g) {
-	int size = critics.size();
-	for (int i = 0; i < size; ++i) {
-	    Critic c = (Critic) critics.elementAt(i);
+        for (Critic c : critics) {
 	    if (c.supports(g)) {
 		return true;
 	    }
@@ -191,13 +222,15 @@
     /*
      * @see org.argouml.cognitive.Poster#getSupportedGoals()
      */
-    public Vector getSupportedGoals() {
+    @Override
+    public List<Goal> getSupportedGoals() {
 	throw new UnsupportedOperationException();
     }
 
     /*
      * @see org.argouml.cognitive.critics.Critic#addSupportedGoal(org.argouml.cognitive.Goal)
      */
+    @Override
     public void addSupportedGoal(Goal g) {
 	throw new UnsupportedOperationException();
     }
@@ -205,10 +238,9 @@
     /*
      * @see org.argouml.cognitive.Poster#containsKnowledgeType(java.lang.String)
      */
+    @Override
     public boolean containsKnowledgeType(String type) {
-	int size = critics.size();
-	for (int i = 0; i < size; ++i) {
-	    Critic c = (Critic) critics.elementAt(i);
+        for (Critic c : critics) {
 	    if (c.containsKnowledgeType(type)) {
 		return true;
 	    }
@@ -219,6 +251,7 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#addKnowledgeType(java.lang.String)
      */
+    @Override
     public void addKnowledgeType(String type) {
 	throw new UnsupportedOperationException();
     }
@@ -226,6 +259,7 @@
     /*
      * @see org.argouml.cognitive.Poster#expand(java.lang.String, ListSet)
      */
+    @Override
     public String expand(String desc, ListSet offs) {
 	throw new UnsupportedOperationException();
     }
@@ -233,6 +267,7 @@
     /*
      * @see org.argouml.cognitive.Poster#getClarifier()
      */
+    @Override
     public Icon getClarifier() {
 	throw new UnsupportedOperationException();
     }
@@ -241,10 +276,9 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#isActive()
      */
+    @Override
     public boolean isActive() {
-	int size = critics.size();
-	for (int i = 0; i < size; ++i) {
-	    Critic c = (Critic) critics.elementAt(i);
+        for (Critic c : critics) {
 	    if (c.isActive()) {
 		return true;
 	    }
@@ -258,6 +292,7 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#isEnabled()
      */
+    @Override
     public boolean isEnabled() {
 	return true;
     }
@@ -269,8 +304,9 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem(java.lang.Object,
      * org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	throw new UnsupportedOperationException();
     }
 
-} /* end class CompoundCritic */
+}

Modified: trunk/src_new/org/argouml/cognitive/ControlMech.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ControlMech.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ControlMech.java&p2=trunk/src_new/org/argouml/cognitive/ControlMech.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ControlMech.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ControlMech.java	2007-07-01 01:10:04-0700
@@ -45,7 +45,7 @@
      * @return true f the critic is relevant for the given designer
      */
     boolean isRelevant(Critic c, Designer d);
-} // end interface ControlMech
+}
 
 
 

Modified: trunk/src_new/org/argouml/cognitive/Critic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Critic.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/Critic.java&p2=trunk/src_new/org/argouml/cognitive/Critic.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Critic.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Critic.java	2007-07-01 01:10:04-0700
@@ -25,10 +25,10 @@
 package org.argouml.cognitive;
 
 import java.io.Serializable;
-import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Observable;
-import java.util.Vector;
 
 import javax.swing.Icon;
 
@@ -53,7 +53,9 @@
  *
  * @author Jason Robbins
  */
-public class Critic extends Observable implements Poster, Serializable {
+public class Critic 
+    extends Observable 
+    implements Poster, Serializable {
 
     /**
      * Logger.
@@ -196,7 +198,8 @@
      *             violation of type safety.
      *             Create member attributes instead. 
      */
-    private Hashtable args = new Hashtable();
+    @Deprecated
+    private Hashtable<String, Object> args = new Hashtable<String, Object>();
 
     /**
      * The icon representing the resource.
@@ -221,9 +224,9 @@
      */
     private String decisionCategory;
 
-    private Vector supportedDecisions = new Vector();
+    private List<Decision> supportedDecisions = new ArrayList<Decision>();
 
-    private Vector supportedGoals = new Vector();
+    private List<Goal> supportedGoals = new ArrayList<Goal>();
 
     /**
      * The decision type of this critic.  For example, correctness,
@@ -242,9 +245,10 @@
      * Control records used in determining if this Critic should be
      * active.
      */
-    private Hashtable controlRecs = new Hashtable();
+    private Hashtable<String, Object> controlRecs = 
+        new Hashtable<String, Object>();
 
-    private ListSet knowledgeTypes = new ListSet();
+    private ListSet<String> knowledgeTypes = new ListSet<String>();
     private long triggerMask = 0L;
 
     ////////////////////////////////////////////////////////////////
@@ -271,7 +275,7 @@
 	}
 	addControlRec(SNOOZE_ORDER, new SnoozeOrder());
 	criticType = "correctness";
-	knowledgeTypes.addElement(KT_CORRECTNESS);
+	knowledgeTypes.add(KT_CORRECTNESS);
 	decisionCategory = "Checking";
 
 	moreInfoURL = defaultMoreInfoURL();
@@ -436,8 +440,7 @@
      * TODO: Maybe ToDoItem should carry some data to make
      * this method more efficient.
      *
-     * @see org.argouml.cognitive.Poster#stillValid(
-     * org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
+     * {@inheritDoc}
      */
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) {
@@ -447,7 +450,7 @@
 	if (i.getOffenders().size() != 1) {
 	    return true;
 	}
-	if (predicate(i.getOffenders().firstElement(), dsgr)) {
+	if (predicate(i.getOffenders().get(0), dsgr)) {
 	    // Now we know that this critic is still valid. What we need to
 	    // figure out is if the corresponding to-do item is still valid.
 	    // The to-do item is to be replaced if the name of some offender
@@ -456,7 +459,7 @@
 	    // We check that by creating a new ToDoItem and then verifying
 	    // that it looks exactly the same.
 	    // This really creates a lot of to-do items that goes to waste.
-	    ToDoItem item = toDoItem(i.getOffenders().firstElement(), dsgr);
+	    ToDoItem item = toDoItem(i.getOffenders().get(0), dsgr);
 	    return (item.equals(i));
 	}
 	return false;
@@ -469,18 +472,15 @@
 	return supportedDecisions.contains(d);
     }
 
-    /*
-     * @see org.argouml.cognitive.Poster#getSupportedDecisions()
-     */
-    public Vector getSupportedDecisions() {
-	return supportedDecisions;
+    public List<Decision> getSupportedDecisions() {
+        return supportedDecisions;
     }
-
+    
     /**
      * @param d the decision
      */
     public void addSupportedDecision(Decision d) {
-	supportedDecisions.addElement(d);
+	supportedDecisions.add(d);
     }
 
     /*
@@ -490,18 +490,14 @@
         return supportedGoals.contains(g);
     }
 
-    /*
-     * @see org.argouml.cognitive.Poster#getSupportedGoals()
-     */
-    public Vector getSupportedGoals() {
-	return supportedGoals;
+    public List<Goal> getSupportedGoals() {
+        return supportedGoals;
     }
-
     /**
      * @param g the goal
      */
     public void addSupportedGoal(Goal g) {
-	supportedGoals.addElement(g);
+	supportedGoals.add(g);
     }
 
     /*
@@ -515,18 +511,22 @@
      * @param type the knowledgetype
      */
     public void addKnowledgeType(String type) {
-	knowledgeTypes.addElement(type);
+	knowledgeTypes.add(type);
     }
 
     /**
      * @return the knowledgetypes
      */
-    public ListSet getKnowledgeTypes() { return knowledgeTypes; }
+    public ListSet<String> getKnowledgeTypes() {
+        return knowledgeTypes;
+    }
 
     /**
      * @param kt the knowledgetypes
      */
-    public void setKnowledgeTypes(ListSet kt) { knowledgeTypes = kt; }
+    public void setKnowledgeTypes(ListSet<String> kt) {
+        knowledgeTypes = kt;
+    }
 
     /**
      * Reset all knowledgetypes, and add the given one.
@@ -534,7 +534,7 @@
      * @param t1 the only knowledgetype in string format
      */
     public void setKnowledgeTypes(String t1) {
-	knowledgeTypes = new ListSet();
+	knowledgeTypes = new ListSet<String>();
 	addKnowledgeType(t1);
     }
 
@@ -545,7 +545,7 @@
      * @param t2 a knowledgetype in string format
      */
     public void setKnowledgeTypes(String t1, String t2) {
-	knowledgeTypes = new ListSet();
+	knowledgeTypes = new ListSet<String>();
 	addKnowledgeType(t1);
 	addKnowledgeType(t2);
     }
@@ -558,7 +558,7 @@
      * @param t3 a knowledgetype in string format
      */
     public void setKnowledgeTypes(String t1, String t2, String t3) {
-	knowledgeTypes = new ListSet();
+	knowledgeTypes = new ListSet<String>();
 	addKnowledgeType(t1);
 	addKnowledgeType(t2);
 	addKnowledgeType(t3);
@@ -575,7 +575,9 @@
     /**
      * @return the trigger mask
      */
-    public long getTriggerMask() { return triggerMask; }
+    public long getTriggerMask() {
+        return triggerMask;
+    }
 
     /**
      * @param s the trigger to be added (is ORed into the mask)
@@ -738,9 +740,7 @@
      * @return true if relevant
      */
     public boolean isRelevantToDecisions(Designer dsgr) {
-	Enumeration elems = getSupportedDecisions().elements();
-	while (elems.hasMoreElements()) {
-	    Decision d = (Decision) elems.nextElement();
+        for (Decision d : getSupportedDecisions()) {
         /* TODO: Make use of the constants defined in the ToDoItem class! */
 	    if (d.getPriority() > 0 && d.getPriority() <= getPriority()) {
 		return true;
@@ -807,7 +807,9 @@
      * @param item the todo item
      * @return null if no wizard is defined.
      */
-    public Class getWizardClass(ToDoItem item) { return null; }
+    public Class getWizardClass(ToDoItem item) {
+        return null;
+    }
 
 
     /**
@@ -819,7 +821,8 @@
      *
      * @param w the wizard
      */
-    public void initWizard(Wizard w) { }
+    public void initWizard(Wizard w) {
+    }
 
     ////////////////////////////////////////////////////////////////
     // accessors
@@ -831,7 +834,9 @@
      *
      * @return the decision category
      */
-    public String getDecisionCategory() { return decisionCategory; }
+    public String getDecisionCategory() {
+        return decisionCategory;
+    }
 
     /**
      * Set the decisionCategory, usually done in the constructor. I
@@ -840,7 +845,9 @@
      *
      * @param c the category
      */
-    protected void setDecisionCategory(String c) { decisionCategory = c; }
+    protected void setDecisionCategory(String c) {
+        decisionCategory = c;
+    }
 
     /**
      * Reply a string used to contol critics according to
@@ -849,7 +856,9 @@
      *
      * @return the critic knowledge type
      */
-    public String getCriticType() { return criticType; }
+    public String getCriticType() {
+        return criticType;
+    }
 
     /**
      * Reply the headline used in feedback produced by this Critic.
@@ -870,7 +879,7 @@
      * @return the headline
      */
     public String getHeadline(ListSet offenders, Designer dsgr) {
-	return getHeadline(offenders.firstElement(), dsgr);
+	return getHeadline(offenders.get(0), dsgr);
     }
 
     /**
@@ -878,14 +887,18 @@
      *
      * @return the headline
      */
-    public String getHeadline() { return headline; }
+    public String getHeadline() {
+        return headline;
+    }
 
     /**
      * Set the headline used in feedback produced by this Critic.
      *
      * @param h the headline
      */
-    public void setHeadline(String h) {  headline = h; }
+    public void setHeadline(String h) {
+        headline = h;
+    }
 
     /**
      * Reply the priority used in feedback produced by this Critic.
@@ -901,7 +914,9 @@
     /**
      * @param p the priority
      */
-    public void setPriority(int p) { priority = p; }
+    public void setPriority(int p) {
+        priority = p;
+    }
 
     /**
      * @return the priority
@@ -924,7 +939,9 @@
     /**
      * @param d the description
      */
-    public void setDescription(String d) {  description = d; }
+    public void setDescription(String d) {
+        description = d;
+    }
 
     /**
      * @return the description
@@ -947,7 +964,9 @@
     /**
      * @param m the more-info-url
      */
-    public void setMoreInfoURL(String m) {  moreInfoURL = m; }
+    public void setMoreInfoURL(String m) {
+        moreInfoURL = m;
+    }
 
     /**
      * @return the more-info-url
@@ -964,6 +983,7 @@
      *             violation of type safety.
      *             Create member attributes instead. 
      */
+    @Deprecated
     protected void setArg(String name, Object value) {
 	args.put(name, value);
     }
@@ -976,6 +996,7 @@
      *             violation of type safety.
      *             Create member attributes instead. 
      */
+    @Deprecated
     protected Object getArg(String name) {
 	return args.get(name);
     }
@@ -987,7 +1008,10 @@
      *             violation of type safety.
      *             Create member attributes instead. 
      */
-    public Hashtable  getArgs() { return args; }
+    @Deprecated
+    public Hashtable<String, Object> getArgs() {
+        return args;
+    }
 
     /**
      * @param h the new table of (key, value) pairs
@@ -996,7 +1020,10 @@
      *             violation of type safety.
      *             Create member attributes instead. 
      */
-    public void setArgs(Hashtable h) { args = h; }
+    @Deprecated
+    public void setArgs(Hashtable<String, Object> h) {
+        args = h;
+    }
 
     ////////////////////////////////////////////////////////////////
     // design feedback
@@ -1013,7 +1040,7 @@
      * 
      * @see Critic#critique
      *
-     * @param dm
+     * @param dm the offender
      * @param dsgr the designer
      * @return ToDoItem
      */
@@ -1042,15 +1069,17 @@
     /*
      * @see org.argouml.cognitive.Poster#fixIt(org.argouml.cognitive.ToDoItem, java.lang.Object)
      */
-    public void fixIt(ToDoItem item, Object arg) { }
+    public void fixIt(ToDoItem item, Object arg) {
+    }
 
     /*
      * Reply a string that describes this Critic. Identical to getCriticName()
      *
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
 	return getCriticName();
     }
 
-} /* end class Critic */
+}

Modified: trunk/src_new/org/argouml/cognitive/Decision.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Decision.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/Decision.java&p2=trunk/src_new/org/argouml/cognitive/Decision.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Decision.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Decision.java	2007-07-01 01:10:04-0700
@@ -73,6 +73,7 @@
     /*
      * @see java.lang.Object#hashCode()
      */
+    @Override
     public int hashCode() {
         if (name == null) {
             return 0;
@@ -86,6 +87,7 @@
      *
      * {@inheritDoc}
      */
+    @Override
     public boolean equals(Object d2) {
         if (!(d2 instanceof Decision)) {
             return false;
@@ -126,7 +128,8 @@
     /*
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
         return getName();
     }
-} /* end class Decision */
+}

Modified: trunk/src_new/org/argouml/cognitive/DecisionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/DecisionModel.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/DecisionModel.java&p2=trunk/src_new/org/argouml/cognitive/DecisionModel.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/DecisionModel.java	(original)
+++ trunk/src_new/org/argouml/cognitive/DecisionModel.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,8 @@
 package org.argouml.cognitive;
 
 import java.io.Serializable;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Observable;
 import java.util.Vector;
 
@@ -47,14 +48,14 @@
  * @author Jason Robbins
  */
 public class DecisionModel extends Observable implements Serializable {
-    private Vector decisions = new Vector();
+    private List<Decision> decisions = new ArrayList<Decision>();
 
     /**
      * The constructor.
      *
      */
     public DecisionModel() {
-	decisions.addElement(Decision.UNSPEC);
+	decisions.add(Decision.UNSPEC);
     }
 
     ////////////////////////////////////////////////////////////////
@@ -62,9 +63,19 @@
 
     /**
      * @return the list of decisions
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getDecisionList()}.
      */
-    public Vector getDecisions() { return decisions; }
+    @Deprecated
+    public Vector<Decision> getDecisions() {
+        return new Vector<Decision>(decisions);
+    }
 
+    /**
+     * @return the list of decisions
+     */
+    public List<Decision> getDecisionList() {
+        return decisions;
+    }
 
     /**
      * This function sets the priority of an existing decision, or
@@ -79,7 +90,7 @@
 	Decision d = findDecision(decision);
 	if (null == d) {
 	    d = new Decision(decision, priority);
-	    decisions.addElement(d);
+	    decisions.add(d);
 	    return;
 	}
 	d.setPriority(priority);
@@ -110,8 +121,8 @@
      * @param d the interesting decision
      */
     public void startConsidering(Decision d) {
-	decisions.removeElement(d);
-	decisions.addElement(d);
+	decisions.remove(d);
+	decisions.add(d);
     }
 
 
@@ -122,7 +133,7 @@
      * @param d the uninteresting decision
      */
     public void stopConsidering(Decision d) {
-	decisions.removeElement(d);
+	decisions.remove(d);
     }
 
     /**
@@ -132,9 +143,7 @@
      * @return a decision or null if not found.
      */
     protected Decision findDecision(String decName) {
-	Enumeration elems = decisions.elements();
-	while (elems.hasMoreElements()) {
-	    Decision d = (Decision) elems.nextElement();
+        for (Decision d : decisions) {
 	    if (decName.equals(d.getName())) {
 		return d;
 	    }
@@ -142,4 +151,4 @@
 	return null;
     }
 
-} /* end class DecisionModel */
+}

Modified: trunk/src_new/org/argouml/cognitive/Designer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Designer.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/Designer.java&p2=trunk/src_new/org/argouml/cognitive/Designer.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Designer.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Designer.java	2007-07-01 01:10:04-0700
@@ -27,7 +27,9 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Properties;
 import java.util.Vector;
 
@@ -58,8 +60,14 @@
  * This class listens to property changes from ...?<p>
  *
  * A Designer can as well create ToDO Items, such as critics do. Hence he
- * implements the Poster interface.
+ * implements the Poster interface.<p>
  *
+ * TODO: There is a strong dependency cycle between Agency and Designer.  They
+ * either need to be merged into a single class or partitioned differently, 
+ * perhaps using an interface to break the cycle.  The Designer singleton gets
+ * passed to almost every single part of the Critic subsystem, creating strong
+ * coupling throughout. - tfm 20070620
+ * 
  * @author Jason Robbins
  */
 public final class Designer
@@ -78,16 +86,16 @@
 
     private static boolean userWorking;
 
-    private static Vector<Decision> unspecDecisionVector;
-    private static Vector<Goal> unspecGoalVector;
+    private static List<Decision> unspecifiedDecision;
+    private static List<Goal> unspecifiedGoal;
 
     private static Action saveAction;
 
     static {
-        unspecDecisionVector = new Vector<Decision>();
-        unspecDecisionVector.addElement(Decision.UNSPEC);
-        unspecGoalVector = new Vector<Goal>();
-        unspecGoalVector.addElement(Goal.getUnspecifiedGoal());
+        unspecifiedDecision = new ArrayList<Decision>();
+        unspecifiedDecision.add(Decision.UNSPEC);
+        unspecifiedGoal = new ArrayList<Goal>();
+        unspecifiedGoal.add(Goal.getUnspecifiedGoal());
     }
 
     /**
@@ -160,15 +168,15 @@
    /**
      * dm's that should be critiqued ASAP.
      */
-    private Vector<Object> hotQueue;
+    private List<Object> hotQueue;
 
-    private Vector<Long> hotReasonQueue;
+    private List<Long> hotReasonQueue;
 
-    private Vector<Object> addQueue;
+    private List<Object> addQueue;
 
-    private Vector<Long> addReasonQueue;
+    private List<Long> addReasonQueue;
 
-    private Vector<Object> removeQueue;
+    private List<Object> removeQueue;
 
     private static int longestAdd;
 
@@ -177,7 +185,7 @@
     /**
      * dm's that should be critiqued relatively soon.
      */
-    private Vector<Object> warmQueue;
+    private List<Object> warmQueue;
 
     private ChildGenerator childGenerator;
 
@@ -221,15 +229,15 @@
         critiquingInterval = 8000;
         critiqueCPUPercent = 10;
 
-        hotQueue = new Vector<Object>();
-        hotReasonQueue = new Vector<Long>();
-        addQueue = new Vector<Object>();
-        addReasonQueue = new Vector<Long>();
-        removeQueue = new Vector<Object>();
+        hotQueue = new ArrayList<Object>();
+        hotReasonQueue = new ArrayList<Long>();
+        addQueue = new ArrayList<Object>();
+        addReasonQueue = new ArrayList<Long>();
+        removeQueue = new ArrayList<Object>();
         longestAdd = 0;
         longestHot = 0;
 
-        warmQueue = new Vector<Object>();
+        warmQueue = new ArrayList<Object>();
 
         childGenerator = new EmptyChildGenerator();
 
@@ -299,34 +307,33 @@
 
                         size = addQueue.size();
                         for (int i = 0; i < size; i++) {
-                            hotQueue.addElement(addQueue.elementAt(i));
-                            hotReasonQueue.addElement(addReasonQueue
-                                    .elementAt(i));
+                            hotQueue.add(addQueue.get(i));
+                            hotReasonQueue.add(addReasonQueue.get(i));
                         }
-                        addQueue.removeAllElements();
-                        addReasonQueue.removeAllElements();
+                        addQueue.clear();
+                        addReasonQueue.clear();
 
                         longestHot = Math.max(longestHot, hotQueue.size());
                         agency.determineActiveCritics(this);
 
                         while (hotQueue.size() > 0) {
-                            Object dm = hotQueue.elementAt(0);
+                            Object dm = hotQueue.get(0);
                             Long reasonCode =
-                                    hotReasonQueue.elementAt(0);
-                            hotQueue.removeElementAt(0);
-                            hotReasonQueue.removeElementAt(0);
+                                    hotReasonQueue.get(0);
+                            hotQueue.remove(0);
+                            hotReasonQueue.remove(0);
                             Agency.applyAllCritics(dm, theDesigner(),
                                     reasonCode.longValue());
                         }
 
                         size = removeQueue.size();
                         for (int i = 0; i < size; i++) {
-                            warmQueue.removeElement(removeQueue.elementAt(i));
+                            warmQueue.remove(removeQueue.get(i));
                         }
-                        removeQueue.removeAllElements();
+                        removeQueue.clear();
 
                         if (warmQueue.size() == 0) {
-                            warmQueue.addElement(critiquingRoot);
+                            warmQueue.add(critiquingRoot);
                         }
                         while (warmQueue.size() > 0
                                 && (System.currentTimeMillis() < cutoffTime
@@ -334,8 +341,8 @@
                             if (minWarmElements > 0) {
                                 minWarmElements--;
                             }
-                            Object dm = warmQueue.elementAt(0);
-                            warmQueue.removeElementAt(0);
+                            Object dm = warmQueue.get(0);
+                            warmQueue.remove(0);
                             try {
                                 Agency.applyAllCritics(dm, theDesigner());
                                 java.util.Enumeration subDMs =
@@ -343,7 +350,7 @@
                                 while (subDMs.hasMoreElements()) {
                                     Object nextDM = subDMs.nextElement();
                                     if (!(warmQueue.contains(nextDM))) {
-                                        warmQueue.addElement(nextDM);
+                                        warmQueue.add(nextDM);
                                     }
                                 }
                             } catch (InvalidElementException e) {
@@ -399,17 +406,17 @@
         LOG.debug("critiqueASAP:" + dm);
         int addQueueIndex = addQueue.indexOf(dm);
         if (addQueueIndex == -1) {
-            addQueue.addElement(dm);
+            addQueue.add(dm);
             Long reasonCodeObj = new Long(rCode);
-            addReasonQueue.addElement(reasonCodeObj);
+            addReasonQueue.add(reasonCodeObj);
         } else {
             Long reasonCodeObj =
-		addReasonQueue.elementAt(addQueueIndex);
+		addReasonQueue.get(addQueueIndex);
             long rc = reasonCodeObj.longValue() | rCode;
             Long newReasonCodeObj = new Long(rc);
-            addReasonQueue.setElementAt(newReasonCodeObj, addQueueIndex);
+            addReasonQueue.set(addQueueIndex, newReasonCodeObj);
         }
-        removeQueue.addElement(dm);
+        removeQueue.add(dm);
         longestAdd = Math.max(longestAdd, addQueue.size());
     }
 
@@ -574,12 +581,12 @@
     public static void clearCritiquing() {
         synchronized (theDesigner()) {
             theDesigner().toDoList.removeAllElements(); //v71
-            theDesigner().hotQueue.removeAllElements();
-            theDesigner().hotReasonQueue.removeAllElements();
-            theDesigner().addQueue.removeAllElements();
-            theDesigner().addReasonQueue.removeAllElements();
-            theDesigner().removeQueue.removeAllElements();
-            theDesigner().warmQueue.removeAllElements();
+            theDesigner().hotQueue.clear();
+            theDesigner().hotReasonQueue.clear();
+            theDesigner().addQueue.clear();
+            theDesigner().addReasonQueue.clear();
+            theDesigner().removeQueue.clear();
+            theDesigner().warmQueue.clear();
         }
         //clear out queues! @@@
     }
@@ -606,30 +613,50 @@
     /**
      * @return the childgenerator
      */
-    public ChildGenerator getChildGenerator() { return childGenerator; }
+    public ChildGenerator getChildGenerator() {
+        return childGenerator;
+    }
 
     /**
      * @param cg the childgenerator
      */
-    public void setChildGenerator(ChildGenerator cg) { childGenerator = cg; }
+    public void setChildGenerator(ChildGenerator cg) {
+        childGenerator = cg;
+    }
 
     /**
      * @return the decisions
      */
-    public DecisionModel getDecisionModel() { return decisions; }
+    public DecisionModel getDecisionModel() {
+        return decisions;
+    }
 
 
     /**
      * @return the goals
      */
-    public GoalModel getGoalModel() { return goals; }
+    public GoalModel getGoalModel() {
+        return goals;
+    }
 
     /**
      * @return the goals
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getGoalList()}.
      */
-    public Vector getGoals() { return goals.getGoals(); }
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    public Vector<Goal> getGoals() {
+        return goals.getGoals();
+    }
 
     /**
+     * @return the goals.
+     */
+    public List<Goal> getGoalList() {
+        return goals.getGoalList();
+    }
+    
+    /**
      * This method returns true.<p>
      *
      * ToDoItem's that are posted by the designer are assumed to be
@@ -652,27 +679,31 @@
     /*
      * @see org.argouml.cognitive.Poster#supports(org.argouml.cognitive.Decision)
      */
-    public boolean supports(Decision d) { return d == Decision.UNSPEC; }
+    public boolean supports(Decision d) {
+        return d == Decision.UNSPEC;
+    }
 
     /*
      * @see org.argouml.cognitive.Poster#getSupportedDecisions()
      */
-    public Vector<Decision> getSupportedDecisions() { 
-        return unspecDecisionVector; 
+    public List<Decision> getSupportedDecisions() { 
+        return unspecifiedDecision; 
     }
-
+    
     /*
      * @see org.argouml.cognitive.Poster#supports(org.argouml.cognitive.Goal)
      */
-    public boolean supports(Goal g) { return true; }
+    public boolean supports(Goal g) {
+        return true;
+    }
 
     /*
      * @see org.argouml.cognitive.Poster#getSupportedGoals()
      */
-    public Vector<Goal> getSupportedGoals() { 
-        return unspecGoalVector; 
+    public List<Goal> getSupportedGoals() { 
+        return unspecifiedGoal; 
     }
-
+    
     /*
      * @see org.argouml.cognitive.Poster#containsKnowledgeType(java.lang.String)
      */
@@ -803,8 +834,8 @@
 
     /**
      * Reply the Agency object that is helping this Designer.
-     *
-     * @return my agancy
+     * 
+     * @return my agency
      */
     public Agency getAgency() { return agency; }
 
@@ -912,4 +943,4 @@
      * The UID.
      */
     private static final long serialVersionUID = -3647853023882216454L;
-} /* end class Designer */
+}

Modified: trunk/src_new/org/argouml/cognitive/GoalModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/GoalModel.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/GoalModel.java&p2=trunk/src_new/org/argouml/cognitive/GoalModel.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/GoalModel.java	(original)
+++ trunk/src_new/org/argouml/cognitive/GoalModel.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,8 @@
 package org.argouml.cognitive;
 
 import java.io.Serializable;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Observable;
 import java.util.Vector;
 
@@ -41,7 +42,7 @@
  * @author Jason Robbins
  */
 public class GoalModel extends Observable implements Serializable {
-    private Vector goals = new Vector();
+    private List<Goal> goals = new ArrayList<Goal>();
 
     /**
      * The constructor.
@@ -56,18 +57,34 @@
 
     /**
      * @return the list of goals
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getGoalList()}.
      */
-    public Vector getGoals() { return goals; }
+    @Deprecated
+    public Vector<Goal> getGoals() {
+        return new Vector<Goal>(goals);
+    }
+
+    /**
+     * @return the list of goals
+     */
+    public List<Goal> getGoalList() {
+        return goals;
+    }
 
+    
     /**
      * @param g the goal to be added
      */
-    public void addGoal(Goal g) { goals.addElement(g); }
+    public void addGoal(Goal g) {
+        goals.add(g);
+    }
 
     /**
      * @param g the goal to be removed
      */
-    public void removeGoal(Goal g) { goals.removeElement(g); }
+    public void removeGoal(Goal g) {
+        goals.remove(g);
+    }
 
     /**
      * Reply true iff the Designer wants to achieve the given goal.
@@ -76,9 +93,7 @@
      * @return true if the designer wants this
      */
     public boolean hasGoal(String goalName) {
-	Enumeration goalEnum = goals.elements();
-	while (goalEnum.hasMoreElements()) {
-	    Goal g = (Goal) goalEnum.nextElement();
+        for (Goal g : goals) {
 	    if (g.getName().equals(goalName)) {
 		return g.getPriority() > 0;
 	    }
@@ -92,8 +107,8 @@
      */
     public synchronized void setGoalPriority(String goalName, int priority) {
 	Goal g = new Goal(goalName, priority);
-	goals.removeElement(g);
-	goals.addElement(g);
+	goals.remove(g);
+	goals.add(g);
     }
 
     //   public Object getGoalInfo(String goal) {
@@ -125,4 +140,4 @@
     }
 
 
-} /* end class GoalModel */
+}

Modified: trunk/src_new/org/argouml/cognitive/ItemUID.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ItemUID.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ItemUID.java&p2=trunk/src_new/org/argouml/cognitive/ItemUID.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ItemUID.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ItemUID.java	2007-07-01 01:10:04-0700
@@ -173,8 +173,8 @@
 
 	Object rv;
 	try {
-	    Method m = obj.getClass().getMethod("getItemUID", null);
-	    rv = m.invoke(obj, null);
+	    Method m = obj.getClass().getMethod("getItemUID", (Class) null);
+	    rv = m.invoke(obj, (Object) null);
 	} catch (NoSuchMethodException nsme) {
 	    // Apparently this object had no getItemUID
 	    return null;

Modified: trunk/src_new/org/argouml/cognitive/Poster.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Poster.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/Poster.java&p2=trunk/src_new/org/argouml/cognitive/Poster.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Poster.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Poster.java	2007-07-01 01:10:04-0700
@@ -24,7 +24,7 @@
 
 package org.argouml.cognitive;
 
-import java.util.Vector;
+import java.util.List;
 
 import javax.swing.Icon;
 
@@ -41,6 +41,10 @@
  * @see org.argouml.cognitive.Critic
  * @see Designer
  * @author Jason Robbins
+ * @since 0.25.4 An incompatible change was made to the API so that methods
+ * which used to return Vector now return List<listType>.  Introducing a new
+ * interface with the different methods would have been just as incompatible,
+ * so we just changed this one.
  */
 public interface Poster {
 
@@ -65,8 +69,11 @@
 
     /**
      * @return the list of supported decisions
+     * @since 0.25.4 An incompatible change was made to the return type. It used
+     *        to return Vector.  Deprecation wasn't used since this is only used
+     *        one place in ArgoUML.
      */
-    Vector getSupportedDecisions();
+    List<Decision> getSupportedDecisions();
 
     /**
      * @param g the goal
@@ -76,8 +83,11 @@
 
     /**
      * @return the list of supported goals
+     * @since 0.25.4 An incompatible change was made to the return type. It used
+     *        to return Vector.  Deprecation wasn't used since this is only used
+     *        one place in ArgoUML.
      */
-    Vector getSupportedGoals();
+    List<Goal> getSupportedGoals();
 
     /**
      * @param knowledgeType the knowledge type

Modified: trunk/src_new/org/argouml/cognitive/ResolvedCritic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ResolvedCritic.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ResolvedCritic.java&p2=trunk/src_new/org/argouml/cognitive/ResolvedCritic.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ResolvedCritic.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ResolvedCritic.java	2007-07-01 01:10:04-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2002-2006 The Regents of the University of California. All
+// Copyright (c) 2002-2007 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,12 +24,10 @@
 
 package org.argouml.cognitive;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
 
-
-
 import org.apache.log4j.Logger;
 
 // TODO: Maybe the exception strings should be internationalized
@@ -54,7 +52,7 @@
     /**
      * The IDs of the objects that define the context of the critic.
      */
-    private List offenders;
+    private List<String> offenders;
 
     /**
      * Creates a new ResolvedCritic using the name of the Critic and the
@@ -62,17 +60,31 @@
      *
      * @param	cr	The name of the Critic that has been resolved
      * @param	offs	The Vector of related objects.
+     * @deprecated for 0.25.4 by tfmorris.  Use 
+     * {@link #ResolvedCritic(String, List)}.
      */
+    @Deprecated
     public ResolvedCritic(String cr, Vector offs) {
-	critic = cr;
-	if (offs != null && offs.size() > 0) {
-	    offenders = new Vector(offs);
-	} else {
-	    offenders = null;
-	}
+        this(cr, (List) offs);
     }
 
     /**
+     * Creates a new ResolvedCritic using the name of the Critic and the
+     * List of objects that triggered the Critic given as parameters.
+     *
+     * @param   cr      The name of the Critic that has been resolved
+     * @param   offs    The List of related objects.
+     */
+    public ResolvedCritic(String cr, List<String> offs) {
+        critic = cr;
+        if (offs != null && offs.size() > 0) {
+            offenders = new ArrayList<String>(offs);
+        } else {
+            offenders = null;
+        }
+    }
+    
+    /**
      * Same as {@link #ResolvedCritic(Critic,ListSet,boolean)}.
      *
      * @param c The Critic that has been resolved.
@@ -108,7 +120,7 @@
 
 	try {
 	    if (offs != null && offs.size() > 0) {
-		offenders = new Vector(offs.size());
+		offenders = new ArrayList<String>(offs.size());
 		importOffenders(offs, canCreate);
 	    } else {
 	        offenders = null;
@@ -231,11 +243,9 @@
     protected void importOffenders(ListSet set, boolean canCreate)
 	throws UnresolvableException {
 
-	Enumeration elems = set.elements();
 	String fail = null;
 
-	while (elems.hasMoreElements()) {
-	    Object obj = elems.nextElement();
+        for (Object obj : set) {
 	    String id = ItemUID.getIDOfObject(obj, canCreate);
 	    if (id == null) {
 		if (!canCreate) {
@@ -291,12 +301,11 @@
     /*
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
 	StringBuffer sb =
 	    new StringBuffer("ResolvedCritic: " + critic + " : ");
-	int i;
-
-	for (i = 0; i < offenders.size(); i++) {
+	for (int i = 0; i < offenders.size(); i++) {
 	    if (i > 0) {
 	        sb.append(", ");
 	    }

Modified: trunk/src_new/org/argouml/cognitive/StandardCM.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/StandardCM.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/StandardCM.java&p2=trunk/src_new/org/argouml/cognitive/StandardCM.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/StandardCM.java	(original)
+++ trunk/src_new/org/argouml/cognitive/StandardCM.java	2007-07-01 01:10:04-0700
@@ -24,7 +24,9 @@
 
 package org.argouml.cognitive;
 
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Vector;
 
 /**
@@ -99,12 +101,21 @@
 } // end class CurDecisionCM
 
 abstract class CompositeCM implements ControlMech {
-    private Vector mechs = new Vector();
+    private List<ControlMech> mechs = new ArrayList<ControlMech>();
 
     /**
-     * @return Returns the _mechs.
+     * @return Returns the ControlMechs.
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getControlMechs}.
      */
-    protected Vector getMechs() {
+    @Deprecated
+    protected Vector<ControlMech> getMechs() {
+        return new Vector<ControlMech>(mechs);
+    }
+    
+    /**
+     * @return a list of the ControlMechs.
+     */
+    protected List<ControlMech> getMechList() {
         return mechs;
     }
 
@@ -113,7 +124,7 @@
      *            the ControlMech
      */
     public void addMech(ControlMech cm) {
-        mechs.addElement(cm);
+        mechs.add(cm);
     }
 } // end class CompositeCM
 

Modified: trunk/src_new/org/argouml/cognitive/ToDoItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ToDoItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ToDoItem.java&p2=trunk/src_new/org/argouml/cognitive/ToDoItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ToDoItem.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ToDoItem.java	2007-07-01 01:10:04-0700
@@ -25,8 +25,9 @@
 package org.argouml.cognitive;
 
 import java.io.Serializable;
-import java.util.Enumeration;
+
 import javax.swing.Icon;
+
 import org.argouml.cognitive.critics.Wizard;
 import org.argouml.cognitive.critics.WizardItem;
 import org.argouml.model.Model;
@@ -105,9 +106,13 @@
      * Which part of the design this issue affects.<p>
      *
      * Each member is either a model element, a {@link Fig}, or
-     * a {@link Diagram}.<p>
-     *
-     * This is set by the constructor and cannot change.
+     * a {@link Diagram}. TODO: Because there is not a common
+     * supertype for these three types, we can't type this list.
+     * We should introduce a common supertype/interface. - tfm <p>
+     *
+     * This is set by the constructor and cannot change.<p>
+     * 
+     * TODO: Offenders need to be more strongly typed. - tfm 20070630
      */
     private ListSet theOffenders;
 
@@ -241,7 +246,7 @@
         }
 
         if (offs.size() >= 2) {
-            offender = offs.elementAt(1);
+            offender = offs.get(1);
             checkArgument(offender);
         }
     }
@@ -326,6 +331,7 @@
      * Reply a Set of design material's that are the subject of this ToDoItem.
      *
      * @return the offenders
+     * TODO: Offenders need to be more strongly typed. - tfm 20070630
      */
     public ListSet getOffenders() {
         assert theOffenders != null;
@@ -333,9 +339,9 @@
         // system. Find a better way to do this. We should not use
         // assert on public methods.
         assert theOffenders.size() <= 0
-        	|| Model.getFacade().isAUMLElement(theOffenders.elementAt(0))
-        	|| theOffenders.elementAt(0) instanceof Fig
-        	|| theOffenders.elementAt(0) instanceof Diagram;
+        	|| Model.getFacade().isAUMLElement(theOffenders.get(0))
+        	|| theOffenders.get(0) instanceof Fig
+        	|| theOffenders.get(0) instanceof Diagram;
         return theOffenders;
     }
 
@@ -343,6 +349,7 @@
      * Set the design material that is subject of this ToDoItem.
      *
      * @param offenders the offenders
+     * TODO: Offenders need to be more strongly typed. - tfm 20070630
      */
     public void setOffenders(ListSet offenders) {
         theOffenders = offenders;
@@ -353,7 +360,9 @@
      *
      * @return the poster
      */
-    public Poster getPoster() { return thePoster; }
+    public Poster getPoster() {
+        return thePoster;
+    }
 
     /**
      * Return a clarifier object that can graphical highlight this
@@ -398,6 +407,7 @@
     /*
      * @see java.lang.Object#hashCode()
      */
+    @Override
     public int hashCode() {
         int code = 0;
 
@@ -417,6 +427,7 @@
      *
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals(Object o) {
 	if (!(o instanceof ToDoItem)) {
 	    return false;
@@ -446,9 +457,7 @@
      * the "offending" design material's.
      */
     public void select() {
-	Enumeration offs = getOffenders().elements();
-	while (offs.hasMoreElements()) {
-	    Object dm = offs.nextElement();
+        for (Object dm : getOffenders()) {
 	    if (dm instanceof Highlightable) {
 	        ((Highlightable) dm).setHighlight(true);
 	    }
@@ -460,9 +469,7 @@
      * unhighlight the "offending" design material's.
      */
     public void deselect() {
-	Enumeration offs = getOffenders().elements();
-	while (offs.hasMoreElements()) {
-	    Object dm =  offs.nextElement();
+        for (Object dm : getOffenders()) {
 	    if (dm instanceof Highlightable) {
 	        ((Highlightable) dm).setHighlight(false);
 	    }
@@ -475,7 +482,10 @@
      * re-select it, subclasses may choose to do more (e.g., navigate to
      * the offending item if it is not visible).
      */
-    public void action() { deselect(); select(); }
+    public void action() {
+        deselect();
+        select();
+    }
 
     /**
      * Notify the user interface that this ToDoItem has
@@ -494,7 +504,9 @@
      * Some problems can be automatically fixed, ask the Critic to do
      * it if it can. <p>
      */
-    public void fixIt() { thePoster.fixIt(this, null); }
+    public void fixIt() {
+        thePoster.fixIt(this, null);
+    }
 
     /**
      * Some problems can be automatically fixed, ask the Critic to do
@@ -502,7 +514,9 @@
      *
      * @return true if the critic can automatically fix the problem
      */
-    public boolean canFixIt() { return thePoster.canFixIt(this); }
+    public boolean canFixIt() {
+        return thePoster.canFixIt(this);
+    }
 
     /**
      * TODO: this is not done yet. Eventually this will also
@@ -538,6 +552,7 @@
      *
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
 	return this.getClass().getName()
 	    + "(" + getHeadline() + ") on " + getOffenders().toString();
@@ -547,7 +562,7 @@
      * The UID.
      */
     private static final long serialVersionUID = 3058660098451455153L;
-} /* end class ToDoItem */
+}
 
 
 

Modified: trunk/src_new/org/argouml/cognitive/ToDoList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ToDoList.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ToDoList.java&p2=trunk/src_new/org/argouml/cognitive/ToDoList.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ToDoList.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ToDoList.java	2007-07-01 01:10:04-0700
@@ -25,8 +25,10 @@
 package org.argouml.cognitive;
 
 import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Observable;
 import java.util.Set;
 import java.util.Vector;
@@ -66,14 +68,16 @@
  * @see Designer#nondisruptivelyWarn
  * @author Jason Robbins
  */
-public class ToDoList extends Observable implements Runnable {
+public class ToDoList extends Observable implements Runnable,
+        Iterable<ToDoItem> {
     /**
      * Logger.
      */
     private static final Logger LOG = Logger.getLogger(ToDoList.class);
 
+    // TODO: Offenders need to be more strongly typed. - tfm 20070630
     private static Object recentOffender;
-    private static Vector<ToDoItem> recentOffenderItems;
+    private static List<ToDoItem> recentOffenderItems;
 
     ////////////////////////////////////////////////////////////////
     // instance variables
@@ -81,17 +85,18 @@
     /**
      * Pending ToDoItems for the designer to consider.
      */
-    private Vector<ToDoItem> items;
+    private List<ToDoItem> items;
 
     /**
      * These are computed when needed.
+     * TODO: Offenders need to be more strongly typed. - tfm 20070630
      */
     private ListSet allOffenders;
 
     /**
      * These are computed when needed.
      */
-    private ListSet allPosters;
+    private ListSet<Poster> allPosters;
 
     /**
      * ToDoItems that the designer has explicitly indicated that (s)he
@@ -131,12 +136,12 @@
      */
     ToDoList() {
 
-	items = new Vector<ToDoItem>(100);
+	items = new ArrayList<ToDoItem>(100);
 	resolvedItems = new LinkedHashSet<ResolvedCritic>(100);
 	listenerList = new EventListenerList();
 	longestToDoList = 0;
 	numNotValid = 0;
-	recentOffenderItems = new Vector<ToDoItem>();
+	recentOffenderItems = new ArrayList<ToDoItem>();
     }
 
     /**
@@ -156,7 +161,7 @@
      * Periodically check to see if items on the list are still valid.
      */
     public void run() {
-        Vector<ToDoItem> removes = new Vector<ToDoItem>();
+        List<ToDoItem> removes = new ArrayList<ToDoItem>();
         while (true) {
 
             // the validity checking thread should wait if disabled.
@@ -171,7 +176,7 @@
             }
 
             forceValidityCheck(removes);
-            removes.removeAllElements();
+            removes.clear();
             try {
 		Thread.sleep(3000);
 	    } catch (InterruptedException ignore) {
@@ -187,7 +192,7 @@
      * pressing a button via forceValidityCheck().
      */
     public void forceValidityCheck() {
-        Vector<ToDoItem> removes = new Vector<ToDoItem>();
+        List<ToDoItem> removes = new ArrayList<ToDoItem>();
         forceValidityCheck(removes);
     }
 
@@ -202,11 +207,8 @@
      *
      * @param removes the items removed
      */
-    protected synchronized void forceValidityCheck(Vector<ToDoItem> removes) {
-        //Enumeration cur = _items.elements();
-        int size = items.size();
-        for (int i = 0; i < size; ++i) {
-            ToDoItem item = items.elementAt(i);
+    protected synchronized void forceValidityCheck(List<ToDoItem> removes) {
+        for (ToDoItem item : items) {
             boolean valid;
             try {
 		valid = item.stillValid(designer);
@@ -220,13 +222,11 @@
             }
             if (!valid) {
                 numNotValid++;
-                removes.addElement(item);
+                removes.add(item);
             }
         }
-        //cur = removes.elements();
-        size = removes.size();
-        for (int i = 0; i < size; ++i) {
-            ToDoItem item = removes.elementAt(i);
+
+        for (ToDoItem item : removes) {
             removeE(item);
 //            History.TheHistory.addItemResolution(item, "no longer valid");
             //((ToDoItem)item).resolve("no longer valid");
@@ -280,10 +280,10 @@
      */
     public void notifyObservers(String action, Object arg) {
         setChanged();
-        Vector<Object> v = new Vector<Object>(2);
-        v.addElement(action);
-        v.addElement(arg);
-        super.notifyObservers(v);
+        List<Object> l = new ArrayList<Object>(2);
+        l.add(action);
+        l.add(arg);
+        super.notifyObservers(l);
     }
 
     /*
@@ -307,27 +307,42 @@
 
     /**
      * @return the todo items
+     * @deprecated for 0.25.4 by tfmorris
+     */
+    @Deprecated
+    public Vector<ToDoItem> getToDoItems() {
+        return new Vector<ToDoItem>(items);
+    }
+
+    /**
+     * @return the List of ToDo items.
      */
-    public Vector<ToDoItem> getToDoItems() { return items; }
+    public List<ToDoItem> getToDoItemList() {
+        return items;
+    }
 
     /**
      * @return the resolved items
      */
-    public Set<ResolvedCritic> getResolvedItems() { return resolvedItems; }
+    public Set<ResolvedCritic> getResolvedItems() {
+        return resolvedItems;
+    }
 
     /**
      * @return the set of offenders
+     * 
+     * TODO: The return value needs to be more strongly 
+     * typed. - tfm - 20070630
      */
     public ListSet getOffenders() {
-        // Extra care to be taken since _allOffenders can be reset while
+        // Extra care to be taken since allOffenders can be reset while
         // this method is running.
         ListSet all = allOffenders;
         if (all == null) {
             int size = items.size();
             all = new ListSet(size * 2);
-            for (int i = 0; i < size; i++) {
-                ToDoItem item = items.elementAt(i);
-                all.addAllElements(item.getOffenders());
+            for (ToDoItem item : items) {
+                all.addAll(item.getOffenders());
             }
             allOffenders = all;
         }
@@ -336,23 +351,21 @@
 
     private void addOffenders(ListSet newoffs) {
         if (allOffenders != null) {
-            allOffenders.addAllElements(newoffs);
+            allOffenders.addAll(newoffs);
 	}
     }
 
     /**
      * @return the set of all the posters
      */
-    public ListSet getPosters() {
-        // Extra care to be taken since _allPosters can be reset while
+    public ListSet<Poster> getPosters() {
+        // Extra care to be taken since allPosters can be reset while
         // this method is running.
-        ListSet all = allPosters;
+        ListSet<Poster> all = allPosters;
         if (all == null) {
-            int size = items.size();
-            all = new ListSet();
-            for (int i = 0; i < size; i++) {
-                ToDoItem item = items.elementAt(i);
-                all.addElement(item.getPoster());
+            all = new ListSet<Poster>();
+            for (ToDoItem item : items) {
+                all.add(item.getPoster());
             }
             allPosters = all;
         }
@@ -361,20 +374,42 @@
 
     private void addPosters(Poster newp) {
         if (allPosters != null) {
-            allPosters.addElement(newp);
+            allPosters.add(newp);
 	}
     }
 
     /**
      * @return the decisions
+     * @deprecated by tfmorris for 0.25.4.  Use {@link #getDecisionList()}.
      */
-    public static Vector getDecisions() { return new Vector(); }
+    @Deprecated
+    public static Vector getDecisions() {
+        return new Vector();
+    }
 
     /**
+     * @return the list of Decisions (empty by default).
+     */
+    public static List<Decision> getDecisionList() {
+        return new ArrayList<Decision>();
+    }
+    
+    /**
      * @return the goals
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getGoalList()}.
      */
-    public static Vector getGoals() { return new Vector(); }
+    @Deprecated
+    public static Vector getGoals() {
+        return new Vector();
+    }
 
+    /**
+     * @return The list of Goals (empty by default).
+     */
+    public static List<Goal> getGoalList() {
+        return new ArrayList<Goal>();
+    }
+    
     /*
      * TODO: needs documenting, why synchronized?
      */
@@ -403,7 +438,7 @@
             }
         }
 
-        items.addElement(item);
+        items.add(item);
         longestToDoList = Math.max(longestToDoList, items.size());
         addOffenders(item.getOffenders());
         addPosters(item.getPoster());
@@ -427,14 +462,12 @@
      * @param list the todo items to be removed
      */
     public void removeAll(ToDoList list) {
-        Enumeration<ToDoItem> cur = list.elements();
-        while (cur.hasMoreElements()) {
-            ToDoItem item = cur.nextElement();
+        for (ToDoItem item : list) {
             removeE(item);
         }
         recomputeAllOffenders();
         recomputeAllPosters();
-        fireToDoItemsRemoved(list.getToDoItems());
+        fireToDoItemsRemoved(list.getToDoItemList());
     }
 
     /**
@@ -443,7 +476,7 @@
      *          vector; <code>false</code> otherwise
      */
     private synchronized boolean removeE(ToDoItem item) {
-        boolean res = items.removeElement(item);
+        boolean res = items.remove(item);
         return res;
     }
 
@@ -520,7 +553,7 @@
      */
     public synchronized void removeAllElements() {
         LOG.debug("removing all todo items");
-        Vector<ToDoItem> oldItems = new Vector<ToDoItem>(items);
+        List<ToDoItem> oldItems = new ArrayList<ToDoItem>(items);
         for (ToDoItem tdi : oldItems) {
             removeE(tdi);
 	}
@@ -536,42 +569,66 @@
      * @return the todo tems for this offender
      */
     public Vector<ToDoItem> elementsForOffender(Object off) {
+        return new Vector<ToDoItem>(elementListForOffender(off));
+    }
+
+    /**
+     * @param off the offender
+     * @return the todo tems for this offender
+     */
+    public List<ToDoItem> elementListForOffender(Object off) {
         if (off == recentOffender) {
-	    return recentOffenderItems;
-	}
+            return recentOffenderItems;
+        }
         recentOffender = off;
-        recentOffenderItems.removeAllElements();
+        recentOffenderItems.clear();
         synchronized (items) {
-            for (int i = 0; i < items.size(); i++) {
-                ToDoItem item = items.elementAt(i);
+            for (ToDoItem item : items) {
                 if (item.getOffenders().contains(off)) {
-                    recentOffenderItems.addElement(item);
-		}
+                    recentOffenderItems.add(item);
+                }
             }
         }
         return recentOffenderItems;
     }
-
+    
     /**
      * @return the number of todo items
      */
-    public int size() { return items.size(); }
+    public int size() {
+        return items.size();
+    }
 
     /**
      * @return the todo items
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #iterator()}.
      */
+    @Deprecated
     public Enumeration<ToDoItem> elements() {
-        return items.elements();
+        return new Vector<ToDoItem>(items).elements();
     }
 
     /**
+     * @return an iterator for the ToDoItems
+     */
+    public Iterator<ToDoItem> iterator() {
+        return items.iterator();
+    }
+    
+    /**
      * @param index an index into the todo items list
      * @return the item at the index
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #get(int)}.
      */
+    @Deprecated
     public ToDoItem elementAt(int index) {
-        return items.elementAt(index);
+        return get(index);
     }
 
+    public ToDoItem get(int index) {
+        return items.get(index);
+    }
+    
     /**
      * Re-compute all offenders.
      */
@@ -641,8 +698,8 @@
             if (listeners[i] == ToDoListListener.class) {
                 // Lazily create the event:
                 if (e == null) {
-                    Vector<ToDoItem> its = new Vector<ToDoItem>();
-                    its.addElement(item);
+                    List<ToDoItem> its = new ArrayList<ToDoItem>();
+                    its.add(item);
                     e = new ToDoListEvent(its);
                 }
                 ((ToDoListListener) listeners[i + 1]).toDoItemsChanged(e);
@@ -654,15 +711,15 @@
      * @param item the todo item
      */
     protected void fireToDoItemAdded(ToDoItem item) {
-        Vector<ToDoItem> v = new Vector<ToDoItem>();
-        v.addElement(item);
-        fireToDoItemsAdded(v);
+        List<ToDoItem> l = new ArrayList<ToDoItem>();
+        l.add(item);
+        fireToDoItemsAdded(l);
     }
 
     /**
      * @param theItems the todo items
      */
-    protected void fireToDoItemsAdded(Vector<ToDoItem> theItems) {
+    protected void fireToDoItemsAdded(List<ToDoItem> theItems) {
         recentOffender = null;
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
@@ -684,15 +741,15 @@
      * @param item the todo item
      */
     protected void fireToDoItemRemoved(ToDoItem item) {
-        Vector<ToDoItem> v = new Vector<ToDoItem>();
-        v.addElement(item);
-        fireToDoItemsRemoved(v);
+        List<ToDoItem> l = new ArrayList<ToDoItem>();
+        l.add(item);
+        fireToDoItemsRemoved(l);
     }
 
     /**
      * @param theItems the todo items
      */
-    protected void fireToDoItemsRemoved(Vector<ToDoItem> theItems) {
+    protected void fireToDoItemsRemoved(List<ToDoItem> theItems) {
         recentOffender = null;
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
@@ -713,23 +770,16 @@
     ////////////////////////////////////////////////////////////////
     // internal methods
 
-    /*
-     * @see java.lang.Object#toString()
-     */
+
+    @Override
     public String toString() {
         StringBuffer res = new StringBuffer(100);
         res.append(getClass().getName()).append(" {\n");
-        Enumeration<ToDoItem> cur = elements();
-        while (cur.hasMoreElements()) {
-            ToDoItem item = cur.nextElement();
+        for (ToDoItem item : this) {
             res.append("    ").append(item.toString()).append("\n");
         }
         res.append("  }");
         return res.toString();
     }
 
-    /**
-     * The UID.
-     */
-    // private static final long serialVersionUID = -1288801672594900893L;
-} /* end class ToDoList */
+}

Modified: trunk/src_new/org/argouml/cognitive/ToDoListEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ToDoListEvent.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ToDoListEvent.java&p2=trunk/src_new/org/argouml/cognitive/ToDoListEvent.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ToDoListEvent.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ToDoListEvent.java	2007-07-01 01:10:04-0700
@@ -25,6 +25,7 @@
 
 package org.argouml.cognitive;
 
+import java.util.List;
 import java.util.Vector;
 
 /**
@@ -33,23 +34,48 @@
  */
 public class ToDoListEvent {
 
-    private Vector<ToDoItem> items;
+    private List<ToDoItem> items;
 
     /**
      * The constructor.
      *
      */
-    public ToDoListEvent() { items = null; }
+    public ToDoListEvent() {
+        items = null;
+    }
+    
     /**
      * The constructor.
      *
      * @param i the Vector of ToDoItems that were changed/added/removed 
      */
-    public ToDoListEvent(Vector<ToDoItem> i) { items = i; }
+    public ToDoListEvent(Vector<ToDoItem> i) {
+        items = i;
+    }
 
     /**
+     * The constructor.
+     *
+     * @param i the Vector of ToDoItems that were changed/added/removed 
+     */
+    public ToDoListEvent(List<ToDoItem> i) {
+        items = i;
+    }
+    
+    /**
      * @return the todo list events
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getToDoItemList()}.
      */
-    public Vector<ToDoItem> getToDoItems() { return items; }
+    @Deprecated
+    public Vector<ToDoItem> getToDoItems() {
+        return new Vector<ToDoItem>(items);
+    }
 
-} /* end class ToDoListEvent */
+    /**
+     * @return the todo list events
+     */
+    public List<ToDoItem> getToDoItemList() {
+        return items;
+    }
+    
+}

Modified: trunk/src_new/org/argouml/cognitive/ToDoListListener.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ToDoListListener.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ToDoListListener.java&p2=trunk/src_new/org/argouml/cognitive/ToDoListListener.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ToDoListListener.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ToDoListListener.java	2007-07-01 01:10:04-0700
@@ -52,4 +52,5 @@
      * @param tde the todo list event
      */
     void toDoItemsRemoved(ToDoListEvent tde);
-} /* end interface ToDoListListener */
+    
+}

Modified: trunk/src_new/org/argouml/cognitive/checklist/Checklist.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/checklist/Checklist.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/checklist/Checklist.java&p2=trunk/src_new/org/argouml/cognitive/checklist/Checklist.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/checklist/Checklist.java	(original)
+++ trunk/src_new/org/argouml/cognitive/checklist/Checklist.java	2007-07-01 01:10:04-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -25,7 +25,9 @@
 package org.argouml.cognitive.checklist;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Vector;
 
 /**
@@ -39,15 +41,8 @@
  *
  * @author Jason Robbins
  */
-public class Checklist implements Serializable {
-
-    ////////////////////////////////////////////////////////////////
-    // instance variables
-
-    /**
-     * Pending CheckItems for the designer to consider.
-     */
-    private Vector items = new Vector();
+public class Checklist extends ArrayList<CheckItem> implements List<CheckItem>,
+        Serializable {
 
     private String nextCategory = "General";
 
@@ -55,36 +50,50 @@
      * The constructor.
      *
      */
-    public Checklist() { }
+    public Checklist() {
+        super();
+    }
 
-    ////////////////////////////////////////////////////////////////
-    // accessors
+    /**
+     * @return the items
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getCheckItemList()}.
+     */
+    @Deprecated
+    public Vector<CheckItem> getCheckItems() {
+        return new Vector<CheckItem>(this);
+    }
 
     /**
      * @return the items
      */
-    public Vector getCheckItems() { return items; }
+    public List<CheckItem> getCheckItemList() {
+        return this;
+    }
 
+    
     /**
      * @param item the item to be added to the list
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #add(CheckItem)}.
      */
+    @Deprecated
     public void addItem(CheckItem item) {
-	items.addElement(item);
+	add(item);
     }
 
     /**
      * @param item the item to be removed
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #remove(CheckItem)}.
      */
+    @Deprecated
     public void removeItem(CheckItem item) {
-	items.removeElement(item);
+	remove(item);
     }
 
     /**
      * @param description the description for a new item
      */
     public void addItem(String description) {
-	CheckItem item = new CheckItem(nextCategory, description);
-	items.addElement(item);
+	add(new CheckItem(nextCategory, description));
     }
 
     /**
@@ -93,51 +102,52 @@
      * @param list the given new list
      */
     public synchronized void addAll(Checklist list) {
-	Enumeration cur = list.elements();
-	while (cur.hasMoreElements()) {
-	    CheckItem item = (CheckItem) cur.nextElement();
-	    addItem(item);
+        for (CheckItem item : list) {
+	    add(item);
 	}
     }
 
     /**
      * @return the list in enumeration format
+     * @deprecated for 0.25.4 by tfmorris.
      */
-    public Enumeration elements() { return items.elements(); }
+    @Deprecated
+    public Enumeration<CheckItem> elements() {
+        return new Vector<CheckItem>(this).elements();
+    }
 
-    /**
-     * @return the number of items in the list
-     */
-    public int size() { return items.size(); }
 
     /**
      * @param index the position of the item to retrieve
      * @return the item
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #get(int)}. 
      */
+    @Deprecated
     public CheckItem elementAt(int index) {
-	return (CheckItem) items.elementAt(index);
+	return get(index);
     }
 
     /**
      * @param cat the category
      */
-    public void setNextCategory(String cat) { nextCategory = cat; }
+    public void setNextCategory(String cat) {
+        nextCategory = cat;
+    }
 
 
     /*
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
 	String res;
 	res = getClass().getName() + " {\n";
-	Enumeration cur = elements();
-	while (cur.hasMoreElements()) {
-	    CheckItem item = (CheckItem) cur.nextElement();
+        for (CheckItem item : this) {
 	    res += "    " + item.toString() + "\n";
 	}
 	res += "  }";
 	return res;
     }
 
-} /* end class Checklist */
+}
 

Modified: trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java&p2=trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java	(original)
+++ trunk/src_new/org/argouml/cognitive/checklist/ChecklistStatus.java	2007-07-01 01:10:04-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,101 +24,53 @@
 
 package org.argouml.cognitive.checklist;
 
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.Vector;
 
 /**
  * A list of CheckItems that the designer has marked off as already
  * considered.  In the ArgoUML system, this determines which items
  * in the TabChecklist have checkmarks.
+ * <p>
+ * The only difference between this class and its superclass is that
+ * adds are counted (but there is no access to the counter, so it apparently
+ * is only for debugging purposes).
  *
  * @see org.argouml.cognitive.checklist.ui.TabChecklist
  * @author Jason Robbins
  */
-public class ChecklistStatus implements Serializable {
-    private static int numChecks = 0;
-    ////////////////////////////////////////////////////////////////
-    // instance variables
+public class ChecklistStatus extends Checklist {
 
-    /** CheckItems that the designer has marked off as already considered. */
-    private Vector items = new Vector();
+    private static int numChecks = 0;
 
     /**
      * The constructor.
      *
      */
-    public ChecklistStatus() { }
-
-    ////////////////////////////////////////////////////////////////
-    // accessors
-
-    /**
-     * @return the checked items
-     */
-    public Vector getCheckItems() { return items; }
+    public ChecklistStatus() { 
+        super();
+    }
 
+    
     /**
      * @param item the item to be checkmarked
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #add(CheckItem)}.
      */
+    @SuppressWarnings("deprecation")
+    @Deprecated
     public void addItem(CheckItem item) {
-	items.addElement(item);
-	numChecks++;
-    }
-
-    /**
-     * @param list set the list of checkmarked items
-     */
-    public synchronized void addAll(ChecklistStatus list) {
-	Enumeration cur = list.elements();
-	while (cur.hasMoreElements()) {
-	    CheckItem item = (CheckItem) cur.nextElement();
-	    addItem(item);
-	}
-    }
-
-    /**
-     * @param item the item for which to remove a checkmark
-     */
-    public void removeItem(CheckItem item) {
-	items.removeElement(item);
+        add(item);
     }
 
     /**
-     * @return the items in Enumeration format
-     */
-    public Enumeration elements() { return items.elements(); }
-
-    /**
-     * @param index an index into this vector
-     * @return the element
-     */
-    public CheckItem elementAt(int index) {
-	return (CheckItem) items.elementAt(index);
-    }
-
-    /**
-     * @param item the item
-     * @return true if the given item is contained in the list
-     */
-    public boolean contains(CheckItem item) {
-	return items.contains(item);
-    }
-
-    /*
-     * @see java.lang.Object#toString()
+     * @param item the item to be checkmarked
+     * @return true
      */
-    public String toString() {
-	String res;
-	res = getClass().getName() + " {\n";
-	Enumeration cur = elements();
-	while (cur.hasMoreElements()) {
-	    CheckItem item = (CheckItem) cur.nextElement();
-	    res += "    " + item.toString() + "\n";
-	}
-	res += "  }";
-	return res;
+    @Override
+    public boolean add(CheckItem item) {
+        super.add(item);
+        numChecks++;
+        return true;
     }
+    
 
-} /* end class ChecklistStatus */
+} 
 

Modified: trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java&p2=trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java	(original)
+++ trunk/src_new/org/argouml/cognitive/checklist/ui/TabChecklist.java	2007-07-01 01:10:04-0700
@@ -339,6 +339,7 @@
     /*
      * @see javax.swing.table.TableModel#getColumnName(int)
      */
+    @Override
     public String  getColumnName(int c) {
 	if (c == 0) {
 	    return "X";
@@ -365,6 +366,7 @@
     /*
      * @see javax.swing.table.TableModel#isCellEditable(int, int)
      */
+    @Override
     public boolean isCellEditable(int row, int col) {
 	return col == 0;
     }
@@ -391,7 +393,7 @@
 	if (cl == null) {
 	    return "no checklist";
 	}
-	CheckItem ci = cl.elementAt(row);
+	CheckItem ci = cl.get(row);
 	if (col == 0) {
 	    ChecklistStatus stat = CheckManager.getStatusFor(target);
 	    return (stat.contains(ci)) ? Boolean.TRUE : Boolean.FALSE;
@@ -405,6 +407,7 @@
     /*
      * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
      */
+    @Override
     public void setValueAt(Object aValue, int rowIndex, int columnIndex)  {
 	LOG.debug("setting table value " + rowIndex + ", " + columnIndex);
 	if (columnIndex != 0) {
@@ -418,13 +421,13 @@
 	if (cl == null) {
 	    return;
 	}
-	CheckItem ci = cl.elementAt(rowIndex);
+	CheckItem ci = cl.get(rowIndex);
 	if (columnIndex == 0) {
 	    ChecklistStatus stat = CheckManager.getStatusFor(target);
 	    if (val) {
-	        stat.addItem(ci);
+	        stat.add(ci);
 	    } else {
-	        stat.removeItem(ci);
+	        stat.remove(ci);
 	    }
 	}
     }
@@ -451,4 +454,4 @@
         fireTableStructureChanged();
         panel.resizeColumns();
     }
-} /* end class TableModelChecklist */
+} 

Modified: trunk/src_new/org/argouml/cognitive/critics/Wizard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/critics/Wizard.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/critics/Wizard.java&p2=trunk/src_new/org/argouml/cognitive/critics/Wizard.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/critics/Wizard.java	(original)
+++ trunk/src_new/org/argouml/cognitive/critics/Wizard.java	2007-07-01 01:10:04-0700
@@ -24,7 +24,8 @@
 
 package org.argouml.cognitive.critics;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.JPanel;
 
@@ -54,11 +55,8 @@
  */
 public abstract class Wizard implements java.io.Serializable {
 
-    ////////////////////////////////////////////////////////////////
-    // instance variables
-
     /** User interface panels displayed so far. */
-    private Vector panels = new Vector();
+    private List<JPanel> panels = new ArrayList<JPanel>();
 
     /** The current step that the Wizard is on.  Zero indicates that the
      *  wizard has not yet begun. */
@@ -70,14 +68,9 @@
 
     private WizardItem item = null;
 
-    ////////////////////////////////////////////////////////////////
-    // constructors
-
     /** Construct a new wizard to help the user repair a design flaw. */
-    public Wizard() { }
-
-    ////////////////////////////////////////////////////////////////
-    // accessors
+    public Wizard() {
+    }
 
     /**
      * @param s the step number of the panel to be removed
@@ -98,14 +91,18 @@
     /**
      * @return the todoitem
      */
-    public WizardItem getToDoItem() { return item; }
+    public WizardItem getToDoItem() {
+        return item;
+    }
 
     /** An integer between 0 and 100, shows percent done. The current
      *  ArgoUML user interface shows different PostIt note icons for
      *  0, 1-25, 26-50. 51-75, and 76-100.
      *  @return the percentage done.
      */
-    public int getProgress() { return step * 100 / getNumSteps(); }
+    public int getProgress() {
+        return step * 100 / getNumSteps();
+    }
 
     /** Get the number of steps in this wizard.  Subclasses should
      *  override to return a constant, or compute based on context.
@@ -120,7 +117,9 @@
      *  then returns his or her attention to the wizard.
      *  @return the panel that should be displayed now.
      */
-    public JPanel getCurrentPanel() { return getPanel(step); }
+    public JPanel getCurrentPanel() {
+        return getPanel(step);
+    }
 
 
     /** Get the exising panel at step s. Step 1 is the first wizard
@@ -129,8 +128,9 @@
      * @return the panel for step s or null if none.
      */
     public JPanel getPanel(int s) {
-	if (s > 0 && s <= panels.size())
-	    return (JPanel) panels.elementAt(s - 1);
+	if (s > 0 && s <= panels.size()) {
+	    return panels.get(s - 1);
+        }
 	return null;
     }
 
@@ -142,7 +142,9 @@
      *  and then check for legal context values.
      *  @return <code>true</code> iff the "Next&gt;" button should be enabled.
      */
-    public boolean canGoNext() { return step < getNumSteps(); }
+    public boolean canGoNext() {
+        return step < getNumSteps();
+    }
 
     /**
      * The next step of the wizard.
@@ -151,15 +153,21 @@
 	doAction(step);
 	step++;
 	JPanel p = makePanel(step);
-	if (p != null) panels.addElement(p);
+	if (p != null) {
+            panels.add(p);
+        }
 	started = true;
-	if (item != null) item.changed();
+	if (item != null) {
+            item.changed();
+        }
     }
 
     /**
      * @return true if we can step back
      */
-    public boolean canGoBack() { return step > 0; }
+    public boolean canGoBack() {
+        return step > 0;
+    }
 
     /**
      * Step back.
@@ -174,17 +182,23 @@
     /**
      * @return true if we can finish (i.e. the finish button is not downlighted)
      */
-    public boolean canFinish() { return true; }
+    public boolean canFinish() {
+        return true;
+    }
 
     /**
      * @return true if the wizard is started
      */
-    public boolean isStarted() { return started; }
+    public boolean isStarted() {
+        return started;
+    }
 
     /**
      * @return true if the wizard is finished
      */
-    public boolean isFinished() { return finished; }
+    public boolean isFinished() {
+        return finished;
+    }
 
     /**
      * Finish the wizard.
@@ -240,7 +254,8 @@
      *
      * @param oldStep the given step
      */
-    public void undoAction(int oldStep) { }
+    public void undoAction(int oldStep) {
+    }
 
     /**
      * Undo the action.
@@ -253,4 +268,4 @@
     protected int getStep() {
         return step;
     }
-} /* end class Wizard */
+}

Modified: trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java&p2=trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java	(original)
+++ trunk/src_new/org/argouml/cognitive/critics/ui/CriticBrowserDialog.java	2007-07-01 01:10:04-0700
@@ -159,7 +159,7 @@
 
     private Critic target;
 
-    private List   critics;
+    private List<Critic>   critics;
 
     /**
      * The constructor.
@@ -174,11 +174,10 @@
 	// Critics Table
 	JPanel tablePanel = new JPanel(new BorderLayout(5, 5));
 
-	critics = new ArrayList(Agency.getCritics());
-	Collections.sort(critics, new Comparator() {
-	    public int compare(Object o1, Object o2) {
-		return ((Critic) o1).getHeadline().compareTo(((Critic) o2)
-		                                            .getHeadline());
+	critics = new ArrayList<Critic>(Agency.getCriticList());
+	Collections.sort(critics, new Comparator<Critic>() {
+	    public int compare(Critic o1, Critic o2) {
+		return o1.getHeadline().compareTo(o2.getHeadline());
 	    }
 	});
 	tableModel.setTarget(critics);
@@ -579,9 +578,15 @@
      * @see javax.swing.table.TableModel#getColumnClass(int)
      */
     public Class getColumnClass(int c) {
-	if (c == 0) return Boolean.class;
-	if (c == 1) return String.class;
-	if (c == 2) return String.class;
+	if (c == 0) {
+            return Boolean.class;
+        }
+	if (c == 1) {
+            return String.class;
+        }
+	if (c == 2) {
+            return String.class;
+        }
 	return String.class;
     }
 

Modified: trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java&p2=trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/AddToDoItemDialog.java	2007-07-01 01:10:04-0700
@@ -144,12 +144,11 @@
         setContent(panel);
     }
 
-    ////////////////////////////////////////////////////////////////
-    // event handlers
 
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
         super.actionPerformed(e);
         if (e.getSource() == getOkButton()) {
@@ -178,11 +177,11 @@
 	    new UMLToDoItem(designer, headline, priority, desc, moreInfoURL);
         ListSet newOffenders = new ListSet();
         for (int i = 0; i < offenderList.getModel().getSize(); i++) {
-            newOffenders.addElement(offenderList.getModel().getElementAt(i));
+            newOffenders.add(offenderList.getModel().getElementAt(i));
         }
         item.setOffenders(newOffenders);
         designer.getToDoList().addElement(item); //? inform()
         Designer.firePropertyChange(Designer.MODEL_TODOITEM_ADDED, null, item);
     }
-} /* end class AddToDoItemDialog */
+}
 

Modified: trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java&p2=trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/DesignIssuesDialog.java	2007-07-01 01:10:04-0700
@@ -27,9 +27,8 @@
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
-import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Vector;
+import java.util.List;
 
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
@@ -58,8 +57,10 @@
     ////////////////////////////////////////////////////////////////
     // instance variables
     private JPanel  mainPanel = new JPanel();
-    private Hashtable slidersToDecisions = new Hashtable();
-    private Hashtable slidersToDigits = new Hashtable();
+    private Hashtable<JSlider, Decision> slidersToDecisions = 
+        new Hashtable<JSlider, Decision>();
+    private Hashtable<JSlider, JLabel> slidersToDigits = 
+        new Hashtable<JSlider, JLabel>();
 
     ////////////////////////////////////////////////////////////////
     // constructors
@@ -84,7 +85,7 @@
 
     private void initMainPanel() {
         DecisionModel dm = Designer.theDesigner().getDecisionModel();
-        Vector decs = dm.getDecisions();
+        List<Decision> decs = dm.getDecisionList();
 
         GridBagLayout gb = new GridBagLayout();
         mainPanel.setLayout(gb);
@@ -143,9 +144,7 @@
 
 
         c.gridy = 2;
-        Enumeration elems = decs.elements();
-        while (elems.hasMoreElements()) {
-            Decision d = (Decision) elems.nextElement();
+        for (Decision d : decs) {
             JLabel decLabel = new JLabel(d.getName());
             JLabel valueLabel = new JLabel(getValueText(d.getPriority()));
             JSlider decSlide =
@@ -199,8 +198,8 @@
      */
     public void stateChanged(ChangeEvent ce) {
         JSlider srcSlider = (JSlider) ce.getSource();
-        Decision d = (Decision) slidersToDecisions.get(srcSlider);
-        JLabel valLab = (JLabel) slidersToDigits.get(srcSlider);
+        Decision d = slidersToDecisions.get(srcSlider);
+        JLabel valLab = slidersToDigits.get(srcSlider);
         int pri = srcSlider.getValue();
         d.setPriority((pri == 4) ? 0 : pri);
         valLab.setText(getValueText(pri));
@@ -226,7 +225,7 @@
         return label;
     }
 
-} /* end class DesignIssuesDialog */
+}
 
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToDecisionsToItems.java	2007-07-01 01:10:04-0700
@@ -24,10 +24,13 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
+
 import javax.swing.event.TreeModelListener;
 import javax.swing.tree.TreePath;
+
 import org.argouml.cognitive.Decision;
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ToDoItem;
@@ -49,14 +52,11 @@
      */
     public Object getChild(Object parent, int index) {
 	if (parent instanceof ToDoList) {
-	    return getDecisions().elementAt(index);
+	    return getDecisionList().get(index);
 	}
 	if (parent instanceof Decision) {
 	    Decision dec = (Decision) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
 		if (item.getPoster().supports(dec)) {
 		    if (index == 0) return item;
 		    index--;
@@ -70,15 +70,12 @@
 
     private int getChildCountCond(Object parent, boolean stopafterone) {
 	if (parent instanceof ToDoList) {
-	    return getDecisions().size();
+	    return getDecisionList().size();
 	}
 	if (parent instanceof Decision) {
 	    Decision dec = (Decision) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    int count = 0;
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
+            int count = 0;
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
 		if (item.getPoster().supports(dec)) count++;
 		if (stopafterone && count > 0) break;
 	    }
@@ -109,18 +106,17 @@
      */
     public int getIndexOfChild(Object parent, Object child) {
 	if (parent instanceof ToDoList) {
-	    return getDecisions().indexOf(child);
+	    return getDecisionList().indexOf(child);
 	}
 	if (parent instanceof Decision) {
 	    // instead of makning a new vector, decrement index, return when
 	    // found and index == 0
-	    Vector candidates = new Vector();
+	    List<ToDoItem> candidates = new ArrayList<ToDoItem>();
 	    Decision dec = (Decision) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
-		if (item.getPoster().supports(dec)) candidates.addElement(item);
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+		if (item.getPoster().supports(dec)) {
+                    candidates.add(item);
+                }
 	    }
 	    return candidates.indexOf(child);
 	}
@@ -131,8 +127,12 @@
      * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
      */
     public boolean isLeaf(Object node) {
-	if (node instanceof ToDoList) return false;
-	if (node instanceof Decision && hasChildren(node)) return false;
+	if (node instanceof ToDoList) {
+            return false;
+        }
+	if (node instanceof Decision && hasChildren(node)) {
+            return false;
+        }
 	return true;
     }
 
@@ -157,12 +157,20 @@
 
     /**
      * @return the decisions
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getDecisionList()}.
      */
-    public Vector getDecisions() {
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    public Vector<Decision> getDecisions() {
 	return Designer.theDesigner().getDecisionModel().getDecisions();
     }
 
+    /**
+     * @return the decisions
+     */    
+    public List<Decision> getDecisionList() {
+        return Designer.theDesigner().getDecisionModel().getDecisionList();
+    }
 
 
-
-} /* end class GoListToDecisionsToItems */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToGoalsToItems.java	2007-07-01 01:10:04-0700
@@ -24,7 +24,8 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.event.TreeModelListener;
@@ -51,14 +52,11 @@
      */
     public Object getChild(Object parent, int index) {
 	if (parent instanceof ToDoList) {
-	    return getGoals().elementAt(index);
+	    return getGoalList().get(index);
 	}
 	if (parent instanceof Goal) {
 	    Goal g = (Goal) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
 		if (item.getPoster().supports(g)) {
 		    if (index == 0) return item;
 		    index--;
@@ -74,15 +72,12 @@
      */
     public int getChildCount(Object parent) {
 	if (parent instanceof ToDoList) {
-	    return getGoals().size();
+	    return getGoalList().size();
 	}
 	if (parent instanceof Goal) {
 	    Goal g = (Goal) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
 	    int count = 0;
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
 		if (item.getPoster().supports(g)) count++;
 	    }
 	    return count;
@@ -96,18 +91,17 @@
      */
     public int getIndexOfChild(Object parent, Object child) {
 	if (parent instanceof ToDoList) {
-	    return getGoals().indexOf(child);
+	    return getGoalList().indexOf(child);
 	}
 	if (parent instanceof Goal) {
 	    // instead of makning a new vector, decrement index, return when
 	    // found and index == 0
-	    Vector candidates = new Vector();
+	    List<ToDoItem> candidates = new ArrayList<ToDoItem>();
 	    Goal g = (Goal) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
-		if (item.getPoster().supports(g)) candidates.addElement(item);
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+		if (item.getPoster().supports(g)) {
+                    candidates.add(item);
+                }
 	    }
 	    return candidates.indexOf(child);
 	}
@@ -140,15 +134,21 @@
     public void removeTreeModelListener(TreeModelListener l) { }
 
 
-
-    ////////////////////////////////////////////////////////////////
-    // utility methods
-
     /**
      * @return the goals
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getGoalList()}.
      */
-    public Vector getGoals() {
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    public Vector<Goal> getGoals() {
 	return Designer.theDesigner().getGoalModel().getGoals();
     }
 
-} /* end class GoListToGoalsToItems */
+    /**
+     * @return the goals
+     */
+    public List<Goal> getGoalList() {
+        return Designer.theDesigner().getGoalModel().getGoalList();
+    }
+    
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToOffenderToItem.java	2007-07-01 01:10:04-0700
@@ -24,16 +24,18 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.event.TreeModelListener;
 import javax.swing.tree.TreePath;
 
 import org.argouml.cognitive.Designer;
+import org.argouml.cognitive.ListSet;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.ToDoList;
-import org.argouml.cognitive.ListSet;
 import org.argouml.uml.PredicateNotInTrash;
 
 
@@ -57,16 +59,14 @@
      * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
      */
     public Object getChild(Object parent, int index) {
-	Vector children = getChildren(parent);
-	return (children == null) ? null : children.elementAt(index);
+	return getChildrenList(parent).get(index);
     }
 
     /*
      * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
      */
     public int getChildCount(Object parent) {
-	Vector children = getChildren(parent);
-	return (children == null) ? 0 : children.size();
+	return getChildrenList(parent).size();
     }
 
     /*
@@ -74,8 +74,7 @@
      * java.lang.Object, java.lang.Object)
      */
     public int getIndexOfChild(Object parent, Object child) {
-	Vector children = getChildren(parent);
-	return (children == null) ? -1 : children.indexOf(child);
+	return getChildrenList(parent).indexOf(child);
     }
 
     /*
@@ -91,49 +90,69 @@
     /**
      * @param parent the parent object to check for offspring
      * @return the children
+     * @deprecated for 0.25.4 by tfmorris.  Use 
+     * {@link #getChildrenList(Object)}.
      */
-    public Vector getChildren(Object parent) {
-        ListSet allOffenders = new ListSet();
-        allOffenders.addAllElementsSuchThat(Designer.theDesigner()
-            .getToDoList().getOffenders(),
-            getListPredicate());
-
-
-	if (parent instanceof ToDoList) {
-	    return allOffenders.asVector();
-	}
-	//otherwise parent must be an offending design material
-	if (allOffenders.contains(parent)) {
-	    Vector res = new Vector();
-	    ToDoList list = Designer.theDesigner().getToDoList();
-	    Enumeration elems = list.elements();
-	    while (elems.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) elems.nextElement();
-		ListSet offs = new ListSet();
+    @Deprecated
+    public Vector<ToDoItem> getChildren(Object parent) {
+        List<ToDoItem> result = getChildrenList(parent);
+        if (result.size() == 0) {
+            return null;
+        }
+        return new Vector<ToDoItem>(result);
+    }
+
+    /**
+     * Get a list of children.
+     * 
+     * @param parent
+     *            the parent object to check
+     * @return a list of children for the given object
+     */
+    public List<ToDoItem> getChildrenList(Object parent) {
+        ListSet<ToDoItem> allOffenders = new ListSet<ToDoItem>();
+        allOffenders.addAllElementsSuchThat(
+                Designer.theDesigner().getToDoList().getOffenders(), 
+                getListPredicate());
+
+        if (parent instanceof ToDoList) {
+            return allOffenders;
+        }
+        
+        //otherwise parent must be an offending design material
+        if (allOffenders.contains(parent)) {
+            List<ToDoItem> result = new ArrayList<ToDoItem>();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+                ListSet offs = new ListSet();
                 offs.addAllElementsSuchThat(item.getOffenders(),
                     getListPredicate());
-		if (offs.contains(parent)) res.addElement(item);
-	    }
-	    return res;
-	}
-	return null;
+                if (offs.contains(parent)) {
+                    result.add(item);
+                }
+            }
+            return result;
+        }
+        return Collections.EMPTY_LIST;
     }
-
+    
     /*
      * @see javax.swing.tree.TreeModel#valueForPathChanged(
      * javax.swing.tree.TreePath, java.lang.Object)
      */
-    public void valueForPathChanged(TreePath path, Object newValue) { }
+    public void valueForPathChanged(TreePath path, Object newValue) {
+    }
 
     /*
      * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
      */
-    public void addTreeModelListener(TreeModelListener l) { }
+    public void addTreeModelListener(TreeModelListener l) {
+    }
 
     /*
      * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
      */
-    public void removeTreeModelListener(TreeModelListener l) { }
+    public void removeTreeModelListener(TreeModelListener l) {
+    }
 
 
-} /* end class GoListToOffenderToItem */
+} 

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToPosterToItem.java	2007-07-01 01:10:04-0700
@@ -24,17 +24,19 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.event.TreeModelListener;
 import javax.swing.tree.TreePath;
 
 import org.argouml.cognitive.Designer;
+import org.argouml.cognitive.ListSet;
 import org.argouml.cognitive.Poster;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.ToDoList;
-import org.argouml.cognitive.ListSet;
 
 
 
@@ -51,16 +53,14 @@
      * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
      */
     public Object getChild(Object parent, int index) {
-	Vector children = getChildren(parent);
-	return (children == null) ? null : children.elementAt(index);
+	return getChildrenList(parent).get(index);
     }
 
     /*
      * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
      */
     public int getChildCount(Object parent) {
-	Vector children = getChildren(parent);
-	return (children == null) ? 0 : children.size();
+        return getChildrenList(parent).size();
     }
 
     /*
@@ -68,8 +68,7 @@
      * java.lang.Object, java.lang.Object)
      */
     public int getIndexOfChild(Object parent, Object child) {
-	Vector children = getChildren(parent);
-	return (children == null) ? -1 : children.indexOf(child);
+        return getChildrenList(parent).indexOf(child);
     }
 
     /*
@@ -85,43 +84,59 @@
     /**
      * @param parent the parent object to check for offspring
      * @return the children
+     * @deprecated for 0.25.4 by tfmorris. Use 
+     * {@link #getChildrenList(Object)}.
      */
+    @Deprecated
     public Vector getChildren(Object parent) {
-	ListSet allPosters =
-	    Designer.theDesigner().getToDoList().getPosters();
-	if (parent instanceof ToDoList) {
-	    return allPosters.asVector();
-	}
-	//otherwise parent must be an offending design material
-	if (allPosters.contains(parent)) {
-	    Vector res = new Vector();
-	    ToDoList list = Designer.theDesigner().getToDoList();
-	    Enumeration elems = list.elements();
-	    while (elems.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) elems.nextElement();
-		Poster post = item.getPoster();
-		if (post == parent) res.addElement(item);
-	    }
-	    return res;
-	}
-	return null;
+        List result = getChildrenList(parent);
+        if (result.size() == 0) {
+            return null;
+        }
+        return new Vector(result);
+    }
+    
+    /**
+     * @param parent the parent object to check for offspring
+     * @return the children
+     */
+    public List getChildrenList(Object parent) {
+        ListSet allPosters =
+            Designer.theDesigner().getToDoList().getPosters();
+        if (parent instanceof ToDoList) {
+            return allPosters;
+        }
+        //otherwise parent must be an offending design material
+        if (allPosters.contains(parent)) {
+            List<ToDoItem> result = new ArrayList<ToDoItem>();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+                Poster post = item.getPoster();
+                if (post == parent) {
+                    result.add(item);
+                }
+            }
+            return result;
+        }
+        return Collections.EMPTY_LIST;
     }
 
     /*
      * @see javax.swing.tree.TreeModel#valueForPathChanged(
      * javax.swing.tree.TreePath, java.lang.Object)
      */
-    public void valueForPathChanged(TreePath path, Object newValue) { }
+    public void valueForPathChanged(TreePath path, Object newValue) {
+    }
 
     /*
      * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
      */
-    public void addTreeModelListener(TreeModelListener l) { }
+    public void addTreeModelListener(TreeModelListener l) {
+    }
 
     /*
      * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
      */
-    public void removeTreeModelListener(TreeModelListener l) { }
-
+    public void removeTreeModelListener(TreeModelListener l) {
+    }
 
-} /* end class GoListToPosterToItem */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToPriorityToItem.java	2007-07-01 01:10:04-0700
@@ -45,16 +45,15 @@
      */
     public Object getChild(Object parent, int index) {
 	if (parent instanceof ToDoList) {
-	    return PriorityNode.getPriorities().elementAt(index);
+	    return PriorityNode.getPriorityList().get(index);
 	}
 	if (parent instanceof PriorityNode) {
 	    PriorityNode pn = (PriorityNode) parent;
-	    ToDoList list = Designer.theDesigner().getToDoList();
-	    int size = list.size();
-	    for (int i = 0; i < size; i++) {
-		ToDoItem item = list.elementAt(i);
+            for (ToDoItem item :  Designer.theDesigner().getToDoList()) {
 		if (item.getPriority() == pn.getPriority()) {
-		    if (index == 0) return item;
+		    if (index == 0) {
+                        return item;
+                    }
 		    index--;
 		}
 	    }
@@ -68,16 +67,15 @@
      */
     public int getChildCount(Object parent) {
 	if (parent instanceof ToDoList) {
-	    return PriorityNode.getPriorities().size();
+	    return PriorityNode.getPriorityList().size();
 	}
 	if (parent instanceof PriorityNode) {
 	    int res = 0;
 	    PriorityNode pn = (PriorityNode) parent;
-	    ToDoList list = Designer.theDesigner().getToDoList();
-	    int size = list.size();
-	    for (int i = 0; i < size; i++) {
-		ToDoItem item = list.elementAt(i);
-		if (item.getPriority() == pn.getPriority()) res++;
+            for (ToDoItem item :  Designer.theDesigner().getToDoList()) {
+		if (item.getPriority() == pn.getPriority()) {
+                    res++;
+                }
 	    }
 	    return res;
 	}
@@ -90,17 +88,16 @@
      */
     public int getIndexOfChild(Object parent, Object child) {
 	if (parent instanceof ToDoList) {
-	    return PriorityNode.getPriorities().indexOf(child);
+	    return PriorityNode.getPriorityList().indexOf(child);
 	}
 	if (parent instanceof PriorityNode) {
 	    int index = 0;
 	    PriorityNode pn = (PriorityNode) parent;
-	    ToDoList list = Designer.theDesigner().getToDoList();
-	    int size = list.size();
-	    for (int i = 0; i < size; i++) {
-		ToDoItem item = list.elementAt(i);
+            for (ToDoItem item :  Designer.theDesigner().getToDoList()) {
 		if (item.getPriority() == pn.getPriority()) {
-		    if (item == child) return index;
+		    if (item == child) {
+                        return index;
+                    }
 		    index++;
 		}
 	    }
@@ -134,4 +131,4 @@
      */
     public void removeTreeModelListener(TreeModelListener l) { }
 
-} /* end class GoListToPriorityToItem */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoListToTypeToItem.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,8 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.event.TreeModelListener;
 import javax.swing.tree.TreePath;
@@ -50,14 +50,11 @@
      */
     public Object getChild(Object parent, int index) {
 	if (parent instanceof ToDoList) {
-	    return KnowledgeTypeNode.getTypes().elementAt(index);
+	    return KnowledgeTypeNode.getTypeList().get(index);
 	}
 	if (parent instanceof KnowledgeTypeNode) {
 	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
 		if (item.containsKnowledgeType(ktn.getName())) {
 		    if (index == 0) return item;
 		    index--;
@@ -73,17 +70,15 @@
      */
     public int getChildCount(Object parent) {
 	if (parent instanceof ToDoList) {
-	    return KnowledgeTypeNode.getTypes().size();
+	    return KnowledgeTypeNode.getTypeList().size();
 	}
 	if (parent instanceof KnowledgeTypeNode) {
 	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
 	    int count = 0;
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
-		if (item.containsKnowledgeType(ktn.getName()))
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+		if (item.containsKnowledgeType(ktn.getName())) {
 		    count++;
+                }
 	    }
 	    return count;
 	}
@@ -96,19 +91,17 @@
      */
     public int getIndexOfChild(Object parent, Object child) {
 	if (parent instanceof ToDoList) {
-	    return KnowledgeTypeNode.getTypes().indexOf(child);
+	    return KnowledgeTypeNode.getTypeList().indexOf(child);
 	}
 	if (parent instanceof KnowledgeTypeNode) {
 	    // instead of makning a new vector, decrement index, return when
 	    // found and index == 0
-	    Vector candidates = new Vector();
+	    List<ToDoItem> candidates = new ArrayList<ToDoItem>();
 	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) parent;
-	    Enumeration itemEnum =
-		Designer.theDesigner().getToDoList().elements();
-	    while (itemEnum.hasMoreElements()) {
-		ToDoItem item = (ToDoItem) itemEnum.nextElement();
-		if (item.containsKnowledgeType(ktn.getName()))
-		    candidates.addElement(item);
+            for (ToDoItem item : Designer.theDesigner().getToDoList()) {
+		if (item.containsKnowledgeType(ktn.getName())) {
+		    candidates.add(item);
+                }
 	    }
 	    return candidates.indexOf(child);
 	}
@@ -141,4 +134,4 @@
      */
     public void removeTreeModelListener(TreeModelListener l) { }
 
-} /* end class GoListToTypeToItem */
+} 

Modified: trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java&p2=trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/GoalsDialog.java	2007-07-01 01:10:04-0700
@@ -27,9 +27,8 @@
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
-import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Vector;
+import java.util.List;
 
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
@@ -52,19 +51,18 @@
  *
  */
 public class GoalsDialog extends ArgoDialog implements ChangeListener {
-    ////////////////////////////////////////////////////////////////
-    // constants
+
     private static final int DIALOG_WIDTH = 320;
     private static final int DIALOG_HEIGHT = 400;
 
-    ////////////////////////////////////////////////////////////////
-    // instance variables
-    private JPanel  mainPanel = new JPanel();
-    private Hashtable slidersToDecisions = new Hashtable();
-    private Hashtable slidersToDigits = new Hashtable();
 
-    ////////////////////////////////////////////////////////////////
-    // constructors
+    private JPanel mainPanel = new JPanel();
+
+    private Hashtable<JSlider, Goal> slidersToGoals = 
+        new Hashtable<JSlider, Goal>();
+
+    private Hashtable<JSlider, JLabel> slidersToDigits = 
+        new Hashtable<JSlider, JLabel>();
 
     /**
      * The constructor.
@@ -83,7 +81,7 @@
 
     private void initMainPanel() {
 	GoalModel gm = Designer.theDesigner().getGoalModel();
-	Vector goals = gm.getGoals();
+	List<Goal> goals = gm.getGoalList();
 
 	GridBagLayout gb = new GridBagLayout();
 	mainPanel.setLayout(gb);
@@ -141,14 +139,12 @@
 
 
 	c.gridy = 1;
-	Enumeration elems = goals.elements();
-	while (elems.hasMoreElements()) {
-	    Goal d = (Goal) elems.nextElement();
-	    JLabel decLabel = new JLabel(d.getName());
-	    JLabel valueLabel = new JLabel("    " + d.getPriority());
+        for (Goal goal : goals) {
+	    JLabel decLabel = new JLabel(goal.getName());
+	    JLabel valueLabel = new JLabel("    " + goal.getPriority());
 	    JSlider decSlide =
                 new JSlider(SwingConstants.HORIZONTAL,
-                            0, 5, d.getPriority());
+                            0, 5, goal.getPriority());
 	    decSlide.setPaintTicks(true);
 	    decSlide.setPaintLabels(true);
 	    decSlide.addChangeListener(this);
@@ -158,7 +154,7 @@
 	    decSlide.setSize(smallSize);
 	    decSlide.setPreferredSize(smallSize);
 
-	    slidersToDecisions.put(decSlide, d);
+	    slidersToGoals.put(decSlide, goal);
 	    slidersToDigits.put(decSlide, valueLabel);
 
 	    c.gridx = 0;
@@ -185,18 +181,15 @@
 	}
     }
 
-    ////////////////////////////////////////////////////////////////
-    // event handlers
-
     /*
      * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
      */
     public void stateChanged(ChangeEvent ce) {
 	JSlider srcSlider = (JSlider) ce.getSource();
-	Goal d = (Goal) slidersToDecisions.get(srcSlider);
-	JLabel valLab = (JLabel) slidersToDigits.get(srcSlider);
+	Goal goal = slidersToGoals.get(srcSlider);
+	JLabel valLab = slidersToDigits.get(srcSlider);
 	int pri = srcSlider.getValue();
-	d.setPriority(pri);
+	goal.setPriority(pri);
 	if (pri == 0) {
 	    valLab.setText(Translator.localize("label.off"));
 	} else {
@@ -208,8 +201,4 @@
      * The UID.
      */
     private static final long serialVersionUID = -1871200638199122363L;
-} /* end class DesignIssuesDialog */
-
-
-
-////////////////////////////////////////////////////////////////
+}
\ No newline at end of file

Modified: trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java&p2=trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/KnowledgeTypeNode.java	2007-07-01 01:10:04-0700
@@ -24,6 +24,8 @@
 
 package org.argouml.cognitive.ui;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 
 import org.argouml.cognitive.Critic;
@@ -35,12 +37,7 @@
  */
 public class KnowledgeTypeNode {
 
-    ////////////////////////////////////////////////////////////////
-    // static variables and methods
-    private static Vector types = null;
-
-    ////////////////////////////////////////////////////////////////
-    // instance variables
+    private static List<KnowledgeTypeNode> types = null;
 
     private String name;
 
@@ -55,36 +52,46 @@
 
     /**
      * @return a list of all the types
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getTypeList()}.
      */
-    public static Vector getTypes() {
+    @Deprecated
+    public static Vector<KnowledgeTypeNode> getTypes() {
+        return new Vector<KnowledgeTypeNode>(getTypeList());
+    }
+
+    /**
+     * @return a list of all the types
+     */
+    public static List<KnowledgeTypeNode> getTypeList() {
         if (types == null) {
-            types = new Vector();
-            types.addElement(new KnowledgeTypeNode(Critic.KT_DESIGNERS));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_CORRECTNESS));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_COMPLETENESS));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_CONSISTENCY));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_SYNTAX));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_SEMANTICS));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_OPTIMIZATION));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_PRESENTATION));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_ORGANIZATIONAL));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_EXPERIENCIAL));
-            types.addElement(new KnowledgeTypeNode(Critic.KT_TOOL));
+            types = new ArrayList<KnowledgeTypeNode>();
+            types.add(new KnowledgeTypeNode(Critic.KT_DESIGNERS));
+            types.add(new KnowledgeTypeNode(Critic.KT_CORRECTNESS));
+            types.add(new KnowledgeTypeNode(Critic.KT_COMPLETENESS));
+            types.add(new KnowledgeTypeNode(Critic.KT_CONSISTENCY));
+            types.add(new KnowledgeTypeNode(Critic.KT_SYNTAX));
+            types.add(new KnowledgeTypeNode(Critic.KT_SEMANTICS));
+            types.add(new KnowledgeTypeNode(Critic.KT_OPTIMIZATION));
+            types.add(new KnowledgeTypeNode(Critic.KT_PRESENTATION));
+            types.add(new KnowledgeTypeNode(Critic.KT_ORGANIZATIONAL));
+            types.add(new KnowledgeTypeNode(Critic.KT_EXPERIENCIAL));
+            types.add(new KnowledgeTypeNode(Critic.KT_TOOL));
         }
         return types;
     }
 
-    ////////////////////////////////////////////////////////////////
-    // accessors
-
     /**
      * @return the name of the knowledgetype
      */
-    public String getName() { return name; }
+    public String getName() {
+        return name;
+    }
 
     /*
      * @see java.lang.Object#toString()
      */
-    public String toString() { return getName(); }
+    public String toString() {
+        return getName();
+    }
 
-} /* end class KnowledgeTypeNode */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java&p2=trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/PriorityNode.java	2007-07-01 01:10:04-0700
@@ -24,6 +24,8 @@
 
 package org.argouml.cognitive.ui;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.Translator;
@@ -34,27 +36,20 @@
  */
 public class PriorityNode {
 
-    // Private members.
-    private static final String HIGH =
+    private static final String HIGH = 
         Translator.localize("misc.level.high");
-    private static final String MEDIUM =
+
+    private static final String MEDIUM = 
         Translator.localize("misc.level.medium");
+
     private static final String LOW =
         Translator.localize("misc.level.low");
 
-    ////////////////////////////////////////////////////////////////
-    // static variables and methods
-    private static Vector priorities = null;
-
-
-    ////////////////////////////////////////////////////////////////
-    // instance variables
+    private static List<PriorityNode> priorities = null;
 
     private String name;
-    private int priority;
 
-    ////////////////////////////////////////////////////////////////
-    // contrsuctors
+    private int priority;
 
     /**
      * The constructor.
@@ -69,37 +64,50 @@
 
     /**
      * @return the list of all the priorities
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getPriorityList()}.
      */
-    public static Vector getPriorities() {
+    @Deprecated
+    public static Vector<PriorityNode> getPriorities() {
+        return new Vector<PriorityNode>(getPriorityList());
+    }
+
+    /**
+     * @return the list of all the priorities
+     */
+    public static List<PriorityNode> getPriorityList() {
         if (priorities == null) {
-            priorities = new Vector();
-            priorities.addElement(new PriorityNode(HIGH,
+            priorities = new ArrayList<PriorityNode>();
+            priorities.add(new PriorityNode(HIGH,
                     ToDoItem.HIGH_PRIORITY));
-            priorities.addElement(new PriorityNode(MEDIUM,
+            priorities.add(new PriorityNode(MEDIUM,
                     ToDoItem.MED_PRIORITY));
-            priorities.addElement(new PriorityNode(LOW,
+            priorities.add(new PriorityNode(LOW,
                     ToDoItem.LOW_PRIORITY));
         }
         return priorities;
     }
 
 
-    ////////////////////////////////////////////////////////////////
-    // accessors
-
     /**
      * @return the name
      */
-    public String getName() { return name; }
+    public String getName() {
+        return name;
+    }
 
     /**
      * @return the priority
      */
-    public int getPriority() { return priority; }
+    public int getPriority() {
+        return priority;
+    }
 
     /*
      * @see java.lang.Object#toString()
      */
-    public String toString() { return getName(); }
+    @Override
+    public String toString() {
+        return getName();
+    }
 
-} /* end class PriorityNode */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByDecision.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,7 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Decision;
@@ -60,29 +59,30 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
 	LOG.debug("toDoItemChanged");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector decs = Designer.theDesigner().getDecisionModel().getDecisions();
-	Enumeration elems = decs.elements();
-	while (elems.hasMoreElements()) {
-	    Decision dec = (Decision) elems.nextElement();
+        for (Decision dec : Designer.theDesigner().getDecisionModel()
+                .getDecisionList()) {
 	    int nMatchingItems = 0;
 	    path[1] = dec;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(dec)) continue;
+	    for (ToDoItem item : items) {
+		if (!item.supports(dec)) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(dec)) continue;
+            for (ToDoItem item : items) {
+		if (!item.supports(dec)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(dec, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -96,29 +96,30 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+	List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector decs = Designer.theDesigner().getDecisionModel().getDecisions();
-	Enumeration elems = decs.elements();
-	while (elems.hasMoreElements()) {
-	    Decision dec = (Decision) elems.nextElement();
+        for (Decision dec : Designer.theDesigner().getDecisionModel()
+                .getDecisionList()) {
 	    int nMatchingItems = 0;
 	    path[1] = dec;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(dec)) continue;
+            for (ToDoItem item : items) {
+		if (!item.supports(dec)) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(dec)) continue;
+            for (ToDoItem item : items) {
+		if (!item.supports(dec)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(dec, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -132,22 +133,22 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
 	LOG.debug("toDoItemRemoved");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+	List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector decs = Designer.theDesigner().getDecisionModel().getDecisions();
-	Enumeration elems = decs.elements();
-	while (elems.hasMoreElements()) {
-	    Decision dec = (Decision) elems.nextElement();
+        for (Decision dec : Designer.theDesigner().getDecisionModel()
+                .getDecisionList()) {
 	    LOG.debug("toDoItemRemoved updating decision node!");
 	    boolean anyInDec = false;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.supports(dec)) anyInDec = true;
+            for (ToDoItem item : items) {
+		if (item.supports(dec)) {
+                    anyInDec = true;
+                }
 	    }
-	    if (!anyInDec) continue;
+	    if (!anyInDec) {
+                continue;
+            }
 	    path[1] = dec;
 	    //fireTreeNodesChanged(this, path, childIndices, children);
 	    fireTreeStructureChanged(path);

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByGoal.java	2007-07-01 01:10:04-0700
@@ -24,9 +24,6 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
-
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.Goal;
@@ -61,29 +58,26 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
 	LOG.debug("toDoItemsChanged");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector goals = Designer.theDesigner().getGoals();
-	Enumeration elems = goals.elements();
-	while (elems.hasMoreElements()) {
-	    Goal g = (Goal) elems.nextElement();
+        for (Goal g : Designer.theDesigner().getGoalList()) {
 	    path[1] = g;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(g)) continue;
+            for (ToDoItem item : tde.getToDoItemList()) {
+		if (!item.supports(g)) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
 	    if (nMatchingItems == 0) continue;
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(g)) continue;
+            for (ToDoItem item : tde.getToDoItemList()) {
+		if (!item.supports(g)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(g, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -97,19 +91,13 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector goals = Designer.theDesigner().getGoals();
-	Enumeration elems = goals.elements();
-	while (elems.hasMoreElements()) {
-	    Goal g = (Goal) elems.nextElement();
+        for (Goal g : Designer.theDesigner().getGoalList()) {
 	    path[1] = g;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : tde.getToDoItemList()) {
 		if (!item.supports(g)) {
 		    continue;
 		}
@@ -121,9 +109,11 @@
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.supports(g)) continue;
+            // TODO: This shouldn't require two passes through the list - tfm
+            for (ToDoItem item : tde.getToDoItemList()) {
+		if (!item.supports(g)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(g, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -137,19 +127,13 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Vector goals = Designer.theDesigner().getGoals();
-	Enumeration elems = goals.elements();
-	while (elems.hasMoreElements()) {
-	    Goal g = (Goal) elems.nextElement();
+        for (Goal g : Designer.theDesigner().getGoalList()) {
 	    LOG.debug("toDoItemRemoved updating decision node!");
 	    boolean anyInGoal = false;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : tde.getToDoItemList()) {
 		if (item.supports(g)) anyInGoal = true;
 	    }
 	    if (!anyInGoal) continue;
@@ -165,6 +149,6 @@
     public void toDoListChanged(ToDoListEvent tde) { }
 
 
-} /* end class ToDoByGoal */
+}
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByOffender.java	2007-07-01 01:10:04-0700
@@ -24,15 +24,14 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
+import org.argouml.cognitive.ListSet;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.ToDoListEvent;
 import org.argouml.cognitive.ToDoListListener;
-import org.argouml.cognitive.ListSet;
 
 /**
  * Represents a perspective for ToDo items: grouping by offender type.
@@ -60,20 +59,16 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
         LOG.debug("toDoItemsChanged");
-        Vector items = tde.getToDoItems();
-        int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
         Object[] path = new Object[2];
         path[0] = Designer.theDesigner().getToDoList();
 
         ListSet allOffenders = Designer.theDesigner().getToDoList()
                 .getOffenders();
-        Enumeration elems = allOffenders.elements();
-        while (elems.hasMoreElements()) {
-            Object off = elems.nextElement();
+        for (Object off : allOffenders) {
             path[1] = off;
             int nMatchingItems = 0;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
                 ListSet offenders = item.getOffenders();
                 if (!offenders.contains(off)) continue;
                 nMatchingItems++;
@@ -82,8 +77,7 @@
             int[] childIndices = new int[nMatchingItems];
             Object[] children = new Object[nMatchingItems];
             nMatchingItems = 0;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
                 ListSet offenders = item.getOffenders();
                 if (!offenders.contains(off)) continue;
                 childIndices[nMatchingItems] = getIndexOfChild(off, item);
@@ -99,32 +93,33 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
         LOG.debug("toDoItemAdded");
-        Vector items = tde.getToDoItems();
-        int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
         Object[] path = new Object[2];
         path[0] = Designer.theDesigner().getToDoList();
 
-        ListSet allOffenders = Designer.theDesigner().getToDoList()
-                .getOffenders();
-        Enumeration elems = allOffenders.elements();
-        while (elems.hasMoreElements()) {
-            Object off = elems.nextElement();
+        for (Object off : Designer.theDesigner().getToDoList().getOffenders()) {
             path[1] = off;
             int nMatchingItems = 0;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            // TODO: This first loop just to count the items appears 
+            // redundant to me - tfm 20070630
+            for (ToDoItem item : items) {
                 ListSet offenders = item.getOffenders();
-                if (!offenders.contains(off)) continue;
+                if (!offenders.contains(off)) {
+                    continue;
+                }
                 nMatchingItems++;
             }
-            if (nMatchingItems == 0) continue;
+            if (nMatchingItems == 0) {
+                continue;
+            }
             int[] childIndices = new int[nMatchingItems];
             Object[] children = new Object[nMatchingItems];
             nMatchingItems = 0;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
                 ListSet offenders = item.getOffenders();
-                if (!offenders.contains(off)) continue;
+                if (!offenders.contains(off)) {
+                    continue;
+                }
                 childIndices[nMatchingItems] = getIndexOfChild(off, item);
                 children[nMatchingItems] = item;
                 nMatchingItems++;
@@ -138,20 +133,13 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
         LOG.debug("toDoItemRemoved");
-        Vector items = tde.getToDoItems();
-        int nItems = items.size();
-        
+        List<ToDoItem> items = tde.getToDoItemList();
         Object[] path = new Object[2];
         path[0] = Designer.theDesigner().getToDoList();
 
-        ListSet allOffenders = Designer.theDesigner().getToDoList()
-                .getOffenders();
-        Enumeration elems = allOffenders.elements();
-        while (elems.hasMoreElements()) {
-            Object off = elems.nextElement();
+        for (Object off : Designer.theDesigner().getToDoList().getOffenders()) {
             boolean anyInOff = false;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
                 ListSet offenders = item.getOffenders();
                 if (offenders.contains(off)) { 
                     anyInOff = true;

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByPoster.java	2007-07-01 01:10:04-0700
@@ -24,18 +24,14 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
-import org.apache.log4j.Logger;
-
+import java.util.List;
 
+import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.Poster;
 import org.argouml.cognitive.ToDoItem;
-import org.argouml.cognitive.ToDoList;
 import org.argouml.cognitive.ToDoListEvent;
 import org.argouml.cognitive.ToDoListListener;
-import org.argouml.cognitive.ListSet;
 
 /**
  * Represents a perspective for ToDo items: grouping by poster type.
@@ -63,19 +59,14 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
 	LOG.debug("toDoItemsChanged");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	ListSet posters = Designer.theDesigner().getToDoList().getPosters();
-	Enumeration elems = posters.elements();
-	while (elems.hasMoreElements()) {
-	    Poster p = (Poster) elems.nextElement();
+        for (Poster p : Designer.theDesigner().getToDoList().getPosters()) {
 	    path[1] = p;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
 		Poster post = item.getPoster();
 		if (post != p) continue;
 		nMatchingItems++;
@@ -84,8 +75,7 @@
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
 		Poster post = item.getPoster();
 		if (post != p) continue;
 		childIndices[nMatchingItems] = getIndexOfChild(p, item);
@@ -101,19 +91,14 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+	List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	ListSet posters = Designer.theDesigner().getToDoList().getPosters();
-	Enumeration elems = posters.elements();
-	while (elems.hasMoreElements()) {
-	    Poster p = (Poster) elems.nextElement();
+        for (Poster p : Designer.theDesigner().getToDoList().getPosters()) {
 	    path[1] = p;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
 		Poster post = item.getPoster();
 		if (post != p) continue;
 		nMatchingItems++;
@@ -122,8 +107,7 @@
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
 		Poster post = item.getPoster();
 		if (post != p) continue;
 		childIndices[nMatchingItems] = getIndexOfChild(p, item);
@@ -139,20 +123,14 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
 	LOG.debug("toDoItemRemoved");
-        Vector items = tde.getToDoItems();
-        int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
         
-	ToDoList list = Designer.theDesigner().getToDoList(); //source?
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-
-	Enumeration elems = list.getPosters().elements();
- 	while (elems.hasMoreElements()) {
-	    Poster p = (Poster) elems.nextElement();
+        for (Poster p : Designer.theDesigner().getToDoList().getPosters()) {
             boolean anyInPoster = false;
-            for (int i = 0; i < nItems; i++) {
-                ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
                 Poster post = item.getPoster();
                 if (post == p) { 
                     anyInPoster = true;
@@ -170,9 +148,9 @@
     /*
      * @see org.argouml.cognitive.ToDoListListener#toDoListChanged(org.argouml.cognitive.ToDoListEvent)
      */
-    public void toDoListChanged(ToDoListEvent tde) { }
-
+    public void toDoListChanged(ToDoListEvent tde) {
+    }
 
-} /* end class ToDoByPoster */
+}
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByPriority.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,7 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
@@ -59,28 +58,29 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
 	LOG.debug("toDoItemChanged");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = PriorityNode.getPriorities().elements();
-	while (elems.hasMoreElements()) {
-	    PriorityNode pn = (PriorityNode) elems.nextElement();
+        for (PriorityNode pn : PriorityNode.getPriorityList()) {
 	    path[1] = pn;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.getPriority() != pn.getPriority()) continue;
+            for (ToDoItem item : items) {
+		if (item.getPriority() != pn.getPriority()) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.getPriority() != pn.getPriority()) continue;
+            for (ToDoItem item : items) {
+		if (item.getPriority() != pn.getPriority()) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(pn, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -94,28 +94,29 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+	List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = PriorityNode.getPriorities().elements();
-	while (elems.hasMoreElements()) {
-	    PriorityNode pn = (PriorityNode) elems.nextElement();
+        for (PriorityNode pn : PriorityNode.getPriorityList()) {
 	    path[1] = pn;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.getPriority() != pn.getPriority()) continue;
+            for (ToDoItem item : items) {
+		if (item.getPriority() != pn.getPriority()) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.getPriority() != pn.getPriority()) continue;
+            for (ToDoItem item : items) {
+		if (item.getPriority() != pn.getPriority()) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(pn, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -129,22 +130,22 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
 	LOG.debug("toDoItemRemoved");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = PriorityNode.getPriorities().elements();
-	while (elems.hasMoreElements()) {
-	    PriorityNode pn = (PriorityNode) elems.nextElement();
+        for (PriorityNode pn : PriorityNode.getPriorityList()) {
 	    int nodePriority = pn.getPriority();
 	    boolean anyInPri = false;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
+            for (ToDoItem item : items) {
 		int pri = item.getPriority();
-		if (pri == nodePriority) anyInPri = true;
+		if (pri == nodePriority) {
+                    anyInPri = true;
+                }
 	    }
-	    if (!anyInPri) continue;
+	    if (!anyInPri) {
+                continue;
+            }
 	    LOG.debug("toDoItemRemoved updating PriorityNode");
 	    path[1] = pn;
 	    //fireTreeNodesChanged(this, path, childIndices, children);
@@ -157,6 +158,7 @@
      */
     public void toDoListChanged(ToDoListEvent tde) { }
 
-} /* end class ToDoByPriority */
+}
+
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoByType.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,7 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
@@ -60,29 +59,30 @@
      */
     public void toDoItemsChanged(ToDoListEvent tde) {
 	LOG.debug("toDoItemsChanged");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = KnowledgeTypeNode.getTypes().elements();
-	while (elems.hasMoreElements()) {
-	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) elems.nextElement();
+        for (KnowledgeTypeNode ktn : KnowledgeTypeNode.getTypeList()) {
 	    String kt = ktn.getName();
 	    path[1] = ktn;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.containsKnowledgeType(kt)) continue;
+            for (ToDoItem item : items) {
+		if (!item.containsKnowledgeType(kt)) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.containsKnowledgeType(kt)) continue;
+            for (ToDoItem item : items) {
+		if (!item.containsKnowledgeType(kt)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(ktn, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -96,29 +96,30 @@
      */
     public void toDoItemsAdded(ToDoListEvent tde) {
 	LOG.debug("toDoItemAdded");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = KnowledgeTypeNode.getTypes().elements();
-	while (elems.hasMoreElements()) {
-	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) elems.nextElement();
+        for (KnowledgeTypeNode ktn : KnowledgeTypeNode.getTypeList()) {
 	    String kt = ktn.getName();
 	    path[1] = ktn;
 	    int nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.containsKnowledgeType(kt)) continue;
+            for (ToDoItem item : items) {
+		if (!item.containsKnowledgeType(kt)) {
+                    continue;
+                }
 		nMatchingItems++;
 	    }
-	    if (nMatchingItems == 0) continue;
+	    if (nMatchingItems == 0) {
+                continue;
+            }
 	    int[] childIndices = new int[nMatchingItems];
 	    Object[] children = new Object[nMatchingItems];
 	    nMatchingItems = 0;
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (!item.containsKnowledgeType(kt)) continue;
+            for (ToDoItem item : items) {
+		if (!item.containsKnowledgeType(kt)) {
+                    continue;
+                }
 		childIndices[nMatchingItems] = getIndexOfChild(ktn, item);
 		children[nMatchingItems] = item;
 		nMatchingItems++;
@@ -132,21 +133,21 @@
      */
     public void toDoItemsRemoved(ToDoListEvent tde) {
 	LOG.debug("toDoItemRemoved");
-	Vector items = tde.getToDoItems();
-	int nItems = items.size();
+        List<ToDoItem> items = tde.getToDoItemList();
 	Object[] path = new Object[2];
 	path[0] = Designer.theDesigner().getToDoList();
 
-	Enumeration elems = KnowledgeTypeNode.getTypes().elements();
-	while (elems.hasMoreElements()) {
-	    KnowledgeTypeNode ktn = (KnowledgeTypeNode) elems.nextElement();
+        for (KnowledgeTypeNode ktn : KnowledgeTypeNode.getTypeList()) {
 	    boolean anyInKT = false;
 	    String kt = ktn.getName();
-	    for (int i = 0; i < nItems; i++) {
-		ToDoItem item = (ToDoItem) items.elementAt(i);
-		if (item.containsKnowledgeType(kt)) anyInKT = true;
+            for (ToDoItem item : items) {
+		if (item.containsKnowledgeType(kt)) {
+                    anyInKT = true;
+                }
 	    }
-	    if (!anyInKT) continue;
+	    if (!anyInKT) {
+                continue;
+            }
 	    LOG.debug("toDoItemRemoved updating PriorityNode");
 	    path[1] = ktn;
 	    //fireTreeNodesChanged(this, path, childIndices, children);
@@ -159,6 +160,6 @@
      */
     public void toDoListChanged(ToDoListEvent tde) { }
 
-} /* end class ToDoByType */
+}
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java	2007-07-01 01:10:04-0700
@@ -32,6 +32,8 @@
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.BorderFactory;
@@ -111,7 +113,7 @@
     /**
      * Vector of TreeModels.
      */
-    private Vector<ToDoPerspective> perspectives;
+    private List<ToDoPerspective> perspectives;
     private ToDoPerspective curPerspective;
 
     private ToDoList root;
@@ -133,7 +135,7 @@
         combo = new JComboBox();
         tree = new DisplayTextTree();
 
-        perspectives = new Vector<ToDoPerspective>();
+        perspectives = new ArrayList<ToDoPerspective>();
 
         countLabel = new JLabel(formatCountLabel(999));
         countLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
@@ -188,34 +190,54 @@
 
     /**
      * @return the perspectives treemodels
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getPerspectiveList()}.
      */
-    public Vector<ToDoPerspective> getPerspectives() { return perspectives; }
+    @Deprecated
+    public Vector<ToDoPerspective> getPerspectives() {
+        return new Vector<ToDoPerspective>(perspectives);
+    }
 
     /**
+     * @return the perspectives treemodels
+     */
+    public List<ToDoPerspective> getPerspectiveList() {
+        return perspectives;
+    }
+    
+    /**
      * @param pers the perspectives
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #setPerspectives(List)}.
      */
+    @Deprecated
     public void setPerspectives(Vector<ToDoPerspective> pers) {
+        setPerspectives((List<ToDoPerspective>) pers);
+    }
+
+    /**
+     * @param pers the perspectives
+     */
+    public void setPerspectives(List<ToDoPerspective> pers) {
         perspectives = pers;
         if (pers.isEmpty()) {
-	    curPerspective = null;
-	} else {
-	    curPerspective = pers.elementAt(0);
-	}
+            curPerspective = null;
+        } else {
+            curPerspective = pers.get(0);
+        }
 
         for (ToDoPerspective tdp : perspectives) {
             combo.addItem(tdp);
-	}
+        }
 
         if (pers.isEmpty()) {
-	    curPerspective = null;
-	} else if (pers.contains(curPerspective)) {
+            curPerspective = null;
+        } else if (pers.contains(curPerspective)) {
             setCurPerspective(curPerspective);
-	} else {
-            setCurPerspective(perspectives.elementAt(0));
-	}
+        } else {
+            setCurPerspective(perspectives.get(0));
+        }
         updateTree();
     }
-
+    
     /**
      * @return the current perspectives
      */
@@ -366,8 +388,8 @@
         if (curPerspective instanceof ToDoListListener) {
             ((ToDoListListener) curPerspective).toDoItemsAdded(tde);
 	}
-        Vector<ToDoItem> v = tde.getToDoItems();
-        for (ToDoItem todo : v) {
+        List<ToDoItem> items = tde.getToDoItemList();
+        for (ToDoItem todo : items) {
             if (todo.getPriority() >= ToDoItem.INTERRUPTIVE_PRIORITY) {
                 // keep nagging until the user solves the problem:
                 // This seems a nice way to nag:
@@ -499,7 +521,7 @@
     /**
      * The perspectives to be chosen in the combobox are built here.
      */
-    private static Vector<ToDoPerspective> buildPerspectives() {
+    private static List<ToDoPerspective> buildPerspectives() {
 
         ToDoPerspective priority = new ToDoByPriority();
         ToDoPerspective decision = new ToDoByDecision();
@@ -509,7 +531,7 @@
         ToDoPerspective type = new ToDoByType();
 
         // add the perspetives to a vector for the combobox
-        Vector<ToDoPerspective> perspectives = new Vector<ToDoPerspective>();
+        List<ToDoPerspective> perspectives = new ArrayList<ToDoPerspective>();
 
         perspectives.add(priority);
         perspectives.add(decision);
@@ -532,4 +554,4 @@
      * The UID.
      */
     private static final long serialVersionUID = 1911401582875302996L;
-} /* end class ToDoPane */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoPerspective.java	2007-07-01 01:10:04-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2007 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,7 +24,8 @@
 
 package org.argouml.cognitive.ui;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.ToDoItem;
@@ -53,7 +54,7 @@
     /**
      * todoList specific.
      */
-    private Vector flatChildren;
+    private List<ToDoItem> flatChildren;
 
     /**
      * The constructor.
@@ -63,7 +64,7 @@
     public ToDoPerspective(String name) {
 
         super(name);
-        flatChildren = new Vector();
+        flatChildren = new ArrayList<ToDoItem>();
     }
 
     ////////////////////////////////////////////////////////////////
@@ -76,9 +77,10 @@
      * @param index of child to find
      * @return the child found at index. Null if index is out of bounds.
      */
+    @Override
     public Object getChild(Object parent, int index) {
         if (flat && parent == getRoot()) {
-            return flatChildren.elementAt(index);
+            return flatChildren.get(index);
         }
         return super.getChild(parent,  index);
     }
@@ -86,6 +88,7 @@
     /*
      * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
      */
+    @Override
     public int getChildCount(Object parent) {
         if (flat && parent == getRoot()) {
             return flatChildren.size();
@@ -97,6 +100,7 @@
      * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object,
      *      java.lang.Object)
      */
+    @Override
     public int getIndexOfChild(Object parent, Object child) {
         if (flat && parent == getRoot()) {
             return flatChildren.indexOf(child);
@@ -124,13 +128,15 @@
      *
      * @return the flatness: true if flat
      */
-    public boolean getFlat() { return flat; }
+    public boolean getFlat() {
+        return flat;
+    }
 
     /**
      * TodoList specific.
      */
     public void calcFlatChildren() {
-        flatChildren.removeAllElements();
+        flatChildren.clear();
         addFlatChildren(getRoot());
     }
 
@@ -147,7 +153,7 @@
         // hack for to do items only, should check isLeaf(node), but that
         // includes empty folders. Really I need alwaysLeaf(node).
         if ((node instanceof ToDoItem) && !flatChildren.contains(node)) {
-            flatChildren.addElement(node);
+            flatChildren.add((ToDoItem) node);
 	}
 
         int nKids = getChildCount(node);
@@ -156,4 +162,4 @@
         }
     }
 
-} /* end class ToDoPerspective */
+}

Modified: trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java&p2=trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/WizStepChoice.java	2007-07-01 01:10:04-0700
@@ -27,7 +27,10 @@
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
+
 import javax.swing.JLabel;
 import javax.swing.JRadioButton;
 import javax.swing.JTextArea;
@@ -47,17 +50,32 @@
 
 public class WizStepChoice extends WizStep {
     private JTextArea instructions = new JTextArea();
-    private Vector choices = new Vector();
+    private List<String> choices = new ArrayList<String>();
     private int selectedIndex = -1;
 
+
     /**
      * The constructor.
      *
      * @param w the wizard
      * @param instr the instructions
      * @param ch the choices
+     * @deprecated for 0.25.4 by tfmorris.  
+     * Use {@link #WizStepChoice(Wizard, String, List)}.
      */
-    public WizStepChoice(Wizard w, String instr, Vector ch) {
+    @Deprecated
+    public WizStepChoice(Wizard w, String instr, Vector<String> ch) {
+        this(w, instr, (List<String>) ch);
+    }
+    
+    /**
+     * The constructor.
+     *
+     * @param w the wizard
+     * @param instr the instructions
+     * @param ch the choices
+     */
+    public WizStepChoice(Wizard w, String instr, List<String> ch) {
 	// store wizard?
 	choices = ch;
 
@@ -113,7 +131,7 @@
 	int size = ch.size();
 	for (int i = 0; i < size; i++) {
 	    c.gridy = 2 + i;
-	    String s = (String) ch.elementAt(i);
+	    String s = ch.get(i);
 	    JRadioButton rb = new JRadioButton(s);
 	    rb.setActionCommand(s);
 	    rb.addActionListener(this);
@@ -135,12 +153,15 @@
     /**
      * @return the index of the selected item
      */
-    public int getSelectedIndex() { return selectedIndex; }
+    public int getSelectedIndex() {
+        return selectedIndex;
+    }
 
 
     /*
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
 	super.actionPerformed(e);
 	if (e.getSource() instanceof JRadioButton) {
@@ -151,7 +172,7 @@
 	    }
 	    int size = choices.size();
 	    for (int i = 0; i < size; i++) {
-		String s = (String) choices.elementAt(i);
+		String s = choices.get(i);
 		if (s.equals(cmd)) {
                     selectedIndex = i;
                 }
@@ -165,7 +186,7 @@
      * The UID.
      */
     private static final long serialVersionUID = 8055896491830976354L;
-} /* end class WizStepChoice */
+} 
 
 
 

Modified: trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java&p2=trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/WizStepManyTextFields.java	2007-07-01 01:10:04-0700
@@ -27,6 +27,8 @@
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 import javax.swing.JLabel;
 import javax.swing.JTextArea;
@@ -47,7 +49,7 @@
 
 public class WizStepManyTextFields extends WizStep {
     private JTextArea instructions = new JTextArea();
-    private Vector fields = new Vector();
+    private List<JTextField> fields = new ArrayList<JTextField>();
 
     /**
      * The constructor.
@@ -56,7 +58,7 @@
      * @param instr  the instructions
      * @param strings the strings
      */
-    public WizStepManyTextFields(Wizard w, String instr, Vector strings) {
+    public WizStepManyTextFields(Wizard w, String instr, List strings) {
 	// store wizard?
 	instructions.setText(instr);
 	instructions.setWrapStyleWord(true);
@@ -112,11 +114,11 @@
 	int size = strings.size();
 	for (int i = 0; i < size; i++) {
 	    c.gridy = 2 + i;
-	    String s = (String) strings.elementAt(i);
+	    String s = (String) strings.get(i);
 	    JTextField tf = new JTextField(s, 50);
 	    tf.setMinimumSize(new Dimension(200, 20));
 	    tf.getDocument().addDocumentListener(this);
-	    fields.addElement(tf);
+	    fields.add(tf);
 	    gb.setConstraints(tf, c);
 	    getMainPanel().add(tf);
 	}
@@ -134,18 +136,25 @@
 
     /**
      * @return the strings
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getStringList()}.
      */
-    public Vector getStrings() {
-	int size = fields.size();
-	Vector res = new Vector(size);
-	for (int i = 0; i < size; i++) {
-	    JTextField tf = (JTextField) fields.elementAt(i);
-	    res.addElement(tf.getText());
-	}
-	return res;
+    @Deprecated
+    public Vector<String> getStrings() {
+        return new Vector<String>(getStringList());
     }
 
     /**
+     * @return the strings
+     */
+    public List<String> getStringList() {
+        List<String> result = new ArrayList<String>(fields.size());
+        for (JTextField tf : fields) {
+            result.add(tf.getText());
+        }
+        return result;
+    }
+    
+    /**
      * The UID.
      */
     private static final long serialVersionUID = -5154002407806917092L;

Modified: trunk/src_new/org/argouml/persistence/TodoParser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/TodoParser.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/persistence/TodoParser.java&p2=trunk/src_new/org/argouml/persistence/TodoParser.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/persistence/TodoParser.java	(original)
+++ trunk/src_new/org/argouml/persistence/TodoParser.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,8 @@
 package org.argouml.persistence;
 
 import java.io.Reader;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
 
@@ -35,7 +36,7 @@
 import org.xml.sax.SAXException;
 
 
-// TODO: Reuse the offender Vector.
+// TODO: Reuse the offender List.
 
 /**
  * Class that reads a todo list from a todo xml file.
@@ -79,7 +80,7 @@
      * The offenders vector of the ResolvedCritic currently being
      * read.
      */
-    private Vector offenders;
+    private List offenders;
 
     /**
      * Creates a new TodoParser.
@@ -367,7 +368,7 @@
      */
     protected void handleOffender(XMLElement e) {
         if (offenders == null) {
-            offenders = new Vector();
+            offenders = new ArrayList();
         }
         offenders.add(decode(e.getText()).trim());
     }

Modified: trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java&p2=trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/ProjectMemberTodoList.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,6 @@
 
 package org.argouml.uml.cognitive;
 
-import java.util.Iterator;
-import java.util.Set;
 import java.util.Vector;
 
 import org.argouml.cognitive.Designer;
@@ -67,6 +65,7 @@
     /*
      * @see org.argouml.kernel.AbstractProjectMember#getZipFileExtension()
      */
+    @Override
     public String getZipFileExtension() {
         return TO_DO_EXT;
     }
@@ -75,26 +74,11 @@
      * @return a vector containing the to do list
      * Used by todo.tee
      */
-    public Vector getToDoList() {
-        Vector in, out;
-        ToDoItem tdi;
-        Designer dsgr;
-        int i;
-
-        dsgr = Designer.theDesigner();
-        in = dsgr.getToDoList().getToDoItems();
-        out = new Vector();
-        for (i = 0; i < in.size(); i++) {
-            try {
-            	tdi = (ToDoItem) in.elementAt(i);
-            	if (tdi == null) {
-                    continue;
-                }
-            } catch (ClassCastException e) {
-                continue;
-            }
-
-            if (tdi.getPoster() instanceof Designer) {
+    public Vector<ToDoItemXMLHelper> getToDoList() {
+        Vector<ToDoItemXMLHelper> out = new Vector<ToDoItemXMLHelper>();
+        Designer dsgr = Designer.theDesigner();
+        for (ToDoItem tdi : dsgr.getToDoList().getToDoItemList()) {
+            if (tdi != null && tdi.getPoster() instanceof Designer) {
                 out.addElement(new ToDoItemXMLHelper(tdi));
             }
         }
@@ -105,27 +89,14 @@
      * @return Vector conaining the resolved critics list
      * Used by todo.tee
      */
-    public Vector getResolvedCriticsList() {
-    	Set in;
-        Vector out;
-    	ResolvedCritic rci;
-    	Designer dsgr;
-
-    	dsgr = Designer.theDesigner();
-    	in = dsgr.getToDoList().getResolvedItems();
-
-    	out = new Vector();
-    	for (Iterator it = in.iterator(); it.hasNext();) {
-            Object o = it.next();
-    	    try {
-                rci = (ResolvedCritic) o;
-                if (rci == null) {
-                    continue;
-                }
-    	    } catch (ClassCastException e) {
-    	        continue;
-    	    }
-    	    out.addElement(new ResolvedCriticXMLHelper(rci));
+    public Vector<ResolvedCriticXMLHelper> getResolvedCriticsList() {
+        Vector<ResolvedCriticXMLHelper> out = 
+            new Vector<ResolvedCriticXMLHelper>();
+    	Designer dsgr = Designer.theDesigner();
+    	for (ResolvedCritic rci : dsgr.getToDoList().getResolvedItems()) {
+    	    if (rci != null) {
+                out.addElement(new ResolvedCriticXMLHelper(rci));
+            }
     	}
     	return out;
     }
@@ -133,7 +104,8 @@
     /**
      * There is not yet any repair task for the ToDo model but this is open to
      * implement as and when any problems areas are discovered.
-     * @see org.argouml.kernel.ProjectMember#repair()
+     * 
+     * {@inheritDoc}
      */
     public String repair() {
         return "";

Modified: trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java&p2=trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/UMLToDoItem.java	2007-07-01 01:10:04-0700
@@ -31,7 +31,6 @@
 
 package org.argouml.uml.cognitive;
 
-import java.util.Enumeration;
 import java.util.Iterator;
 
 import org.argouml.cognitive.Critic;
@@ -122,23 +121,21 @@
      * around the call to
      * {@link ProjectBrowser#jumpToDiagramShowing(java.util.Vector)}.
      */
+    @Override
     public void action() {
         deselect();
         // this also sets the target as a convenient side effect
-        ProjectBrowser.getInstance()
-            .jumpToDiagramShowing(getOffenders().asVector());
+        ProjectBrowser.getInstance().jumpToDiagramShowing(getOffenders());
         select();
     }
 
     /*
      * @see org.argouml.cognitive.ToDoItem#deselect()
      */
+    @Override
     public void deselect() {
-        Enumeration offs = getOffenders().elements();
         Project p = ProjectManager.getManager().getCurrentProject();
-
-        while (offs.hasMoreElements()) {
-            Object dm =  offs.nextElement();
+        for (Object dm : getOffenders()) {
             if (dm instanceof Highlightable) {
                 ((Highlightable) dm).setHighlight(false);
 	    } else if (p != null) {
@@ -156,11 +153,10 @@
     /*
      * @see org.argouml.cognitive.ToDoItem#select()
      */
+    @Override
     public void select() {
-        Enumeration offs = getOffenders().elements();
         Project p = ProjectManager.getManager().getCurrentProject();
-        while (offs.hasMoreElements()) {
-            Object dm = offs.nextElement();
+        for (Object dm : getOffenders()) {
             if (dm instanceof Highlightable) {
                 ((Highlightable) dm).setHighlight(true);
 	    } else if (p != null) {

Modified: trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java&p2=trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/checklist/Init.java	2007-07-01 01:10:04-0700
@@ -58,7 +58,7 @@
 				     Checklist checklist) {
 	CheckItem checkitem =
 	    new UMLCheckItem(category, Translator.localize(key));
-	checklist.addItem(checkitem);
+	checklist.add(checkitem);
     }
 
     /**
@@ -594,4 +594,4 @@
 
     }
 
-} /* end class Init */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java	2007-07-01 01:10:04-0700
@@ -27,7 +27,6 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.argouml.cognitive.Critic;
@@ -82,26 +81,24 @@
     protected ListSet computeOffenders(Object dm) {
         ListSet offenderResult = new ListSet();
         if (Model.getFacade().isANamespace(dm)) {
-            Iterator it = Model.getFacade().getOwnedElements(dm).iterator();
-            HashMap names = new HashMap();
-            while (it.hasNext()) {
-                Object name1Object = it.next();
-
-                if (!Model.getFacade().isAAssociation(name1Object))
+            HashMap<String, Object> names = new HashMap<String, Object>();
+            for (Object name1Object : Model.getFacade().getOwnedElements(dm)) {
+                if (!Model.getFacade().isAAssociation(name1Object)) {
                     continue;
+                }
                 String name = Model.getFacade().getName(name1Object);
                 Collection typ1 = getAllTypes(name1Object);
-                if (name == null)
-                    continue;
-                if ("".equals(name))
+                if (name == null || "".equals(name)) {
                     continue;
+                }
                 if (names.containsKey(name)) {
                     Object offender = names.get(name);
                     Collection typ2 = getAllTypes(offender);
                     if (typ1.containsAll(typ2) && typ2.containsAll(typ1)) {
-                        if (!offenderResult.contains(offender))
-                            offenderResult.addElement(offender);
-                        offenderResult.addElement(name1Object);
+                        if (!offenderResult.contains(offender)) {
+                            offenderResult.add(offender);
+                        }
+                        offenderResult.add(name1Object);
                     }
                 }
                 names.put(name, name1Object);
@@ -114,17 +111,20 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-        if (!isActive())
+        if (!isActive()) {
             return false;
+        }
         ListSet offs = i.getOffenders();
 
         // first element is e.g. the class, but we need to have its namespace
         // to recompute the offenders.
-        Object f = offs.firstElement();
+        Object f = offs.get(0);
         Object ns = Model.getFacade().getNamespace(f);
-        if (!predicate(ns, dsgr))
+        if (!predicate(ns, dsgr)) {
             return false;
+        }
         ListSet newOffs = computeOffenders(ns);
         boolean res = offs.equals(newOffs);
         return res;
@@ -132,14 +132,14 @@
 
     public Collection getAllTypes(Object assoc) {
         Set list = new HashSet();
-        if (assoc == null)
+        if (assoc == null) {
             return list;
+        }
         Collection assocEnds = Model.getFacade().getConnections(assoc);
-        if (assocEnds == null)
+        if (assocEnds == null) {
             return list;
-        Iterator iterator = assocEnds.iterator();
-        while (iterator.hasNext()) {
-            Object element = iterator.next();
+        }
+        for (Object element : assocEnds) {
             if (Model.getFacade().isAAssociationEnd(element)) {
                 Object type = Model.getFacade().getType(element);
                 list.add(type);
@@ -147,4 +147,4 @@
         }
         return list;
     }
-} /* end class CrAssocNameConflict */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrCircularComposition.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,6 @@
 
 package org.argouml.uml.cognitive.critics;
 
-import java.util.Enumeration;
-
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.Designer;
@@ -59,10 +57,14 @@
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(Model.getFacade().isAClassifier(dm))) return NO_PROBLEM;
+	if (!(Model.getFacade().isAClassifier(dm))) {
+            return NO_PROBLEM;
+        }
 	ListSet reach =
 	    (new ListSet(dm)).reachable(GenCompositeClasses.getSINGLETON());
-	if (reach.contains(dm)) return PROBLEM_FOUND;
+	if (reach.contains(dm)) {
+            return PROBLEM_FOUND;
+        }
 	return NO_PROBLEM;
     }
 
@@ -83,12 +85,12 @@
     protected ListSet computeOffenders(Object dm) {
 	ListSet offs = new ListSet(dm);
 	ListSet above = offs.reachable(GenCompositeClasses.getSINGLETON());
-	Enumeration elems = above.elements();
-	while (elems.hasMoreElements()) {
-	    Object cls2 = elems.nextElement();
+        for (Object cls2 : above) {
 	    ListSet trans = (new ListSet(cls2))
 	        .reachable(GenCompositeClasses.getSINGLETON());
-	    if (trans.contains(dm)) offs.addElement(cls2);
+	    if (trans.contains(dm)) {
+                offs.add(cls2);
+            }
 	}
 	return offs;
     }
@@ -100,7 +102,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	Object dm =  offs.firstElement();
+	Object dm =  offs.get(0);
 	if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dm);
 	boolean res = offs.equals(newOffs);
@@ -117,4 +119,4 @@
 	return WizBreakCircularComp.class;
     }
 
-} /* end class CrCircularComposition */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrClassWithoutComponent.java	2007-07-01 01:10:04-0700
@@ -81,7 +81,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -110,12 +110,12 @@
 		                                        .getOwner())))) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fc);
+		offs.add(fc);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrClassWithoutComponent */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrCompInstanceWithoutNode.java	2007-07-01 01:10:04-0700
@@ -82,7 +82,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -121,17 +121,17 @@
 	    if ((fc.getEnclosingFig() == null) && isNode) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(deploymentDiagram);
+		    offs.add(deploymentDiagram);
 		}
-		offs.addElement(fc);
+		offs.add(fc);
 	    } else if (fc.getEnclosingFig() != null
 		     && ((Model.getFacade().getNodeInstance(fc.getOwner()))
 			 == null)) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(deploymentDiagram);
+		    offs.add(deploymentDiagram);
 		}
-		offs.addElement(fc);
+		offs.add(fc);
 	    }
 
 	}
@@ -139,5 +139,5 @@
 	return offs;
     }
 
-} /* end class CrCompInstanceWithoutNode */
+}
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentInstanceWithoutClassifier.java	2007-07-01 01:10:04-0700
@@ -87,7 +87,7 @@
 	    return false;
 	}
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -126,9 +126,9 @@
 		}
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(deploymentDiagram);
+		    offs.add(deploymentDiagram);
 		}
-		offs.addElement(figComponentInstance);
+		offs.add(figComponentInstance);
 	    }
 	}
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrComponentWithoutNode.java	2007-07-01 01:10:04-0700
@@ -82,7 +82,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -117,9 +117,9 @@
 	    if ((fc.getEnclosingFig() == null) && isNode) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fc);
+		offs.add(fc);
 	    } else if (fc.getEnclosingFig() != null
 		     && (((Model.getFacade()
 		             .getDeploymentLocations(fc.getOwner()) == null)
@@ -128,9 +128,9 @@
 			     == 0))))) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fc);
+		offs.add(fc);
 	    }
 
 	}
@@ -138,5 +138,5 @@
 	return offs;
     }
 
-} /* end class CrComponentWithoutNode */
+}
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrConstructorNeeded.java	2007-07-01 01:10:04-0700
@@ -148,7 +148,7 @@
     public void initWizard(Wizard w) {
 	if (w instanceof WizAddConstructor) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String sug = null;
 	    if (me != null)

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrDisambigClassName.java	2007-07-01 01:10:04-0700
@@ -133,7 +133,7 @@
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String sug = Model.getFacade().getName(me);
 	    String ins = super.getInstructions();
 	    ((WizMEName) w).setInstructions(ins);
@@ -148,4 +148,4 @@
     public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
 
 
-} /* end class CrDisambigClassName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrInstanceWithoutClassifier.java	2007-07-01 01:10:04-0700
@@ -81,7 +81,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -117,9 +117,9 @@
 		}
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(figNodeModelElement);
+		offs.add(figNodeModelElement);
 	    }
 	}
 	return offs;

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrInterfaceWithoutComponent.java	2007-07-01 01:10:04-0700
@@ -82,7 +82,7 @@
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -111,12 +111,12 @@
 	            .isAComponent(enclosing.getOwner())))) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fi);
+		offs.add(fi);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrInterfaceWithoutComponent */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingAttrName.java	2007-07-01 01:10:04-0700
@@ -76,7 +76,7 @@
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String sug = super.getDefaultSuggestion();
 	    if (Model.getFacade().isAAttribute(me)) {
@@ -97,4 +97,4 @@
      */
     public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
 
-} /* end class CrMissingAttrName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingClassName.java	2007-07-01 01:10:04-0700
@@ -79,7 +79,7 @@
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String sug = super.getDefaultSuggestion();
 	    int count = 1;
@@ -99,4 +99,4 @@
      */
     public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
 
-} /* end class CrMissingClassName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingOperName.java	2007-07-01 01:10:04-0700
@@ -50,6 +50,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(Model.getFacade().isAOperation(dm))) return NO_PROBLEM;
 	Object oper = dm;
@@ -63,10 +64,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String sug = super.getDefaultSuggestion();
 	    if (Model.getFacade().isAOperation(me)) {
@@ -85,6 +87,9 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizMEName.class;
+    }
 
-} /* end class CrMissingOperName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMissingStateName.java	2007-07-01 01:10:04-0700
@@ -55,6 +55,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!Model.getFacade().isAStateVertex(dm)) {
             return NO_PROBLEM;
@@ -86,6 +87,7 @@
     /*
      * @see org.argouml.cognitive.Poster#getClarifier()
      */
+    @Override
     public Icon getClarifier() {
 	return ClClassName.getTheInstance();
     }
@@ -94,10 +96,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String sug = super.getDefaultSuggestion();
 	    if (Model.getFacade().isAStateVertex(me)) {
@@ -118,10 +121,13 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizMEName.class;
+    }
 
     /**
      * The UID.
      */
     private static final long serialVersionUID = 1181623952639408440L;
-} /* end class CrMissingStateName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java	2007-07-01 01:10:04-0700
@@ -121,7 +121,7 @@
                     && Model.getFacade().equalsPseudostateKind(
                             Model.getFacade().getKind(sv),
                             Model.getPseudostateKind().getDeepHistory())) {
-                offs.addElement(sv);
+                offs.add(sv);
             }
         }
         return offs;
@@ -136,7 +136,7 @@
             return false;
         }
         ListSet offs = i.getOffenders();
-        Object dm = offs.firstElement();
+        Object dm = offs.get(0);
         ListSet newOffs = computeOffenders(dm);
         boolean res = offs.equals(newOffs);
         return res;

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
@@ -61,6 +60,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
         if (!(Model.getFacade().isAPseudostate(dm))) {
             return NO_PROBLEM;
@@ -78,10 +78,10 @@
             LOG.debug("null parent state");
             return NO_PROBLEM;
         }
-        Collection peers = Model.getFacade().getSubvertices(cs);
+        
         int initialStateCount = 0;
-        for (Iterator iter = peers.iterator(); iter.hasNext();) {
-            Object sv = iter.next();
+        Collection peers = Model.getFacade().getSubvertices(cs);
+        for (Object sv : peers) {
             if (Model.getFacade().isAPseudostate(sv)
                 && Model.getFacade().
                 	equalsPseudostateKind(
@@ -100,6 +100,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
         ListSet offs = computeOffenders(dm);
         return new UMLToDoItem(this, offs, dsgr);
@@ -116,15 +117,14 @@
             LOG.debug("null parent in still valid");
             return offs;
 	}
+        
         Collection peers = Model.getFacade().getSubvertices(cs);
-
-        for (Iterator iter = peers.iterator(); iter.hasNext();) {
-            Object sv = iter.next();
+        for (Object sv : peers) {
             if (Model.getFacade().isAPseudostate(sv)
                 && Model.getFacade().equalsPseudostateKind(
                         Model.getFacade().getKind(sv),
                         Model.getPseudostateKind().getInitial())) {
-                offs.addElement(sv);
+                offs.add(sv);
 	    }
         }
 
@@ -135,12 +135,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
         if (!isActive()) {
             return false;
         }
         ListSet offs = i.getOffenders();
-        Object dm = offs.firstElement();
+        Object dm = offs.get(0);
         ListSet newOffs = computeOffenders(dm);
         boolean res = offs.equals(newOffs);
         return res;

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.apache.log4j.Logger;
 import org.argouml.cognitive.Designer;
@@ -61,6 +60,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
         if (!(Model.getFacade().isAPseudostate(dm))) {
             return NO_PROBLEM;
@@ -78,10 +78,10 @@
             LOG.debug("null parent state");
             return NO_PROBLEM;
         }
-        Collection peers = Model.getFacade().getSubvertices(cs);
+        
         int initialStateCount = 0;
-        for (Iterator iter = peers.iterator(); iter.hasNext();) {
-            Object sv = iter.next();
+        Collection peers = Model.getFacade().getSubvertices(cs);
+        for (Object sv : peers) {
             if (Model.getFacade().isAPseudostate(sv)
                     && Model.getFacade().equalsPseudostateKind(
                             Model.getFacade().getKind(sv),
@@ -99,6 +99,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem(java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
         ListSet offs = computeOffenders(dm);
         return new UMLToDoItem(this, offs, dsgr);
@@ -116,13 +117,12 @@
             return offs;
         }
         Collection peers = Model.getFacade().getSubvertices(cs);
-        for (Iterator iter = peers.iterator(); iter.hasNext();) {
-            Object sv = iter.next();
+        for (Object sv : peers) {
             if (Model.getFacade().isAPseudostate(sv)
                     && Model.getFacade().equalsPseudostateKind(
                             Model.getFacade().getKind(sv),
                             Model.getPseudostateKind().getShallowHistory())) {
-                offs.addElement(sv);
+                offs.add(sv);
             }
         }
         return offs;
@@ -132,12 +132,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
         if (!isActive()) {
             return false;
         }
         ListSet offs = i.getOffenders();
-        Object dm = offs.firstElement();
+        Object dm = offs.get(0);
         ListSet newOffs = computeOffenders(dm);
         boolean res = offs.equals(newOffs);
         return res;

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConflict.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.HashMap;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.Designer;
@@ -56,6 +55,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
         return computeOffenders(dm).size() > 1;
     }
@@ -64,6 +64,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
         ListSet offs = computeOffenders(dm);
         return new UMLToDoItem(this, offs, dsgr);
@@ -77,10 +78,8 @@
     protected ListSet computeOffenders(Object dm) {
         ListSet offenderResult = new ListSet();
         if (Model.getFacade().isANamespace(dm)) {
-            Iterator it = Model.getFacade().getOwnedElements(dm).iterator();
-            HashMap names = new HashMap();
-            while (it.hasNext()) {
-                Object name1Object = it.next();
+            HashMap<String, Object> names = new HashMap<String, Object>();
+            for (Object name1Object :  Model.getFacade().getOwnedElements(dm)) {
                 if (Model.getFacade().isAGeneralization(name1Object))
                     continue;
                 String name = Model.getFacade().getName(name1Object);
@@ -91,9 +90,9 @@
                 if (names.containsKey(name)) {
                     Object offender = names.get(name);
                     if (!offenderResult.contains(offender)) {
-                        offenderResult.addElement(offender);
+                        offenderResult.add(offender);
                     }
-                    offenderResult.addElement(name1Object);
+                    offenderResult.add(name1Object);
                 }
                 names.put(name, name1Object);
             }
@@ -105,20 +104,23 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-        if (!isActive())
+        if (!isActive()) {
             return false;
+        }
         ListSet offs = i.getOffenders();
 
         // first element is e.g. the class, but we need to have its namespace
         // to recompute the offenders.
-        Object f = offs.firstElement();
+        Object f = offs.get(0);
         Object ns = Model.getFacade().getNamespace(f);
-        if (!predicate(ns, dsgr))
+        if (!predicate(ns, dsgr)) {
             return false;
+        }
         ListSet newOffs = computeOffenders(ns);
         boolean res = offs.equals(newOffs);
         return res;
     }
 
-} /* end class CrNameConflict */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNameConfusion.java	2007-07-01 01:10:04-0700
@@ -117,7 +117,7 @@
 	    String compareName = meName;
 	    if (confusable(stripped2, strip(compareName))
                 && !dmNameStr.equals(compareName)) {
-		res.addElement(me2);
+		res.add(me2);
 	    }
 	}
 	return res;
@@ -127,6 +127,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	Object me = dm;
 	ListSet offs = computeOffenders(me);
@@ -137,12 +138,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) {
 	    return false;
 	}
 	ListSet offs = i.getOffenders();
-	Object dm = offs.firstElement();
+	Object dm = offs.get(0);
 	if (!predicate(dm, dsgr)) {
 	    return false;
 	}
@@ -202,6 +204,7 @@
     /*
      * @see org.argouml.cognitive.Poster#getClarifier()
      */
+    @Override
     public Icon getClarifier() {
 	return ClClassName.getTheInstance();
     }
@@ -211,10 +214,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *      org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizManyNames) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    ((WizManyNames) w).setMEs(item.getOffenders().asVector());
+	    ((WizManyNames) w).setModelElements(item.getOffenders());
 	}
     }
 
@@ -225,4 +229,4 @@
 	return WizManyNames.class;
     }
 
-} /* end class CrNameConfusion */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInsideElement.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -56,11 +55,16 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(dm instanceof UMLDeploymentDiagram)) return NO_PROBLEM;
+	if (!(dm instanceof UMLDeploymentDiagram)) {
+            return NO_PROBLEM;
+        }
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
-	if (offs == null) return NO_PROBLEM;
+	if (offs == null) {
+            return NO_PROBLEM;
+        }
 	return PROBLEM_FOUND;
     }
 
@@ -68,6 +72,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -78,10 +83,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -100,21 +108,19 @@
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
 	ListSet offs = null;
-        Iterator figIter = figs.iterator();
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
+        for (Object obj : figs) {
 	    if (!(obj instanceof FigMNode)) continue;
 	    FigMNode fn = (FigMNode) obj;
 	    if (fn.getEnclosingFig() != null) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fn);
+		offs.add(fn);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrNodeInsideElement */
+}
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceInsideElement.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -56,11 +55,16 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(dm instanceof UMLDeploymentDiagram)) return NO_PROBLEM;
+	if (!(dm instanceof UMLDeploymentDiagram)) {
+            return NO_PROBLEM;
+        }
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
-	if (offs == null) return NO_PROBLEM;
+	if (offs == null) {
+            return NO_PROBLEM;
+        }
 	return PROBLEM_FOUND;
     }
 
@@ -68,6 +72,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -78,10 +83,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -99,10 +107,8 @@
      */
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
-        Iterator figIter = figs.iterator();
 	ListSet offs = null;
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
+        for (Object obj : figs) {
 	    if (!(obj instanceof FigNodeInstance)) {
                 continue;
             }
@@ -110,12 +116,12 @@
 	    if (fn.getEnclosingFig() != null) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fn);
+		offs.add(fn);
 	    }
 	}
 	return offs;
     }
-} /* end class CrNodeInstanceInsideElement */
+}
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNodeInstanceWithoutClassifier.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -55,6 +54,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(dm instanceof UMLDeploymentDiagram)) {
 	    return NO_PROBLEM;
@@ -71,6 +71,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -81,12 +82,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) {
 	    return false;
 	}
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -104,16 +106,14 @@
      */
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
-        Iterator figIter = figs.iterator();
 	ListSet offs = null;
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
+        for (Object obj : figs) {
 	    if (!(obj instanceof FigNodeInstance)) {
 	        continue;
 	    }
 	    FigNodeInstance fn = (FigNodeInstance) obj;
 	    if (fn != null) {
-		Object noi = /*(MNodeInstance)*/ fn.getOwner();
+		Object noi = fn.getOwner();
 		if (noi != null) {
 		    Collection col = Model.getFacade().getClassifiers(noi);
 		    if (col.size() > 0) {
@@ -122,13 +122,13 @@
 		}
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fn);
+		offs.add(fn);
 	    }
 	}
 	return offs;
     }
 
 
-} /* end class CrNodeInstanceWithoutClassifier */
+} 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrNodesOverlap.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,7 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.awt.Rectangle;
-import java.util.Vector;
+import java.util.List;
 
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.Designer;
@@ -67,15 +67,18 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(dm instanceof Diagram)) return NO_PROBLEM;
+	if (!(dm instanceof Diagram)) {
+            return NO_PROBLEM;
+        }
 	Diagram d = (Diagram) dm;
 
 	// fixes bug #669. Sequencediagrams always overlap, so they shall
 	// never report a problem
-	if (dm
-	    instanceof UMLSequenceDiagram)
-	    return NO_PROBLEM;
+	if (dm instanceof UMLSequenceDiagram) {
+            return NO_PROBLEM;
+        }
 
 	ListSet offs = computeOffenders(d);
 	if (offs == null) return NO_PROBLEM;
@@ -87,6 +90,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem(java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	Diagram d = (Diagram) dm;
 	ListSet offs = computeOffenders(d);
@@ -97,10 +101,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	Diagram d = (Diagram) offs.firstElement();
+	Diagram d = (Diagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(d);
 	boolean res = offs.equals(newOffs);
@@ -113,17 +120,21 @@
      */
     public ListSet computeOffenders(Diagram d) {
 	//TODO: algorithm is n^2 in number of nodes
-	Vector figs = new Vector(d.getLayer().getContents());
+	List figs = d.getLayer().getContents();
 	int numFigs = figs.size();
 	ListSet offs = null;
 	for (int i = 0; i < numFigs - 1; i++) {
-	    Object oi = figs.elementAt(i);
-	    if (!(oi instanceof FigNode)) continue;
+	    Object oi = figs.get(i);
+	    if (!(oi instanceof FigNode)) {
+                continue;
+            }
 	    FigNode fni = (FigNode) oi;
 	    Rectangle boundsi = fni.getBounds();
 	    for (int j = i + 1; j < numFigs; j++) {
-		Object oj = figs.elementAt(j);
-		if (!(oj instanceof FigNode)) continue;
+		Object oj = figs.get(j);
+		if (!(oj instanceof FigNode)) {
+                    continue;
+                }
 		FigNode fnj = (FigNode) oj;
 		if (fnj.intersects(boundsi)) {
 		    if (!(d instanceof UMLDeploymentDiagram)) {
@@ -154,10 +165,10 @@
 		    }
 		    if (offs == null) {
 			offs = new ListSet();
-			offs.addElement(d);
+			offs.add(d);
 		    }
-		    offs.addElement(fni);
-		    offs.addElement(fnj);
+		    offs.add(fni);
+		    offs.add(fnj);
 		    break;
 		}
 	    }
@@ -165,7 +176,7 @@
 	return offs;
     }
 
-} /* end class CrNodesOverlap */
+} 
 
 
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutClassifier.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -56,8 +55,11 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(dm instanceof UMLDeploymentDiagram)) return NO_PROBLEM;
+	if (!(dm instanceof UMLDeploymentDiagram)) {
+            return NO_PROBLEM;
+        }
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
 	if (offs == null) return NO_PROBLEM;
@@ -68,6 +70,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -78,10 +81,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -99,26 +105,26 @@
      */
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
-        Iterator figIter = figs.iterator();
 	ListSet offs = null;
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
-	    if (!(obj instanceof FigObject)) continue;
+        for (Object obj : figs) {
+	    if (!(obj instanceof FigObject)) {
+                continue;
+            }
 	    FigObject fo = (FigObject) obj;
 	    if (fo != null) {
-		Object mobj = /*(MObject)*/ fo.getOwner();
+		Object mobj = fo.getOwner();
 		if (mobj != null) {
 		    Collection col = Model.getFacade().getClassifiers(mobj);
 		    if (col.size() > 0) continue;
 		}
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fo);
+		offs.add(fo);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrObjectWithoutClassifier */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrObjectWithoutComponent.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -57,6 +56,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(dm instanceof UMLDeploymentDiagram)) return NO_PROBLEM;
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
@@ -69,6 +69,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -79,10 +80,11 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) return false;
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -100,11 +102,11 @@
      */
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
-        Iterator figIter = figs.iterator();
 	ListSet offs = null;
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
-	    if (!(obj instanceof FigObject)) continue;
+        for (Object obj : figs) {
+	    if (!(obj instanceof FigObject)) {
+                continue;
+            }
 	    FigObject fo = (FigObject) obj;
 	    Fig enclosing = fo.getEnclosingFig();
 	    if (enclosing == null
@@ -113,12 +115,12 @@
 		        enclosing.getOwner())))) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(fo);
+		offs.add(fo);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrObjectWithoutComponent */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedName.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,8 @@
 
 package org.argouml.uml.cognitive.critics;
 
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.Icon;
 
@@ -44,179 +44,104 @@
  */
 public class CrReservedName extends CrUML {
 
-    ////////////////////////////////////////////////////////////////
-    // static variables
-
-    private static Vector umlReserved = new Vector();
-    private static Vector javaReserved = new Vector();
-
-    static {
-	umlReserved.addElement("none");
-	umlReserved.addElement("interface");
-	umlReserved.addElement("sequential");
-	umlReserved.addElement("guarded");
-	umlReserved.addElement("concurrent");
-	umlReserved.addElement("frozen");
-	umlReserved.addElement("aggregate");
-	umlReserved.addElement("composite");
-    }
-
-    static {
-	umlReserved.addElement("becomes");
-	umlReserved.addElement("call");
-	umlReserved.addElement("component");
-	//_umlReserved.addElement("copy");
-	//_umlReserved.addElement("create");
-	umlReserved.addElement("deletion");
-	umlReserved.addElement("derived");
-	//_umlReserved.addElement("document");
-	umlReserved.addElement("enumeration");
-	umlReserved.addElement("extends");
-    }
-
-    static {
-	umlReserved.addElement("facade");
-	//_umlReserved.addElement("file");
-	umlReserved.addElement("framework");
-	umlReserved.addElement("friend");
-	umlReserved.addElement("import");
-	umlReserved.addElement("inherits");
-	umlReserved.addElement("instance");
-	umlReserved.addElement("invariant");
-	umlReserved.addElement("library");
-	//_umlReserved.addElement("node");
-	umlReserved.addElement("metaclass");
-	umlReserved.addElement("powertype");
-	umlReserved.addElement("private");
-	umlReserved.addElement("process");
-	umlReserved.addElement("requirement");
-	//_umlReserved.addElement("send");
-	umlReserved.addElement("stereotype");
-	umlReserved.addElement("stub");
-	umlReserved.addElement("subclass");
-	umlReserved.addElement("subtype");
-	umlReserved.addElement("system");
-	umlReserved.addElement("table");
-	umlReserved.addElement("thread");
-	umlReserved.addElement("type");
-    }
-
-    static {
-	umlReserved.addElement("useCaseModel");
-	umlReserved.addElement("uses");
-	umlReserved.addElement("utility");
-	//_umlReserved.addElement("destroy");
-	umlReserved.addElement("implementationClass");
-	umlReserved.addElement("postcondition");
-	umlReserved.addElement("precondition");
-	umlReserved.addElement("topLevelPackage");
-	umlReserved.addElement("subtraction");
-
-	//     _umlReserved.addElement("initial");
-	//     _umlReserved.addElement("final");
-	//     _umlReserved.addElement("fork");
-	//     _umlReserved.addElement("join");
-	//     _umlReserved.addElement("history");
+    private static List<String> names;
+    
+    private static List<String> umlReserved = new ArrayList<String>();
+
+    static {
+	umlReserved.add("none");
+	umlReserved.add("interface");
+	umlReserved.add("sequential");
+	umlReserved.add("guarded");
+	umlReserved.add("concurrent");
+	umlReserved.add("frozen");
+	umlReserved.add("aggregate");
+	umlReserved.add("composite");
+    }
+
+    static {
+	umlReserved.add("becomes");
+	umlReserved.add("call");
+	umlReserved.add("component");
+	//umlReserved.add("copy");
+	//umlReserved.add("create");
+	umlReserved.add("deletion");
+	umlReserved.add("derived");
+	//umlReserved.add("document");
+	umlReserved.add("enumeration");
+	umlReserved.add("extends");
+    }
+
+    static {
+	umlReserved.add("facade");
+	//umlReserved.add("file");
+	umlReserved.add("framework");
+	umlReserved.add("friend");
+	umlReserved.add("import");
+	umlReserved.add("inherits");
+	umlReserved.add("instance");
+	umlReserved.add("invariant");
+	umlReserved.add("library");
+	//umlReserved.add("node");
+	umlReserved.add("metaclass");
+	umlReserved.add("powertype");
+	umlReserved.add("private");
+	umlReserved.add("process");
+	umlReserved.add("requirement");
+	//umlReserved.add("send");
+	umlReserved.add("stereotype");
+	umlReserved.add("stub");
+	umlReserved.add("subclass");
+	umlReserved.add("subtype");
+	umlReserved.add("system");
+	umlReserved.add("table");
+	umlReserved.add("thread");
+	umlReserved.add("type");
+    }
+
+    static {
+	umlReserved.add("useCaseModel");
+	umlReserved.add("uses");
+	umlReserved.add("utility");
+	//umlReserved.add("destroy");
+	umlReserved.add("implementationClass");
+	umlReserved.add("postcondition");
+	umlReserved.add("precondition");
+	umlReserved.add("topLevelPackage");
+	umlReserved.add("subtraction");
+
+	//     umlReserved.add("initial");
+	//     umlReserved.add("final");
+	//     umlReserved.add("fork");
+	//     umlReserved.add("join");
+	//     umlReserved.add("history");
     }
 
-    static {
-	javaReserved.addElement("public");
-	javaReserved.addElement("private");
-	javaReserved.addElement("protected");
-	javaReserved.addElement("package");
-	javaReserved.addElement("import");
-	javaReserved.addElement("java");
-	javaReserved.addElement("class");
-	javaReserved.addElement("interface");
-	javaReserved.addElement("extends");
-	javaReserved.addElement("implements");
-	javaReserved.addElement("native");
-	javaReserved.addElement("boolean");
-	javaReserved.addElement("void");
-	javaReserved.addElement("int");
-	javaReserved.addElement("char");
-	javaReserved.addElement("float");
-	javaReserved.addElement("long");
-	javaReserved.addElement("short");
-	javaReserved.addElement("byte");
-	javaReserved.addElement("double");
-	javaReserved.addElement("String");
-	javaReserved.addElement("Vector");
-	javaReserved.addElement("Hashtable");
-	javaReserved.addElement("Properties");
-    }
 
-    static {
-	javaReserved.addElement("null");
-	javaReserved.addElement("true");
-	javaReserved.addElement("false");
-	javaReserved.addElement("rest");
-	javaReserved.addElement("operator");
-	javaReserved.addElement("inner");
-	javaReserved.addElement("outer");
-	javaReserved.addElement("this");
-	javaReserved.addElement("super");
-	javaReserved.addElement("byvalue");
-	javaReserved.addElement("cast");
-	javaReserved.addElement("const");
-	javaReserved.addElement("future");
-	javaReserved.addElement("generic");
-	javaReserved.addElement("goto");
-	javaReserved.addElement("throws");
-	javaReserved.addElement("try");
-	javaReserved.addElement("catch");
-	javaReserved.addElement("finally");
-	javaReserved.addElement("new");
-    }
-
-    static {
-	javaReserved.addElement("synchronized");
-	javaReserved.addElement("static");
-	javaReserved.addElement("final");
-	javaReserved.addElement("abstract");
-	javaReserved.addElement("for");
-	javaReserved.addElement("if");
-	javaReserved.addElement("else");
-	javaReserved.addElement("while");
-	javaReserved.addElement("return");
-	javaReserved.addElement("continue");
-	javaReserved.addElement("break");
-	javaReserved.addElement("do");
-	javaReserved.addElement("until");
-	javaReserved.addElement("switch");
-	javaReserved.addElement("case");
-	javaReserved.addElement("default");
-	javaReserved.addElement("instanceof");
-	javaReserved.addElement("var");
-	javaReserved.addElement("volatile");
-	javaReserved.addElement("transient");
-
-	javaReserved.addElement("assert");
-    }
-
-
-
-
-    ////////////////////////////////////////////////////////////////
     /**
-     * Constructor.
+     * Default constructor.  Builds a critic that checks UML reserved names.
      */
     public CrReservedName() {
+        this(umlReserved);
+    }
+    
+    /**
+     * Construct a critic that checks against the given list of reserved names.
+     * 
+     * @param reservedNames the list of reserved names to check against.
+     */
+    public CrReservedName(List<String> reservedNames) {
         setupHeadAndDesc();
-	setPriority(ToDoItem.HIGH_PRIORITY);
-	addSupportedDecision(UMLDecision.NAMING);
-	setKnowledgeTypes(Critic.KT_SYNTAX);
-	addTrigger("name");
-	addTrigger("feature_name");
+        setPriority(ToDoItem.HIGH_PRIORITY);
+        addSupportedDecision(UMLDecision.NAMING);
+        setKnowledgeTypes(Critic.KT_SYNTAX);
+        addTrigger("name");
+        addTrigger("feature_name");
+        names = reservedNames;
     }
 
-    ////////////////////////////////////////////////////////////////
-    // Critic implementation
 
-    /*
-     * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
-     *      java.lang.Object, org.argouml.cognitive.Designer)
-     */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(Model.getFacade().isPrimaryObject(dm))) {
             return NO_PROBLEM;
@@ -238,10 +163,8 @@
             return NO_PROBLEM;
         }
 
-        Enumeration names = umlReserved.elements();
-        while (names.hasMoreElements()) {
-            String word = (String) names.nextElement();
-            if (word.equalsIgnoreCase(nameStr)) {
+        for (String name : names) {
+            if (name.equalsIgnoreCase(nameStr)) {
                 return PROBLEM_FOUND;
             }
         }
@@ -250,13 +173,13 @@
     }
 
     /**
-     * Dont critique the built-in java types, they are supposed to
-     * have those "reserved" names.
+     * Don't critique elements from the profile, they may have names
+     * which are nominally "reserved."
      *
      * @param name The name of the type to test.
      * @return true if it is a builtin.
      */
-    private boolean isBuiltin(String name) {
+    protected boolean isBuiltin(String name) {
         Project p = ProjectManager.getManager().getCurrentProject();
         Object type = p.findTypeInDefaultModel(name);
         return type != null;
@@ -266,17 +189,21 @@
     /*
      * @see org.argouml.cognitive.Poster#getClarifier()
      */
-    public Icon getClarifier() { return ClClassName.getTheInstance(); }
+    @Override
+    public Icon getClarifier() {
+        return ClClassName.getTheInstance();
+    }
 
     /*
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
 	    String sug =
-	        Model.getFacade().getName(item.getOffenders().elementAt(0));
+	        Model.getFacade().getName(item.getOffenders().get(0));
 	    String ins = super.getInstructions();
 	    ((WizMEName) w).setInstructions(ins);
 	    ((WizMEName) w).setSuggestion(sug);
@@ -287,11 +214,14 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizMEName.class;
+    }
 
     /**
      * The UID.
      */
     private static final long serialVersionUID = -5839267391209851505L;
-} /* end class CrReservedName */
+}
 

Added: trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedNameJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedNameJava.java?view=auto&rev=12950
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrReservedNameJava.java	2007-07-01 01:10:04-0700
@@ -0,0 +1,126 @@
+// $Id$
+// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.cognitive.critics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Critic to check whether the name of a ModelElement in the Model resembles or
+ * matches a Java keyword.
+ * 
+ * @author Tom Morris
+ */
+public class CrReservedNameJava extends CrReservedName {
+
+    /**
+     * Constructor.
+     */
+    public CrReservedNameJava() {
+        super(getJavaNames());
+    }
+
+    /**
+     * Return a list of Java keywords and reserved names.
+     * @return the list of names
+     */
+    private static List<String> getJavaNames() {
+
+        List<String> javaReserved = new ArrayList<String>();
+
+        javaReserved.add("public");
+        javaReserved.add("private");
+        javaReserved.add("protected");
+        javaReserved.add("package");
+        javaReserved.add("import");
+        javaReserved.add("java");
+        javaReserved.add("class");
+        javaReserved.add("interface");
+        javaReserved.add("extends");
+        javaReserved.add("implements");
+        javaReserved.add("native");
+        javaReserved.add("boolean");
+        javaReserved.add("void");
+        javaReserved.add("int");
+        javaReserved.add("char");
+        javaReserved.add("float");
+        javaReserved.add("long");
+        javaReserved.add("short");
+        javaReserved.add("byte");
+        javaReserved.add("double");
+        javaReserved.add("String");
+        javaReserved.add("Vector");
+        javaReserved.add("Hashtable");
+        javaReserved.add("Properties");
+
+        javaReserved.add("null");
+        javaReserved.add("true");
+        javaReserved.add("false");
+        javaReserved.add("rest");
+        javaReserved.add("operator");
+        javaReserved.add("inner");
+        javaReserved.add("outer");
+        javaReserved.add("this");
+        javaReserved.add("super");
+        javaReserved.add("byvalue");
+        javaReserved.add("cast");
+        javaReserved.add("const");
+        javaReserved.add("future");
+        javaReserved.add("generic");
+        javaReserved.add("goto");
+        javaReserved.add("throws");
+        javaReserved.add("try");
+        javaReserved.add("catch");
+        javaReserved.add("finally");
+        javaReserved.add("new");
+
+        javaReserved.add("synchronized");
+        javaReserved.add("static");
+        javaReserved.add("final");
+        javaReserved.add("abstract");
+        javaReserved.add("for");
+        javaReserved.add("if");
+        javaReserved.add("else");
+        javaReserved.add("while");
+        javaReserved.add("return");
+        javaReserved.add("continue");
+        javaReserved.add("break");
+        javaReserved.add("do");
+        javaReserved.add("until");
+        javaReserved.add("switch");
+        javaReserved.add("case");
+        javaReserved.add("default");
+        javaReserved.add("instanceof");
+        javaReserved.add("var");
+        javaReserved.add("volatile");
+        javaReserved.add("transient");
+
+        javaReserved.add("assert");
+
+        return javaReserved;
+    }
+
+}
+

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrSeqInstanceWithoutClassifier.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -56,8 +55,11 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(dm instanceof UMLSequenceDiagram)) return NO_PROBLEM;
+	if (!(dm instanceof UMLSequenceDiagram)) {
+            return NO_PROBLEM;
+        }
 	UMLSequenceDiagram sd = (UMLSequenceDiagram) dm;
 	ListSet offs = computeOffenders(sd);
 	if (offs == null) return NO_PROBLEM;
@@ -68,6 +70,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLSequenceDiagram sd = (UMLSequenceDiagram) dm;
 	ListSet offs = computeOffenders(sd);
@@ -78,10 +81,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	UMLSequenceDiagram sd = (UMLSequenceDiagram) offs.firstElement();
+	UMLSequenceDiagram sd = (UMLSequenceDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(sd);
 	boolean res = offs.equals(newOffs);
@@ -99,26 +105,28 @@
      */
     public ListSet computeOffenders(UMLSequenceDiagram sd) {
 	Collection figs = sd.getLayer().getContents();
-        Iterator figIter = figs.iterator();
 	ListSet offs = null;
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
-	    if (!(obj instanceof FigNodeModelElement)) continue;
+        for (Object obj : figs) {
+	    if (!(obj instanceof FigNodeModelElement)) {
+                continue;
+            }
 	    FigNodeModelElement fn = (FigNodeModelElement) obj;
 	    if (fn != null && (Model.getFacade().isAInstance(fn.getOwner()))) {
-		Object minst = /*(MInstance)*/ fn.getOwner();
+		Object minst = fn.getOwner();
 		if (minst != null) {
 		    Collection col = Model.getFacade().getClassifiers(minst);
-		    if (col.size() > 0) continue;
+		    if (col.size() > 0) {
+                        continue;
+                    }
 		}
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(sd);
+		    offs.add(sd);
 		}
-		offs.addElement(fn);
+		offs.add(fn);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrSeqInstanceWithoutClassifier */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrSubclassReference.java	2007-07-01 01:10:04-0700
@@ -27,7 +27,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.List;
 
 import org.argouml.cognitive.Critic;
@@ -63,11 +62,16 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(Model.getFacade().isAClass(dm))) return NO_PROBLEM;
-	Object cls = /*(MClass)*/ dm;
+	if (!(Model.getFacade().isAClass(dm))) {
+            return NO_PROBLEM;
+        }
+	Object cls = dm;
 	ListSet offs = computeOffenders(cls);
-	if (offs != null) return PROBLEM_FOUND;
+	if (offs != null) {
+            return PROBLEM_FOUND;
+        }
 	return NO_PROBLEM;
     }
 
@@ -75,8 +79,9 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem(java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
-	Object cls = /*(MClassifier)*/ dm;
+	Object cls = dm;
 	ListSet offs = computeOffenders(cls);
 	return new UMLToDoItem(this, offs, dsgr);
     }
@@ -85,10 +90,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	Object dm = /*(MClassifier)*/ offs.firstElement();
+	Object dm = offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dm);
 	boolean res = offs.equals(newOffs);
@@ -105,33 +113,38 @@
 
 	Enumeration descendEnum =
 	    GenDescendantClasses.getSINGLETON().gen(cls);
-	if (!descendEnum.hasMoreElements()) return null;
+	if (!descendEnum.hasMoreElements()) {
+            return null;
+        }
 	ListSet descendants = new ListSet();
 	while (descendEnum.hasMoreElements())
-	    descendants.addElement(descendEnum.nextElement());
+	    descendants.add(descendEnum.nextElement());
 
 	//TODO: GenNavigableClasses?
 	ListSet offs = null;
-	for (Iterator iter = asc.iterator(); iter.hasNext();) {
-	    Object ae = /*(MAssociationEnd)*/ iter.next();
+        for (Object ae : asc) {
 	    Object a = Model.getFacade().getAssociation(ae);
 	    List conn = new ArrayList(Model.getFacade().getConnections(a));
-	    if (conn.size() != 2) continue;
-	    Object otherEnd = /*(MAssociationEnd)*/ conn.get(0);
+	    if (conn.size() != 2) {
+                continue;
+            }
+	    Object otherEnd = conn.get(0);
 	    if (ae == conn.get(0))
-		otherEnd = /*(MAssociationEnd)*/ conn.get(1);
-	    if (!Model.getFacade().isNavigable(otherEnd)) continue;
+		otherEnd = conn.get(1);
+	    if (!Model.getFacade().isNavigable(otherEnd)) {
+                continue;
+            }
 	    Object otherCls = Model.getFacade().getType(otherEnd);
 	    if (descendants.contains(otherCls)) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(cls);
+		    offs.add(cls);
 		}
-		offs.addElement(a);
-		offs.addElement(otherCls);
+		offs.add(a);
+		offs.add(otherCls);
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrSubclassReference */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUML.java	2007-07-01 01:10:04-0700
@@ -119,6 +119,7 @@
      * 
      * MVW: Maybe we can make it part of the constructor CrUML()?
      */
+    @Override
     public final void setHeadline(String s) {
         setupHeadAndDesc();
     }
@@ -137,6 +138,7 @@
      * @see org.argouml.cognitive.critics.Critic#predicate( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate(Object dm, Designer dsgr) {
 	Project p = ProjectManager.getManager().getCurrentProject();
         if (p.isInTrash(dm)
@@ -179,7 +181,7 @@
 	    return res;
 	}
 
-        Object off1 = offs.firstElement();
+        Object off1 = offs.get(0);
 
         StringBuffer beginning = new StringBuffer("");
         int matchPos = res.indexOf(OCL_START);
@@ -223,6 +225,7 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#toDoItem(Object, Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	return new UMLToDoItem(this, dm, dsgr);
     }
@@ -244,4 +247,4 @@
      * The UID.
      */
     private static final long serialVersionUID = 1785043010468681602L;
-} /* end class CrUML */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java	2007-07-01 01:10:04-0700
@@ -101,8 +101,7 @@
 
 	// check whether constant, constants are often weird and thus not a
 	// problem
-	Object ck = Model.getFacade().getChangeability(attr);
-	if (ck != null && Model.getFacade().isFrozen(ck)) {
+	if (Model.getFacade().isReadOnly(attr)) {
 	    return NO_PROBLEM;
 	}
 
@@ -129,7 +128,7 @@
      */
     protected ListSet computeOffenders(Object dm) {
 	ListSet offs = new ListSet(dm);
-	offs.addElement(Model.getFacade().getOwner(dm));
+	offs.add(Model.getFacade().getOwner(dm));
 	return offs;
     }
 
@@ -183,7 +182,7 @@
 	    return false;
 	}
 	ListSet offs = i.getOffenders();
-	Object f = /*(MFeature)*/ offs.firstElement();
+	Object f = offs.get(0);
 	if (!predicate(f, dsgr)) {
 	    return false;
 	}
@@ -200,8 +199,7 @@
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me =
-		/*(MModelElement)*/ item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String sug = computeSuggestion(Model.getFacade().getName(me));
 	    String ins = super.getInstructions();
 	    ((WizMEName) w).setInstructions(ins);
@@ -212,11 +210,14 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizMEName.class;
+    }
 
     /**
      * The UID.
      */
     private static final long serialVersionUID = 4741909365018862474L;
 
-} /* end class CrUnconventionalAttrName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java	2007-07-01 01:10:04-0700
@@ -52,6 +52,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(Model.getFacade().isAClass(dm))
             && !(Model.getFacade().isAInterface(dm))) {
@@ -77,6 +78,7 @@
     /*
      * @see org.argouml.cognitive.Poster#getClarifier()
      */
+    @Override
     public Icon getClarifier() {
 	return ClClassName.getTheInstance();
     }
@@ -85,10 +87,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = /*(MModelElement)*/ item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String sug = Model.getFacade().getName(me);
 	    sug = computeSuggestion(sug);
 	    String ins = super.getInstructions();
@@ -119,10 +122,11 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
+    @Override
     public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
 
     /**
      * The UID.
      */
     private static final long serialVersionUID = -3341858698991522822L;
-} /* end class CrUnconventionalClassName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java	2007-07-01 01:10:04-0700
@@ -24,9 +24,6 @@
 
 package org.argouml.uml.cognitive.critics;
 
-import java.util.Collection;
-import java.util.Iterator;
-
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -55,11 +52,12 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
         if (!(Model.getFacade().isAOperation(dm))) {
             return NO_PROBLEM;
         }
-        Object oper = /*(MOperation)*/ dm;
+        Object oper = dm;
         String myName = Model.getFacade().getName(oper);
         if (myName == null || myName.equals("")) {
             return NO_PROBLEM;
@@ -70,12 +68,10 @@
         }
         char initalChar = nameStr.charAt(0);
         
-        Collection stereos = Model.getFacade().getStereotypes(oper);
-        Iterator i = stereos.iterator();
-        while (i.hasNext()) {
-            Object stereo = i.next();
+        for (Object stereo : Model.getFacade().getStereotypes(oper)) {
             if ("create".equals(Model.getFacade().getName(stereo))
-                || "constructor".equals(Model.getFacade().getName(stereo))) {
+                    || "constructor".equals(
+                            Model.getFacade().getName(stereo))) {
                 return NO_PROBLEM;
             }
         }
@@ -89,6 +85,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	Object f = dm;
 	ListSet offs = computeOffenders(f);
@@ -101,7 +98,7 @@
      */
     protected ListSet computeOffenders(Object dm) {
 	ListSet offs = new ListSet(dm);
-	offs.addElement(Model.getFacade().getOwner(dm));
+	offs.add(Model.getFacade().getOwner(dm));
 	return offs;
     }
 
@@ -109,12 +106,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) {
 	    return false;
 	}
 	ListSet offs = i.getOffenders();
-	Object f = offs.firstElement();
+	Object f = offs.get(0);
 	if (!predicate(f, dsgr)) {
 	    return false;
 	}
@@ -157,10 +155,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizOperName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = /*(MModelElement)*/ item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String sug = Model.getFacade().getName(me);
 	    sug = computeSuggestion(sug);
 	    boolean cand = candidateForConstructor(me);
@@ -189,6 +188,9 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizOperName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizOperName.class;
+    }
 
-} /* end class CrUnconventionalOperName */
+} 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java	2007-07-01 01:10:04-0700
@@ -53,6 +53,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(Model.getFacade().isAPackage(dm))) {
 	    return NO_PROBLEM;
@@ -87,10 +88,11 @@
      * @see org.argouml.cognitive.critics.Critic#initWizard(
      *         org.argouml.cognitive.ui.Wizard)
      */
+    @Override
     public void initWizard(Wizard w) {
 	if (w instanceof WizMEName) {
 	    ToDoItem item = (ToDoItem) w.getToDoItem();
-	    Object me = /*(MModelElement)*/ item.getOffenders().elementAt(0);
+	    Object me = item.getOffenders().get(0);
 	    String ins = super.getInstructions();
 	    String nameStr = Model.getFacade().getName(me);
 	    String sug = computeSuggestion(nameStr);
@@ -125,6 +127,9 @@
     /*
      * @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
      */
-    public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+    @Override
+    public Class getWizardClass(ToDoItem item) {
+        return WizMEName.class;
+    }
 
-} /* end class CrUnconventionalPackName */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrUselessAbstract.java	2007-07-01 01:10:04-0700
@@ -24,7 +24,9 @@
 
 package org.argouml.uml.cognitive.critics;
 
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.Vector;
 
 import org.argouml.cognitive.Designer;
@@ -57,17 +59,18 @@
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
     public boolean predicate2(Object dm, Designer dsgr) {
-	if (!(Model.getFacade().isAClass(dm))) return false;
-	Object cls = /*(MClass)*/ dm;
+	if (!(Model.getFacade().isAClass(dm))) {
+            return false;
+        }
+	Object cls = dm;
 	if (!Model.getFacade().isAbstract(cls))
 	    return false;  // original class was not abstract
 	ListSet derived =
 	    (new ListSet(cls)).reachable(new ChildGenDerivedClasses());
-	Enumeration subclasses = derived.elements();
-	while (subclasses.hasMoreElements()) {
-	    Object c = /*(MClass)*/ subclasses.nextElement();
-	    if (!Model.getFacade().isAbstract(c))
+        for (Object c : derived) {
+	    if (!Model.getFacade().isAbstract(c)) {
 		return false;  // found a concrete subclass
+            }
 	}
 	return true; // no concrete subclasses defined, this class is "useless"
     }
@@ -78,20 +81,18 @@
 
 class ChildGenDerivedClasses implements ChildGenerator {
     public Enumeration gen(Object o) {
-	Object c = /*(MClass)*/ o;
-	Vector specs = new Vector(Model.getFacade().getSpecializations(c));
+	Object c = o;
+	List specs = new ArrayList(Model.getFacade().getSpecializations(c));
 	if (specs == null) {
 	    return EnumerationEmpty.theInstance();
 	}
 	// TODO: it would be nice to have a EnumerationXform
 	// and a Functor object in uci.util
 	Vector specClasses = new Vector(specs.size());
-	Enumeration elems = specs.elements();
-	while (elems.hasMoreElements()) {
-	    Object g = /*(MGeneralization)*/ elems.nextElement();
+        for (Object g : specs) {
 	    Object ge = Model.getFacade().getChild(g);
 	    if (ge != null) {
-		specClasses.addElement(ge);
+		specClasses.add(ge);
 	    }
 	}
 	return specClasses.elements();

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongDepEnds.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -57,6 +56,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(dm instanceof UMLDeploymentDiagram)) {
             return NO_PROBLEM;
@@ -73,6 +73,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem( java.lang.Object,
      *      org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -83,12 +84,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
 	if (!isActive()) {
             return false;
         }
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -108,9 +110,7 @@
     public ListSet computeOffenders(UMLDeploymentDiagram dd) {
 	Collection figs = dd.getLayer().getContents();
 	ListSet offs = null;
-        Iterator figIter = figs.iterator();
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
+        for (Object obj : figs) {
 	    if (!(obj instanceof FigDependency)) {
                 continue;
             }
@@ -121,12 +121,10 @@
 	    Object dependency = figDependency.getOwner();
 	    Collection suppliers = Model.getFacade().getSuppliers(dependency);
 	    int count = 0;
-	    if (suppliers != null && (suppliers.size() > 0)) {
-		Iterator it = suppliers.iterator();
-		while (it.hasNext()) {
-		    Object moe = /*(MModelElement)*/ it.next();
+	    if (suppliers != null) {
+                for (Object moe : suppliers) {
 		    if (Model.getFacade().isAObject(moe)) {
-			Object objSup = /*(MObject)*/ moe;
+			Object objSup = moe;
 			if (Model.getFacade().getElementResidences(objSup)
 			        != null
 			    && (Model.getFacade().getElementResidences(objSup)
@@ -142,11 +140,9 @@
 	    }
 	    Collection clients = Model.getFacade().getClients(dependency);
 	    if (clients != null && (clients.size() > 0)) {
-		Iterator it = clients.iterator();
-		while (it.hasNext()) {
-		    Object moe = /*(MModelElement)*/ it.next();
+                for (Object moe : clients) {
 		    if (Model.getFacade().isAObject(moe)) {
-			Object objCli = /*(MObject)*/ moe;
+			Object objCli = moe;
 			if (Model.getFacade().getElementResidences(objCli)
 			        != null
 			    && (Model.getFacade().getElementResidences(objCli)
@@ -163,11 +159,11 @@
 	    if (count == 3) {
 		if (offs == null) {
 		    offs = new ListSet();
-		    offs.addElement(dd);
+		    offs.add(dd);
 		}
-		offs.addElement(figDependency);
-		offs.addElement(figDependency.getSourcePortFig());
-		offs.addElement(figDependency.getDestPortFig());
+		offs.add(figDependency);
+		offs.add(figDependency.getSourcePortFig());
+		offs.add(figDependency.getDestPortFig());
 	    }
 	}
 	return offs;
@@ -177,4 +173,4 @@
      * The UID.
      */
     private static final long serialVersionUID = -6587198606342935144L;
-} /* end class CrWrongDepEnds */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/CrWrongLinkEnds.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,6 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.cognitive.Designer;
 import org.argouml.cognitive.ListSet;
@@ -57,6 +56,7 @@
      * @see org.argouml.uml.cognitive.critics.CrUML#predicate2(
      *      java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean predicate2(Object dm, Designer dsgr) {
 	if (!(dm instanceof UMLDeploymentDiagram)) return NO_PROBLEM;
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
@@ -69,6 +69,7 @@
      * @see org.argouml.cognitive.critics.Critic#toDoItem(
      * java.lang.Object, org.argouml.cognitive.Designer)
      */
+    @Override
     public ToDoItem toDoItem(Object dm, Designer dsgr) {
 	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) dm;
 	ListSet offs = computeOffenders(dd);
@@ -79,10 +80,13 @@
      * @see org.argouml.cognitive.Poster#stillValid(
      *      org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)
      */
+    @Override
     public boolean stillValid(ToDoItem i, Designer dsgr) {
-	if (!isActive()) return false;
+	if (!isActive()) {
+            return false;
+        }
 	ListSet offs = i.getOffenders();
-	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.firstElement();
+	UMLDeploymentDiagram dd = (UMLDeploymentDiagram) offs.get(0);
 	//if (!predicate(dm, dsgr)) return false;
 	ListSet newOffs = computeOffenders(dd);
 	boolean res = offs.equals(newOffs);
@@ -102,9 +106,7 @@
     public ListSet computeOffenders(UMLDeploymentDiagram deploymentDiagram) {
 	Collection figs = deploymentDiagram.getLayer().getContents();
 	ListSet offs = null;
-        Iterator figIter = figs.iterator();
-	while (figIter.hasNext()) {
-	    Object obj = figIter.next();
+        for (Object obj : figs) {
 	    if (!(obj instanceof FigLink)) {
                 continue;
             }
@@ -113,10 +115,9 @@
 	    Object link = figLink.getOwner();
 	    Collection ends = Model.getFacade().getConnections(link);
 	    if (ends != null && (ends.size() > 0)) {
-		int count = 0;
-		Iterator it = ends.iterator();
-		while (it.hasNext()) {
-                    Object instance = Model.getFacade().getInstance(it.next());
+                int count = 0;       
+                for (Object end : ends) {
+                    Object instance = Model.getFacade().getInstance(end);
                     if (Model.getFacade().isAComponentInstance(instance)
                             || Model.getFacade().isANodeInstance(instance)) {
                         Collection residencies =
@@ -134,15 +135,15 @@
 		if (count == 3) {
 		    if (offs == null) {
 			offs = new ListSet();
-			offs.addElement(deploymentDiagram);
+			offs.add(deploymentDiagram);
 		    }
-		    offs.addElement(figLink);
-		    offs.addElement(figLink.getSourcePortFig());
-		    offs.addElement(figLink.getDestPortFig());
+		    offs.add(figLink);
+		    offs.add(figLink.getSourcePortFig());
+		    offs.add(figLink.getDestPortFig());
 		}
 	    }
 	}
 	return offs;
     }
 
-} /* end class CrWrongLinkEnds */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/Init.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/Init.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/Init.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/Init.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/Init.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/Init.java	2007-07-01 01:10:04-0700
@@ -439,4 +439,4 @@
 	Agency.register(new CrOppEndVsAttr(), classifierCls);
     }
 
-} /* end class Init */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/UMLWizard.java	2007-07-01 01:10:04-0700
@@ -56,10 +56,12 @@
      * Preset the number of steps to 1. You need to override this
      * method, in case your Wizard requires a different number of steps.
      * This method is a convenience implementation.
-     *
-     * @see org.argouml.cognitive.critics.Wizard#getNumSteps()
+     * 
+     * {@inheritDoc}
      */
-    public int getNumSteps() { return 1; }
+    public int getNumSteps() {
+        return 1;
+    }
 
     /**
      * @return the offending modelelement
@@ -69,7 +71,7 @@
             ToDoItem item = (ToDoItem) getToDoItem();
             ListSet offs = item.getOffenders();
             if (offs.size() >= 1) {
-                Object me = /*(MModelElement)*/ offs.elementAt(0);
+                Object me = offs.get(0);
                 return me;
             }
         }

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/WizAssocComposite.java	2007-07-01 01:10:04-0700
@@ -24,8 +24,10 @@
 
 package org.argouml.uml.cognitive.critics;
 
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
+//import java.util.Vector;
 
 import javax.swing.JPanel;
 
@@ -36,14 +38,17 @@
 
 /**
  * A non-modal wizard to assist the user in changing aggregation of an
- * association.<p>
- *
- * Earlier version always imposed composite aggregation. This version
- * allows the user to choose.<p>
- *
- * <em>Note</em>. This only applies to binary associations. A separate
- * wizard is needed for 3-way (or more) associations.<p>
- *
+ * association.
+ * <p>
+ * 
+ * Earlier version always imposed composite aggregation. This version allows the
+ * user to choose.
+ * <p>
+ * 
+ * <em>Note</em>. This only applies to binary associations. A separate wizard
+ * is needed for 3-way (or more) associations.
+ * <p>
+ * 
  * @see "ArgoUML User Manual: Two Aggregate ends (roles) in binary Association"
  * @author [email protected]
  */
@@ -51,50 +56,53 @@
     /**
      * Logger.
      */
-    private static final Logger LOG =
-	Logger.getLogger(WizAssocComposite.class);
+    private static final Logger LOG = Logger.getLogger(WizAssocComposite.class);
 
     /**
-     * The initial instructions on the Step 1 screen. May be set to a
-     * different string through {@link #setInstructions(String)}.<p>
+     * The initial instructions on the Step 1 screen. May be set to a different
+     * string through {@link #setInstructions(String)}.
+     * <p>
      */
-    private String instructions = 
-        Translator.localize("critics.WizAssocComposite-ins");
-
+    private String instructions = Translator
+            .localize("critics.WizAssocComposite-ins");
 
     /**
-     * Contains the {@link WizStepChoice} that is used to get the user's
-     * desired options. Not created until we get to that step.<p>
+     * Contains the {@link WizStepChoice} that is used to get the user's desired
+     * options. Not created until we get to that step.
+     * <p>
      */
     private WizStepChoice step1Choice = null;
 
-
     /**
-     * The Association {@link WizStepChoice} that triggered the
-     * critic. Null until set when it is first needed.<p>
+     * The Association {@link WizStepChoice} that triggered the critic. Null
+     * until set when it is first needed.
+     * <p>
      */
     private Object triggerAssociation = null;
 
-
     /**
-     * Constructor for the wizard. Currently does nothing.<p>
+     * Constructor for the wizard. Currently does nothing.
+     * <p>
      */
-    public WizAssocComposite() { }
-
+    public WizAssocComposite() {
+    }
 
     /**
-     * Tries to identify the Association that triggered the critic.<p>
-     *
-     * The first time it is called, it will initialise the trigger
-     * from the ToDoItem. If there, it is assumed to be the first
-     * trigger of the ToDoItem and to be an association. If found, the
-     * value is stored in the private field {@link #triggerAssociation}.<p>
-     *
+     * Tries to identify the Association that triggered the critic.
+     * <p>
+     * 
+     * The first time it is called, it will initialise the trigger from the
+     * ToDoItem. If there, it is assumed to be the first trigger of the ToDoItem
+     * and to be an association. If found, the value is stored in the private
+     * field {@link #triggerAssociation}.
+     * <p>
+     * 
      * On all subsequent calls, if a non-null value is found in {@link
-     * #triggerAssociation} that is returned.<p>
-     *
-     * @return  the Association that triggered the critic, or <code>null</code>
-     *          if there was none.
+     * #triggerAssociation} that is returned.
+     * <p>
+     * 
+     * @return the Association that triggered the critic, or <code>null</code>
+     *         if there was none.
      */
     private Object getTriggerAssociation() {
 
@@ -108,24 +116,25 @@
         return triggerAssociation;
     }
 
-
     /**
      * Returns a vector of options to be used in creating a {@link
-     * WizStepChoice} that will exercise the options.<p>
-     *
-     * We provide five options, shared aggregation in each direction,
-     * composite aggregation in each direction and no aggregation at
-     * all.<p>
-     *
-     * It is possible that a very malicious user could delete the
-     * triggering association just before we get to this point. For
-     * now we don't bother to trap this. It will raise an exception,
-     * and then everything will carry on happily.<p>
-     *
-     * @return  A {@link Vector} of the options or <code>null</code> if the
-     *          association that triggered the critic is no longer there.
+     * WizStepChoice} that will exercise the options.
+     * <p>
+     * 
+     * We provide five options, shared aggregation in each direction, composite
+     * aggregation in each direction and no aggregation at all.
+     * <p>
+     * 
+     * It is possible that a very malicious user could delete the triggering
+     * association just before we get to this point. For now we don't bother to
+     * trap this. It will raise an exception, and then everything will carry on
+     * happily.
+     * <p>
+     * 
+     * @return A {@link List} of the options or <code>null</code> if the
+     *         association that triggered the critic is no longer there.
      */
-    private Vector buildOptions() {
+    private List<String> buildOptions() {
 
         // The association that triggered the critic. Its just possible the
         // association is no longer there, in which case we return null
@@ -136,9 +145,7 @@
             return null;
         }
 
-        // A vector in which to build the result
-
-        Vector res = new Vector();
+        List<String> result = new ArrayList<String>();
 
         // Get the ends from the association (we know there are two), and the
         // types associated with them.
@@ -156,70 +163,66 @@
         // names
 
         String start = Translator.localize("misc.name.anon");
-        String end   = Translator.localize("misc.name.anon");
+        String end = Translator.localize("misc.name.anon");
 
-        if ((cls0 != null)
-                && (Model.getFacade().getName(cls0) != null)
+        if ((cls0 != null) && (Model.getFacade().getName(cls0) != null)
                 && (!(Model.getFacade().getName(cls0).equals("")))) {
             start = Model.getFacade().getName(cls0);
         }
 
-        if ((cls1 != null)
-                && (Model.getFacade().getName(cls1) != null)
+        if ((cls1 != null) && (Model.getFacade().getName(cls1) != null)
                 && (!(Model.getFacade().getName(cls1).equals("")))) {
             end = Model.getFacade().getName(cls1);
         }
 
         // Now create the five options
 
-        res.addElement (start 
-                + Translator.localize("critics.WizAssocComposite-option1") 
+        result.add(start
+                + Translator.localize("critics.WizAssocComposite-option1")
                 + end);
-        res.addElement (start 
-                + Translator.localize("critics.WizAssocComposite-option2") 
+        result.add(start
+                + Translator.localize("critics.WizAssocComposite-option2")
                 + end);
 
-        res.addElement (end 
-                + Translator.localize("critics.WizAssocComposite-option1") 
+        result.add(end
+                + Translator.localize("critics.WizAssocComposite-option1")
                 + start);
-        res.addElement (end 
-                + Translator.localize("critics.WizAssocComposite-option2") 
+        result.add(end
+                + Translator.localize("critics.WizAssocComposite-option2")
                 + start);
 
-        res.addElement(Translator.localize(
-                "critics.WizAssocComposite-option3"));
+        result.add(Translator.localize("critics.WizAssocComposite-option3"));
 
-        return res;
+        return result;
     }
 
     /**
-     * Set the initial instruction string for the choice. May be
-     * called by the creator of the wizard to override the default.<p>
-     *
-     * @param s The new instructions.
+     * Set the initial instruction string for the choice. May be called by the
+     * creator of the wizard to override the default.
+     * <p>
+     * 
+     * @param s
+     *            The new instructions.
      */
     public void setInstructions(String s) {
         instructions = s;
     }
 
-
     /**
-     * Create a {@link JPanel} for the given step.<p>
-     *
-     * We use a {@link WizStepChoice} to handle the choice selection
-     * for the user. We only create the panel once, saving it in a
-     * private field (<code>_step1Choice</code>) for subsequent
-     * use.<p>
-     *
-     * <em>Note</em>. If the association has been deleted, then we may
-     * not be able to create a vector of options. Under these
-     * circumstances we also return null.<p>
-     *
-     * @param  newStep  The index of the step for which a panel is needed.
-     *
-     * @return          The created {@link JPanel} or <code>null</code> if no
-     *                  options were available.
-     *
+     * Create a {@link JPanel} for the given step.
+     * <p>
+     * We use a {@link WizStepChoice} to handle the choice selection for the
+     * user. We only create the panel once, saving it in a private field 
+     * (<code>_step1Choice</code>) for subsequent use.
+     * <p>
+     * <em>Note</em>. If the association has been deleted, then we may not be
+     * able to create a vector of options. Under these circumstances we also
+     * return null.
+     * <p>
+     * 
+     * @param newStep The index of the step for which a panel is needed.
+     * @return The created {@link JPanel} or <code>null</code> if no options
+     *         were available.
      * @see org.argouml.cognitive.critics.Wizard
      */
     public JPanel makePanel(int newStep) {
@@ -232,11 +235,10 @@
             // available. Otherwise it retains its default value of null.
 
             if (step1Choice == null) {
-                Vector opts = buildOptions();
+                List<String> opts = buildOptions();
 
                 if (opts != null) {
-                    step1Choice =
-                        new WizStepChoice(this, instructions, opts);
+                    step1Choice = new WizStepChoice(this, instructions, opts);
                     step1Choice.setTarget(getToDoItem());
                 }
             }
@@ -251,26 +253,28 @@
         return null;
     }
 
-
     /**
-     * Take action at the completion of a step.<p>
-     *
-     * The guideline for ArgoUML non-modal wizards is to act
-     * immediately, not wait for the finish. This method may also be
-     * invoked when finish is triggered for any steps whose panels
-     * didn't get created.<p>
-     *
-     * The observation is that this seems to be trigged when there is
-     * any change on the panel (e.g choosing an option), not just when
-     * "next" is pressed. Coded accordingly<p>
-     *
-     * We allow for the association that caused the problem having by
-     * now been deleted, and hence an exception may be raised. We
-     * catch this politely.<p>
-     *
-     * @param  oldStep  The index of the step just completed (0 for the first
-     *                  information panel)
-     *
+     * Take action at the completion of a step.
+     * <p>
+     * 
+     * The guideline for ArgoUML non-modal wizards is to act immediately, not
+     * wait for the finish. This method may also be invoked when finish is
+     * triggered for any steps whose panels didn't get created.
+     * <p>
+     * 
+     * The observation is that this seems to be trigged when there is any change
+     * on the panel (e.g choosing an option), not just when "next" is pressed.
+     * Coded accordingly
+     * <p>
+     * 
+     * We allow for the association that caused the problem having by now been
+     * deleted, and hence an exception may be raised. We catch this politely.
+     * <p>
+     * 
+     * @param oldStep
+     *            The index of the step just completed (0 for the first
+     *            information panel)
+     * 
      * @see org.argouml.cognitive.critics.Wizard
      */
     public void doAction(int oldStep) {
@@ -291,7 +295,7 @@
 
             if (choice == -1) {
                 LOG.warn("WizAssocComposite: nothing selected, "
-			 + "should not get here");
+                        + "should not get here");
                 return;
             }
 
@@ -303,9 +307,8 @@
 
                 // Set the appropriate aggregation on each end
 
-                Iterator iter =
-		    Model.getFacade().getConnections(getTriggerAssociation())
-		    	.iterator();
+                Iterator iter = Model.getFacade().getConnections(
+                        getTriggerAssociation()).iterator();
 
                 Object ae0 = iter.next();
                 Object ae1 = iter.next();
@@ -316,58 +319,48 @@
 
                     // Start is a composite aggregation of end
 
-                    Model.getCoreHelper().setAggregation(
-			    ae0,
-			    Model.getAggregationKind().getComposite());
-                    Model.getCoreHelper().setAggregation(
-			    ae1,
-			    Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae0,
+                            Model.getAggregationKind().getComposite());
+                    Model.getCoreHelper().setAggregation(ae1,
+                            Model.getAggregationKind().getNone());
                     break;
 
                 case 1:
 
                     // Start is a shared aggregation of end
 
-                    Model.getCoreHelper().setAggregation(
-			    ae0,
-			    Model.getAggregationKind().getAggregate());
-                    Model.getCoreHelper().setAggregation(
-			    ae1,
-			    Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae0,
+                            Model.getAggregationKind().getAggregate());
+                    Model.getCoreHelper().setAggregation(ae1,
+                            Model.getAggregationKind().getNone());
                     break;
 
                 case 2:
 
                     // End is a composite aggregation of start
 
-                    Model.getCoreHelper().setAggregation(
-			    ae0,
-			    Model.getAggregationKind().getNone());
-                    Model.getCoreHelper().setAggregation(
-			    ae1,
-			    Model.getAggregationKind().getComposite());
+                    Model.getCoreHelper().setAggregation(ae0,
+                            Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae1,
+                            Model.getAggregationKind().getComposite());
                     break;
 
                 case 3:
 
                     // End is a shared aggregation of start
-                    Model.getCoreHelper().setAggregation(
-			    ae0,
-			    Model.getAggregationKind().getNone());
-                    Model.getCoreHelper().setAggregation(
-			    ae1,
-			    Model.getAggregationKind().getAggregate());
+                    Model.getCoreHelper().setAggregation(ae0,
+                            Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae1,
+                            Model.getAggregationKind().getAggregate());
                     break;
 
                 case 4:
 
                     // No aggregation
-                    Model.getCoreHelper().setAggregation(
-			    ae0,
-			    Model.getAggregationKind().getNone());
-                    Model.getCoreHelper().setAggregation(
-			    ae1,
-			    Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae0,
+                            Model.getAggregationKind().getNone());
+                    Model.getCoreHelper().setAggregation(ae1,
+                            Model.getAggregationKind().getNone());
                     break;
 
                 default:
@@ -376,8 +369,8 @@
 
                 // Someone took our association away.
 
-                LOG.error("WizAssocComposite: could not set "
-			  + "aggregation.", pve);
+                LOG.error("WizAssocComposite: could not set " + "aggregation.",
+                        pve);
             }
 
         default:
@@ -385,21 +378,21 @@
     }
 
     /**
-     * Determine if we have sufficient information to finish.<p>
-     *
-     * We can't finish if our parent {@link org.argouml.cognitive.critics.Wizard}
-     * can't finish.<p>
-     *
-     * We can finish if we're on step 0.<p>
-     *
-     * We can finish if we're on step 1 and have made a choice.<p>
-     *
-     * @return  <code>true</code> if we can finish, otherwise
-     *          <code>false</code>.
-     *
+     * Determine if we have sufficient information to finish.
+     * <p>
+     * We can't finish if our parent
+     * {@link org.argouml.cognitive.critics.Wizard} can't finish.
+     * <p>
+     * We can finish if we're on step 0.
+     * <p>
+     * We can finish if we're on step 1 and have made a choice.
+     * <p>
+     * 
+     * @return <code>true</code> if we can finish, otherwise
+     *         <code>false</code>.
      * @see org.argouml.cognitive.critics.Wizard
      */
-
+    @Override
     public boolean canFinish() {
 
         // Can't finish if our parent can't
@@ -416,9 +409,8 @@
 
         // Can finish if we're on step1 and have actually made a choice
 
-        if ((getStep() == 1)
-	    && (step1Choice != null)
-	    && (step1Choice.getSelectedIndex() != -1)) {
+        if ((getStep() == 1) && (step1Choice != null)
+                && (step1Choice.getSelectedIndex() != -1)) {
             return true;
         }
 
@@ -427,5 +419,4 @@
         return false;
     }
 
-
-} /* end class WizAssocComposite */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/WizBreakCircularComp.java	2007-07-01 01:10:04-0700
@@ -28,7 +28,6 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 
 import javax.swing.JPanel;
 
@@ -72,31 +71,31 @@
     /*
      * @see org.argouml.cognitive.ui.Wizard#getNumSteps()
      */
-    public int getNumSteps() { return 3; }
+    @Override
+    public int getNumSteps() {
+        return 3;
+    }
 
     /**
      * @return The choices for this step.
      */
-    protected Vector getOptions1() {
-	Vector res = new Vector();
+    protected List<String> getOptions1() {
+	List<String> result = new ArrayList<String>();
 	if (getToDoItem() != null) {
 	    ToDoItem item = (ToDoItem) getToDoItem();
-	    ListSet offs = item.getOffenders();
-	    int size = offs.size();
-	    for (int i = 0; i < size; i++) {
-		Object me = offs.elementAt(i);
+            for (Object me : item.getOffenders()) {
 		String s = Model.getFacade().getName(me);
-		res.addElement(s);
+		result.add(s);
 	    }
 	}
-	return res;
+	return result;
     }
 
     /**
      * @return The choices for this step.
      */
-    protected Vector getOptions2() {
-	Vector res = new Vector();
+    protected List<String> getOptions2() {
+        List<String> result = new ArrayList<String>();
 	if (selectedCls != null) {
 	    Collection aes = Model.getFacade().getAssociationEnds(selectedCls);
 	    Object fromType = selectedCls;
@@ -121,10 +120,10 @@
                     + Translator.localize("critics.WizBreakCircularComp-to")
                     + " "
                     + toName;
-		res.addElement(s);
+		result.add(s);
 	    }
 	}
-	return res;
+	return result;
     }
 
     /*
@@ -169,7 +168,7 @@
 	    if (choice == -1) {
 		throw new Error("nothing selected, should not get here");
 	    }
-	    selectedCls = offs.elementAt(choice);
+	    selectedCls = offs.get(choice);
 	    break;
 	    ////////////////
 	case 2:
@@ -212,11 +211,15 @@
     /*
      * @see org.argouml.cognitive.ui.Wizard#canGoNext()
      */
-    public boolean canGoNext() { return canFinish(); }
+    @Override
+    public boolean canGoNext() {
+        return canFinish();
+    }
 
     /*
      * @see org.argouml.cognitive.ui.Wizard#canFinish()
      */
+    @Override
     public boolean canFinish() {
 	if (!super.canFinish()) {
 	    return false;
@@ -232,4 +235,4 @@
 	}
 	return false;
     }
-} /* end class WizBreakCircularComp */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/WizManyNames.java	2007-07-01 01:10:04-0700
@@ -24,6 +24,8 @@
 
 package org.argouml.uml.cognitive.critics;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JPanel;
@@ -34,7 +36,7 @@
 import org.argouml.model.Model;
 
 /**
- * A non-modal wizard to help the user change the name of a MModelElement to a
+ * A non-modal wizard to help the user change the name of a ModelElement to a
  * better name.
  * 
  * @author jrobbins
@@ -54,7 +56,7 @@
     /**
      * A vector of model elements.
      */
-    private Vector mes;
+    private List mes;
 
     private WizStepManyTextFields step1;
 
@@ -68,20 +70,31 @@
     /**
      * @param m
      *            the offenders
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #setModelElements(List)}.
      */
+    @Deprecated
     public void setMEs(Vector m) {
-        int mSize = m.size();
+        setModelElements(m);
+    }
+
+    /**
+     * Set the list of offending ModelElements.
+     * 
+     * @param elements the list of offending ModelElements
+     */
+    public void setModelElements(List elements) {
+        int mSize = elements.size();
         for (int i = 0; i < 3 && i < mSize; ++i) {
-            if (!Model.getFacade().isAModelElement(m.get(i))) {
+            if (!Model.getFacade().isAModelElement(elements.get(i))) {
                 throw new IllegalArgumentException(
                         "The vector should contain model elements in "
                                 + "the first 3 positions");
             }
         }
 
-        mes = m;
+        mes = elements;
     }
-
+    
     /*
      * @see org.argouml.cognitive.ui.Wizard#makePanel(int)
      */
@@ -89,11 +102,11 @@
         switch (newStep) {
         case 1:
             if (step1 == null) {
-                Vector names = new Vector();
+                List<String> names = new ArrayList<String>();
                 int size = mes.size();
                 for (int i = 0; i < size; i++) {
-                    Object me = /* (MModelElement) */mes.elementAt(i);
-                    names.addElement(Model.getFacade().getName(me));
+                    Object me = mes.get(i);
+                    names.add(Model.getFacade().getName(me));
                 }
                 step1 = new WizStepManyTextFields(this, instructions, names);
             }
@@ -111,16 +124,15 @@
         LOG.debug("doAction " + oldStep);
         switch (oldStep) {
         case 1:
-            Vector newNames = null;
+            List<String> newNames = null;
             if (step1 != null) {
-                newNames = step1.getStrings();
+                newNames = step1.getStringList();
             }
             try {
                 int size = mes.size();
                 for (int i = 0; i < size; i++) {
-                    Object me = /* (MModelElement) */mes.elementAt(i);
-                    Model.getCoreHelper().setName(me,
-                            (String) newNames.elementAt(i));
+                    Object me = mes.get(i);
+                    Model.getCoreHelper().setName(me, newNames.get(i));
                 }
             } catch (Exception pve) {
                 LOG.error("could not set name", pve);
@@ -135,4 +147,4 @@
      * The UID.
      */
     private static final long serialVersionUID = -2827847568754795770L;
-} /* end class WizManyNames */
+}

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/WizNavigable.java	2007-07-01 01:10:04-0700
@@ -25,7 +25,7 @@
 package org.argouml.uml.cognitive.critics;
 
 import java.util.ArrayList;
-import java.util.Vector;
+import java.util.List;
 
 import javax.swing.JPanel;
 
@@ -64,8 +64,8 @@
     /**
      * @return the options
      */
-    public Vector getOptions() {
-	Vector res = new Vector();
+    public List<String> getOptions() {
+        List<String> result = new ArrayList<String>();
 	Object asc = getModelElement();
 	Object ae0 = 
             new ArrayList(Model.getFacade().getConnections(asc)).get(0);
@@ -84,10 +84,10 @@
                 + Model.getFacade().getName(cls1);
         }
 
-	res.addElement(option0);
-	res.addElement(option1);
-	res.addElement(option2);
-	return res;
+	result.add(option0);
+	result.add(option1);
+	result.add(option2);
+	return result;
     }
 
     /**
@@ -143,6 +143,7 @@
     /*
      * @see org.argouml.cognitive.ui.Wizard#canFinish()
      */
+    @Override
     public boolean canFinish() {
 	if (!super.canFinish()) {
             return false;

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java?view=diff&rev=12950&p1=trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java&r1=12949&r2=12950
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/WizOperName.java	2007-07-01 01:10:04-0700
@@ -24,9 +24,10 @@
 
 package org.argouml.uml.cognitive.critics;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
 
 import javax.swing.JPanel;
 
@@ -88,6 +89,7 @@
     /*
      * @see org.argouml.uml.cognitive.critics.UMLWizard#getNumSteps()
      */
+    @Override
     public int getNumSteps() {
         if (possibleConstructor) {
             return 2;
@@ -95,10 +97,10 @@
         return 1;
     }
 
-    private Vector getOptions() {
-        Vector res = new Vector();
-        res.addElement(option0);
-        res.addElement(option1);
+    private List<String> getOptions() {
+        List<String> res = new ArrayList<String>();
+        res.add(option0);
+        res.add(option1);
         return res;
     }
 
@@ -116,6 +118,7 @@
     /*
      * @see org.argouml.uml.cognitive.critics.WizMEName#makePanel(int)
      */
+    @Override
     public JPanel makePanel(int newStep) {
         if (!possibleConstructor) {
             return super.makePanel(newStep);
@@ -153,12 +156,13 @@
     /**
      * There is a possibility that the next step forward takes another path in
      * this wizard. To allow for this we must destroy the path already traveled
-     * by. TODO: I (Linus) would say that this is really a problem with the
-     * Wizard implementation since I believe it should be possible to explore a
-     * path in the wizard and then go back.
-     *
-     * @see org.argouml.cognitive.critics.Wizard#undoAction(int)
+     * by.
+     * <p>
+     * TODO: I (Linus) would say that this is really a problem with the Wizard
+     * implementation since I believe it should be possible to explore a path in
+     * the wizard and then go back. {@inheritDoc}
      */
+    @Override
     public void undoAction(int origStep) {
         super.undoAction(origStep);
         if (getStep() >= 1) {
@@ -176,6 +180,7 @@
     /*
      * @see org.argouml.uml.cognitive.critics.WizMEName#doAction(int)
      */
+    @Override
     public void doAction(int oldStep) {
         if (!possibleConstructor) {
             super.doAction(oldStep);
@@ -317,4 +322,4 @@
      * The UID.
      */
     private static final long serialVersionUID = -4013730212763172160L;
-} /* end class WizOperName */
+}
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.