svn commit: r13830 - trunk/src_new/org/argouml/language/java/generator

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-23 15:56:51-0800
New Revision: 13830

Modified:
   trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java
   trunk/src_new/org/argouml/language/java/generator/CodePiece.java
   trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java
   trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java
   trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java
   trunk/src_new/org/argouml/language/java/generator/ParseState.java
   trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java

Log:
Switch from Vector to List for implementation.

Use Java 5 generics and loops

Reduce visibility of classes which are internal use only.

Modified: trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/AnonymousClassCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -35,7 +35,7 @@
  * JavaRE - Code generation and reverse engineering for UML and Java
  * @author Marcus Andersson [email protected]
  */
-public class AnonymousClassCodePiece extends NamedCodePiece {
+class AnonymousClassCodePiece extends NamedCodePiece {
     /** The code piece this class represents. */
     private CodePiece classDef;
 
@@ -98,9 +98,9 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
-        ParseState parseState = (ParseState) parseStateStack.peek();
-        Object mClass = /*(MClass)*/
+                      Stack<ParseState> parseStateStack) throws IOException {
+        ParseState parseState = parseStateStack.peek();
+        Object mClass = 
             parseState.newClassifier((Integer.valueOf(number)).toString());
 
         if (mClass != null) {

Modified: trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/AttributeCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -27,9 +27,9 @@
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
-import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.model.Model;
 
@@ -43,7 +43,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class AttributeCodePiece extends NamedCodePiece {
+class AttributeCodePiece extends NamedCodePiece {
     /**
      * The code piece this attribute represents.
      */
@@ -52,23 +52,22 @@
     /**
      * The names of declared attributes.
      */
-    private Vector attributeNames;
+    private List<String> attributeNames;
 
     /**
        Constructor.
 
        @param modifiers The code piece for modifiers.
        @param type The code piece for the type.
-       @param names Vector with attribute names.
+       @param names List with attribute names.
     */
     public AttributeCodePiece(CodePiece modifiers,
                               CodePiece type,
-                              Vector names) {
-	attributeNames = new Vector();
+                              List<CodePiece> names) {
+	attributeNames = new ArrayList<String>();
 	attributeDef = new CompositeCodePiece(modifiers);
 	attributeDef.add(type);
-	for (Iterator i = names.iterator(); i.hasNext();) {
-	    CodePiece cp = (CodePiece) i.next();
+	for (CodePiece cp : names) {
 	    String cpText = cp.getText().toString().trim();
             if (cpText.indexOf('\n') > 0) {
                 cpText = cpText.substring(0, cpText.indexOf('\n')).trim();
@@ -137,19 +136,18 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
-	ParseState parseState = (ParseState) parseStateStack.peek();
-	Vector features = parseState.getNewFeatures();
-	int k = 1, count = attributeNames.size();
+                      Stack<ParseState> parseStateStack) throws IOException {
+	ParseState parseState = parseStateStack.peek();
+	List features = parseState.getNewFeaturesList();
+	int k = 1;
+	int count = attributeNames.size();
 	boolean found = false;
 	// there might be multiple variable declarations in one line, so loop:
-	for (Iterator i = attributeNames.iterator(); i.hasNext(); k++) {
+	for (String name : attributeNames) {
+	    k++;
 	    boolean checkAssociations = true;
-	    String name = (String) i.next();
-	    Iterator j;
 	    // now find the matching feature
-	    for (j = features.iterator(); j.hasNext();) {
-		Object mFeature = /*(MFeature)*/ j.next();
+	    for (Object mFeature : features) {
 		if (Model.getFacade().isAAttribute(mFeature)
 		        && Model.getFacade().getName(mFeature).equals(name)) {
 		    // feature found, so it's an attribute (and no
@@ -159,8 +157,7 @@
 		    // deletes feature from current ParseState
 		    parseState.newFeature(mFeature);
 
-		    Object attr = /*(MAttribute)*/ mFeature;
-		    writer.write(generator().generateCoreAttribute(attr));
+		    writer.write(generator().generateCoreAttribute(mFeature));
 
 		    if (k < count) {
 			writer.write("; "); // fixed comma separated attributes
@@ -172,19 +169,14 @@
 		// feature not found: we need to check associations,
 		// because the parser can't distinguish between attributes
 		// and associations represented as class variables:
-		Vector ends = parseState.getAssociationEnds();
+		List ends = parseState.getAssociationEndsList();
 		if (!ends.isEmpty()) {
 		    // now find the first matching association end
-		    for (j = ends.iterator(); j.hasNext();) {
-			Object associationEnd = /*(MAssociationEnd)*/ j.next();
+		    for (Object associationEnd : ends) {
 			Object association =
 			    Model.getFacade().getAssociation(associationEnd);
-			Iterator connEnum =
-			    Model.getFacade()
-			    	.getConnections(association).iterator();
-			while (connEnum.hasNext()) {
-			    Object associationEnd2 =
-				/*(MAssociationEnd)*/ connEnum.next();
+			for (Object associationEnd2 : Model.getFacade()
+                                .getConnections(association)) {
 			    if (associationEnd2 != associationEnd
 				&& Model.getFacade()
 					.isNavigable(associationEnd2)

Modified: trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/ClassCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -36,7 +36,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class ClassCodePiece extends NamedCodePiece {
+class ClassCodePiece extends NamedCodePiece {
     /** The code piece this class represents. */
     private CodePiece classDef;
 
@@ -100,9 +100,9 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
-	ParseState parseState = (ParseState) parseStateStack.peek();
-	Object mClass = /*(MClass)*/ parseState.newClassifier(name);
+                      Stack<ParseState> parseStateStack) throws IOException {
+	ParseState parseState = parseStateStack.peek();
+	Object mClass = parseState.newClassifier(name);
 
 	if (mClass != null) {
 	    parseStateStack.push(new ParseState(mClass));

Modified: trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/ClassifierEndCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -27,9 +27,8 @@
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.model.Model;
 
@@ -40,7 +39,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class ClassifierEndCodePiece extends NamedCodePiece {
+class ClassifierEndCodePiece extends NamedCodePiece {
     /**
      * The curly bracket at the end.
      */
@@ -96,15 +95,14 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
-        ParseState parseState = (ParseState) parseStateStack.pop();
+                      Stack<ParseState> parseStateStack) throws IOException {
+        ParseState parseState = parseStateStack.pop();
         Object mClassifier = parseState.getClassifier();
-        Vector newFeatures = parseState.getNewFeatures();
-        Vector newInnerClasses = parseState.getNewInnerClasses();
+        List newFeatures = parseState.getNewFeaturesList();
+        List newInnerClasses = parseState.getNewInnerClassesList();
 
         // Insert new features
-        for (Iterator i = newFeatures.iterator(); i.hasNext();) {
-            Object mFeature = /*(MFeature)*/ i.next();
+        for (Object mFeature : newFeatures) {
             if (Model.getFacade().isAOperation(mFeature)) {
                 CodeGenerator.generateOperation(mFeature,
 						mClassifier, reader, writer);
@@ -115,8 +113,7 @@
         }
 
         // Insert new inner classes
-        for (Iterator i = newInnerClasses.iterator(); i.hasNext();) {
-            Object element = /*(MModelElement)*/ i.next();
+        for (Object element : newInnerClasses) {
             if (Model.getFacade().isAClass(element)) {
                 CodeGenerator.generateClass(element, reader, writer);
             } else if (Model.getFacade().isAInterface(element)) {

Modified: trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java&p2=trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/CodeGenerator.java	2007-11-23 15:56:51-0800
@@ -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
@@ -27,10 +27,10 @@
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.model.Model;
 
@@ -59,7 +59,7 @@
 
 	ClassCodePiece ccp =
 	    new ClassCodePiece(null, Model.getFacade().getName(mClass));
-	Stack parseStateStack = new Stack();
+	Stack<ParseState> parseStateStack = new Stack<ParseState>();
 	parseStateStack.push(
 	        new ParseState(Model.getFacade().getNamespace(mClass)));
 	ccp.write(reader, writer, parseStateStack);
@@ -68,8 +68,7 @@
 
 	// Features
 	Collection features = Model.getFacade().getFeatures(mClass);
-	for (Iterator i = features.iterator(); i.hasNext();) {
-	    Object feature = /*(MFeature)*/ i.next();
+	for (Object feature : features) {
 	    if (Model.getFacade().isAOperation(feature)) {
 		generateOperation(/*(MOperation)*/ feature, mClass,
 				  reader, writer);
@@ -82,8 +81,7 @@
 
 	// Inner classes
 	Collection elements = Model.getFacade().getOwnedElements(mClass);
-	for (Iterator i = elements.iterator(); i.hasNext();) {
-	    Object element = /*(MModelElement)*/ i.next();
+	for (Object element : elements) {
 	    if (Model.getFacade().isAClass(element)) {
 		generateClass(element, reader, writer);
 	    } else if (Model.getFacade().isAInterface(element)) {
@@ -108,7 +106,7 @@
 	throws IOException {
 	InterfaceCodePiece icp =
 	    new InterfaceCodePiece(null, Model.getFacade().getName(mInterface));
-	Stack parseStateStack = new Stack();
+	Stack<ParseState> parseStateStack = new Stack<ParseState>();
 	parseStateStack.push(
 	        new ParseState(Model.getFacade().getNamespace(mInterface)));
 	icp.write(reader, writer, parseStateStack);
@@ -117,8 +115,7 @@
 
 	// Features
 	Collection features = Model.getFacade().getFeatures(mInterface);
-	for (Iterator i = features.iterator(); i.hasNext();) {
-	    Object feature = /*(MFeature)*/ i.next();
+        for (Object feature : features) {
 	    if (Model.getFacade().isAOperation(feature)) {
 		generateOperation(/*(MOperation)*/ feature,
 				  mInterface, reader, writer);
@@ -131,8 +128,7 @@
 
 	// Inner classes
 	Collection elements = Model.getFacade().getOwnedElements(mInterface);
-	for (Iterator i = elements.iterator(); i.hasNext();) {
-	    Object element = /*(MModelElement)*/ i.next();
+        for (Object element : elements) {
 	    if (Model.getFacade().isAClass(element)) {
 		generateClass(element, reader, writer);
 	    } else if (Model.getFacade().isAInterface(element)) {
@@ -164,7 +160,7 @@
 				   new SimpleCodePiece(new StringBuffer(),
 						       0, 0, 0),
 				   Model.getFacade().getName(mOperation));
-	Stack parseStateStack = new Stack();
+	Stack<ParseState> parseStateStack = new Stack<ParseState>();
 	parseStateStack.push(new ParseState(mClassifier));
 	ocp.write(reader, writer, parseStateStack);
 
@@ -192,16 +188,16 @@
 					 BufferedWriter writer)
 	throws IOException {
 
-	Vector names = new Vector();
+	List<CodePiece> names = new ArrayList<CodePiece>();
 	StringBuffer sbName =
 	    new StringBuffer(Model.getFacade().getName(mAttribute));
-	names.addElement(new SimpleCodePiece(sbName, 0, 0, 0));
+	names.add(new SimpleCodePiece(sbName, 0, 0, 0));
 	AttributeCodePiece acp =
 	    new AttributeCodePiece(null,
 				   new SimpleCodePiece(new StringBuffer(),
 						       0, 0, 0),
 				   names);
-	Stack parseStateStack = new Stack();
+	Stack<ParseState> parseStateStack = new Stack<ParseState>();
 	parseStateStack.push(new ParseState(mClassifier));
 	acp.write(reader, writer, parseStateStack);
 	writer.write(";\n");

Modified: trunk/src_new/org/argouml/language/java/generator/CodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/CodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/CodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/CodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/CodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/CodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -35,7 +35,7 @@
    code piece is going to be replaced by a string generated from the
    UML model.
 */
-public abstract class CodePiece
+abstract class CodePiece
 {
     /**
      * @return the string representation for this piece of code

Modified: trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java&p2=trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/CodePieceCollector.java	2007-11-23 15:56:51-0800
@@ -27,14 +27,14 @@
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.FileInputStream;
 import java.io.InputStreamReader;
-import java.util.Iterator;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.application.api.Argo;
 import org.argouml.configuration.Configuration;
@@ -49,15 +49,15 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class CodePieceCollector {
+class CodePieceCollector {
     /** Code pieces the parser found. */
-    private Vector codePieces;
+    private List<NamedCodePiece> codePieces;
 
     /**
        Constructor.
     */
     public CodePieceCollector() {
-	codePieces = new Vector();
+	codePieces = new ArrayList<NamedCodePiece>();
     }
 
     /**
@@ -70,15 +70,15 @@
 	int index = 0;
 
 	// Insert in sorted order
-	for (Iterator i = codePieces.iterator(); i.hasNext(); index++) {
-	    CodePiece cp = (CodePiece) i.next();
+        for (NamedCodePiece cp : codePieces) {
+            index++;
 	    if (cp.getStartLine() > codePiece.getStartLine()
 		|| (cp.getStartLine() == codePiece.getStartLine()
 		    && cp.getStartPosition() > codePiece.getStartPosition())) {
 		break;
 	    }
 	}
-	codePieces.insertElementAt(codePiece, index);
+	codePieces.add(index, codePiece);
     }
 
     /**
@@ -110,11 +110,10 @@
 	    new BufferedWriter(new OutputStreamWriter(out, encoding));
 	int line = 0;
 	int column = 0;
-	Stack parseStateStack = new Stack();
+	Stack<ParseState> parseStateStack = new Stack<ParseState>();
 	parseStateStack.push(new ParseState(mNamespace));
 
-	for (Iterator i = codePieces.iterator(); i.hasNext();) {
-	    NamedCodePiece cp = (NamedCodePiece) i.next();
+	for (NamedCodePiece cp : codePieces) {
 	    // copy until code piece
 	    while (line < cp.getStartLine()) {
 		line++;

Modified: trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/CompositeCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -27,19 +27,19 @@
   Author: Marcus Andersson [email protected]
 */
 
-
 package org.argouml.language.java.generator;
 
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
 
 /**
    This piece of code is a composition of several adjacent pieces of
    code. The code piece can have holes.
 */
-public class CompositeCodePiece extends CodePiece {
+class CompositeCodePiece extends CodePiece {
     /** The code pieces this code piece consists of. */
-    private Vector codePieces;
+    private List<CodePiece> codePieces;
 
     /**
      * Create a composite piece of code.
@@ -48,9 +48,9 @@
      *            A starter code piece.
      */
     public CompositeCodePiece(CodePiece codePiece) {
-	codePieces = new Vector();
+	codePieces = new ArrayList<CodePiece>();
 	if (codePiece != null) {
-	    codePieces.addElement(codePiece);
+	    codePieces.add(codePiece);
 	}
     }
 
@@ -61,7 +61,7 @@
      */
     public void add(CodePiece codePiece) {
 	if (codePiece != null) {
-	    codePieces.addElement(codePiece);
+	    codePieces.add(codePiece);
 	}
     }
 
@@ -69,14 +69,15 @@
      * @see org.argouml.language.java.generator.CodePiece#getText()
      */
     public StringBuffer getText() {
-	Iterator i = codePieces.iterator();
-	CodePiece cp = (CodePiece) i.next();
+	Iterator<CodePiece> i = codePieces.iterator();
+	CodePiece cp = i.next();
+	
 	StringBuffer text = cp.getText();
 	int prevEnd = cp.getEndPosition();
 	int prevLine = cp.getEndLine();
 
-	for (; i.hasNext();) {
-	    cp = (CodePiece) i.next();
+	while(i.hasNext()) {
+	    cp = i.next();
 	    int spaces = cp.getStartPosition() - prevEnd;
 	    if (prevLine != cp.getStartLine()) {
 		text.append('\n');
@@ -97,7 +98,7 @@
      */
     public int getStartPosition() {
 	if (codePieces.size() > 0) {
-	    return ((CodePiece) codePieces.firstElement()).getStartPosition();
+	    return codePieces.get(0).getStartPosition();
         }
         return 0;
     }
@@ -107,7 +108,7 @@
      */
     public int getEndPosition() {
 	if (codePieces.size() > 0) {
-	    return ((CodePiece) codePieces.lastElement()).getEndPosition();
+            return codePieces.get(codePieces.size() - 1).getEndPosition();
         }
 	return 0;
     }
@@ -117,7 +118,7 @@
      */
     public int getStartLine() {
 	if (codePieces.size() > 0) {
-	    return ((CodePiece) codePieces.firstElement()).getStartLine();
+	    return codePieces.get(0).getStartLine();
         }
         return 0;
     }
@@ -127,7 +128,7 @@
      */
     public int getEndLine() {
 	if (codePieces.size() > 0) {
-	    return ((CodePiece) codePieces.lastElement()).getEndLine();
+	    return codePieces.get(codePieces.size() - 1).getEndLine();
         }
         return 0;
     }

Modified: trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java&p2=trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/GeneratorJava.java	2007-11-23 15:56:51-0800
@@ -363,135 +363,103 @@
     private String generateImports(Object cls, String packagePath) {
         // TODO: check also generalizations
         StringBuffer sb = new StringBuffer(80);
-        HashSet importSet = new java.util.HashSet();
-        String ftype;
-        Iterator j;
-        Collection c = Model.getFacade().getFeatures(cls);
-        if (c != null) {
-            // now check packages of all feature types
-            for (j = c.iterator(); j.hasNext();) {
-                Object mFeature = j.next();
-                if (Model.getFacade().isAAttribute(mFeature)) {
-                    ftype =
-                            generateImportType(Model.getFacade().getType(
-                                    mFeature), packagePath);
+        HashSet<String> importSet = new java.util.HashSet<String>();
+
+        // now check packages of all feature types
+        for (Object mFeature : Model.getFacade().getFeatures(cls)) {
+            if (Model.getFacade().isAAttribute(mFeature)) {
+                String ftype = generateImportType(Model.getFacade().getType(
+                        mFeature), packagePath);
+                if (ftype != null) {
+                    importSet.add(ftype);
+                }
+            } else if (Model.getFacade().isAOperation(mFeature)) {
+                // check the parameter types
+                for (Object parameter : Model.getFacade().getParameters(
+                        mFeature)) {
+                    String ftype = generateImportType(Model.getFacade()
+                            .getType(parameter), packagePath);
                     if (ftype != null) {
                         importSet.add(ftype);
                     }
-                } else if (Model.getFacade().isAOperation(mFeature)) {
-                    // check the parameter types
-                    Iterator it =
-			Model.getFacade().getParameters(mFeature).iterator();
-                    while (it.hasNext()) {
-                        Object parameter = it.next();
-			ftype =
-			    generateImportType(Model.getFacade()
-			        .getType(parameter), packagePath);
-			if (ftype != null) {
-                            importSet.add(ftype);
-                        }
-                    }
+                }
 
-                    // check the return parameter types
-                    it =
-                        Model.getCoreHelper().getReturnParameters(mFeature)
-			            .iterator();
-                    while (it.hasNext()) {
-                        Object parameter = it.next();
-			ftype =
-			    generateImportType(Model.getFacade()
-			        .getType(parameter), packagePath);
-                        if (ftype != null) {
-                            importSet.add(ftype);
-                        }
+                // check the return parameter types
+                for (Object parameter 
+                        : Model.getCoreHelper().getReturnParameters(mFeature)) {
+                    String ftype = generateImportType(Model.getFacade()
+                            .getType(parameter), packagePath);
+                    if (ftype != null) {
+                        importSet.add(ftype);
                     }
+                }
 
-		    // check raised signals
-		    it =
-		        Model.getFacade().getRaisedSignals(mFeature).iterator();
-		    while (it.hasNext()) {
-			Object signal = it.next();
-			if (!Model.getFacade().isAException(signal)) {
-			    continue;
-			}
-
-			ftype =
-			    generateImportType(Model.getFacade()
-			        .getType(signal), packagePath);
-			if (ftype != null) {
-			    importSet.add(ftype);
-			}
-		    }
+                // check raised signals
+                for (Object signal 
+                        : Model.getFacade().getRaisedSignals(mFeature)) {
+                    if (!Model.getFacade().isAException(signal)) {
+                        continue;
+                    }
+                    String ftype = generateImportType(Model.getFacade()
+                            .getType(signal), packagePath);
+                    if (ftype != null) {
+                        importSet.add(ftype);
+                    }
                 }
             }
-        }
 
-	c = Model.getFacade().getGeneralizations(cls);
-	if (c != null) {
-	    // now check packages of all generalized types
-	    for (j = c.iterator(); j.hasNext();) {
-		Object gen = j.next();
-		Object parent = Model.getFacade().getGeneral(gen);
-		if (parent == cls) {
-		    continue;
-		}
+        }
 
-		ftype = generateImportType(parent, packagePath);
-		if (ftype != null) {
-		    importSet.add(ftype);
-		}
-	    }
-	}
+        for (Object gen : Model.getFacade().getGeneralizations(cls)) {
+            Object parent = Model.getFacade().getGeneral(gen);
+            if (parent == cls) {
+                continue;
+            }
+
+            String ftype = generateImportType(parent, packagePath);
+            if (ftype != null) {
+                importSet.add(ftype);
+            }
+        }
 
-	c = Model.getFacade().getSpecifications(cls);
-	if (c != null) {
-	    // now check packages of the interfaces
-	    for (j = c.iterator(); j.hasNext();) {
-		Object iface = j.next();
-
-		ftype = generateImportType(iface, packagePath);
-		if (ftype != null) {
-		    importSet.add(ftype);
-		}
-	    }
-	}
+        // now check packages of the interfaces
+        for (Object iface : Model.getFacade().getSpecifications(cls)) {
+            String ftype = generateImportType(iface, packagePath);
+            if (ftype != null) {
+                importSet.add(ftype);
+            }
+        }
 
-        c = Model.getFacade().getAssociationEnds(cls);
-        if (!c.isEmpty()) {
-            // check association end types
-            for (j = c.iterator(); j.hasNext();) {
-                Object associationEnd = j.next();
-                Object association =
-                    Model.getFacade().getAssociation(associationEnd);
-                Iterator connEnum =
-		    Model.getFacade().getConnections(association).iterator();
-                while (connEnum.hasNext()) {
-                    Object associationEnd2 = connEnum.next();
-                    if (associationEnd2 != associationEnd
-                            && Model.getFacade().isNavigable(associationEnd2)
-                            && !Model.getFacade().isAbstract(
-                                    Model.getFacade().getAssociation(
-                                            associationEnd2))) {
-                        // association end found
-                        if (Model.getFacade().getUpper(associationEnd2) != 1) {
-                            importSet.add("java.util.Vector");
-                        } else {
-			    ftype =
-				generateImportType(Model.getFacade().getType(
-				        associationEnd2),
-						   packagePath);
-			    if (ftype != null) {
-				importSet.add(ftype);
-			    }
+        // check association end types
+        for (Object associationEnd : Model.getFacade().getAssociationEnds(cls)) {
+            Object association =
+                Model.getFacade().getAssociation(associationEnd);
+            for (Object associationEnd2 
+                    : Model.getFacade().getConnections(association)) {
+                if (associationEnd2 != associationEnd
+                        && Model.getFacade().isNavigable(associationEnd2)
+                        && !Model.getFacade().isAbstract(
+                                Model.getFacade().getAssociation(
+                                        associationEnd2))) {
+                    // association end found
+                    if (Model.getFacade().getUpper(associationEnd2) != 1) {
+                        importSet.add("java.util.Vector");
+                    } else {
+                        String ftype =
+                            generateImportType(Model.getFacade().getType(
+                                    associationEnd2),
+                                    packagePath);
+                        if (ftype != null) {
+                            importSet.add(ftype);
                         }
                     }
                 }
             }
+
         }
         // finally generate the import statements
-        for (j = importSet.iterator(); j.hasNext();) {
-            ftype = (String) j.next();
-            sb.append("import ").append(ftype).append(";");
+        for (String importType : importSet) {
+            sb.append("import ").append(importType).append(";");
 	    sb.append(LINE_SEPARATOR);
         }
         if (!importSet.isEmpty()) {
@@ -553,10 +521,8 @@
         String nameStr = null;
         boolean constructor = false;
 
-        Iterator its = Model.getFacade().getStereotypes(op).iterator();
-        String name = "";
-        while (its.hasNext()) {
-            Object o = its.next();
+        String name = null;
+        for (Object o : Model.getFacade().getStereotypes(op)) {
             name = Model.getFacade().getName(o);
             if ("create".equals(name)) {
 		break;
@@ -633,6 +599,7 @@
 	if (!c.isEmpty()) {
 	    Iterator it = c.iterator();
 	    boolean first = true;
+	    
 	    while (it.hasNext()) {
 		Object signal = it.next();
 
@@ -721,18 +688,12 @@
         sb.append("package ").append(packName).append(" {");
 	sb.append(LINE_SEPARATOR);
         Collection ownedElements = Model.getFacade().getOwnedElements(p);
-        if (ownedElements != null) {
-            Iterator ownedEnum = ownedElements.iterator();
-            while (ownedEnum.hasNext()) {
-                Object modelElement = ownedEnum.next();
-                // This is the only remaining references to generate(), if it
-                // can be made more specific, we can remove that method - tfm
-                // (do we support anything other than classifiers in a package?)
-                sb.append(generate(modelElement));
-                sb.append(LINE_SEPARATOR).append(LINE_SEPARATOR);
-            }
-        } else {
-            sb.append("(no elements)");
+        for (Object modelElement : ownedElements) {
+            // This is the only remaining references to generate(), if it
+            // can be made more specific, we can remove that method - tfm
+            // (do we support anything other than classifiers in a package?)
+            sb.append(generate(modelElement));
+            sb.append(LINE_SEPARATOR).append(LINE_SEPARATOR);
         }
         sb.append(LINE_SEPARATOR).append("})").append(LINE_SEPARATOR);
         return sb.toString();
@@ -743,7 +704,7 @@
      * everything from the preceding javadoc comment to the opening curly brace.
      * Start sequences are non-empty for classes and interfaces only.
      *
-     * This method is intented for package internal usage only.
+     * This method is intended for package internal usage only.
      *
      * @param cls the classifier for which to generate the start sequence
      *
@@ -908,20 +869,18 @@
             String tv = null; // helper for tagged values
 
             // add attributes
-            Collection strs = Model.getFacade().getStructuralFeatures(cls);
+            Collection sFeatures = 
+                Model.getFacade().getStructuralFeatures(cls);
 
-            if (!strs.isEmpty()) {
+            if (!sFeatures.isEmpty()) {
                 sb.append(LINE_SEPARATOR);
                 if (verboseDocs && Model.getFacade().isAClass(cls)) {
                     sb.append(INDENT).append("// Attributes");
 		    sb.append(LINE_SEPARATOR);
                 }
 
-                Iterator strEnum = strs.iterator();
 		boolean first = true;
-                while (strEnum.hasNext()) {
-                    Object structuralFeature = strEnum.next();
-
+		for (Object structuralFeature : sFeatures) {
 		    if (!first) {
 			sb.append(LINE_SEPARATOR);
 		    }
@@ -946,9 +905,7 @@
 		    sb.append(LINE_SEPARATOR);
                 }
 
-                Iterator endEnum = ends.iterator();
-                while (endEnum.hasNext()) {
-                    Object associationEnd = endEnum.next();
+                for (Object associationEnd : ends) {
                     Object association =
 			Model.getFacade().getAssociation(associationEnd);
 
@@ -975,19 +932,17 @@
 
             // add operations
             // TODO: constructors
-            Collection behs = Model.getFacade().getOperations(cls);
+            Collection bFeatures = Model.getFacade().getOperations(cls);
 
-            if (!behs.isEmpty()) {
+            if (!bFeatures.isEmpty()) {
                 sb.append(LINE_SEPARATOR);
                 if (verboseDocs) {
                     sb.append(INDENT).append("// Operations");
 		    sb.append(LINE_SEPARATOR);
                 }
 
-                Iterator behEnum = behs.iterator();
 		boolean first = true;
-                while (behEnum.hasNext()) {
-                    Object behavioralFeature = behEnum.next();
+		for (Object behavioralFeature : bFeatures) {
 
 		    if (!first) {
                         sb.append(LINE_SEPARATOR);
@@ -1043,13 +998,7 @@
     private String generateMethodBody(Object op) {
         //cat.info("generateMethodBody");
         if (op != null) {
-            Collection methods = Model.getFacade().getMethods(op);
-            Iterator i = methods.iterator();
-            Object m = null;
-
-            while (i != null && i.hasNext()) {
-                m = i.next();
-
+            for (Object m : Model.getFacade().getMethods(op)) {
                 if (m != null) {
                     if (Model.getFacade().getBody(m) != null) {
                         String body =
@@ -1385,9 +1334,7 @@
         }
 
         tudresden.ocl.check.types.ModelFacade mf = new ArgoFacade(me);
-        for (Iterator i = cConstraints.iterator(); i.hasNext();) {
-            Object constraint = i.next();
-
+        for (Object constraint : cConstraints) {
             try {
 		String body =
 		    (String) Model.getFacade().getBody(
@@ -1418,9 +1365,7 @@
         StringBuffer sb = new StringBuffer(80);
 
         Collection connections = Model.getFacade().getConnections(a);
-        Iterator connEnum = connections.iterator();
-        while (connEnum.hasNext()) {
-            Object associationEnd2 = connEnum.next();
+        for (Object associationEnd2 : connections) {
             if (associationEnd2 != associationEnd) {
                 sb.append(INDENT);
 		sb.append(
@@ -1498,9 +1443,7 @@
             return "";
         }
         Collection classes = new ArrayList();
-        Iterator it = generalizations.iterator();
-        while (it.hasNext()) {
-            Object generalization = it.next();
+        for (Object generalization : generalizations) {
             Object generalizableElement =
                 Model.getFacade().getGeneral(generalization);
             // assert ge != null
@@ -2113,8 +2056,8 @@
             boolean deps) {
         LOG.debug("generateFiles() called");
         // TODO: 'deps' is ignored here
-        for (Iterator it = elements.iterator(); it.hasNext();) {
-            generateFile(it.next(), path);
+        for (Object element : elements) {
+            generateFile(element, path);
         }
         return TempFileUtils.readFileNames(new File(path));
     }
@@ -2128,8 +2071,8 @@
         File tmpdir = null;
         try {
             tmpdir = TempFileUtils.createTempDir();
-            for (Iterator it = elements.iterator(); it.hasNext();) {
-                generateFile(it.next(), tmpdir.getName());
+            for (Object element : elements) {
+                generateFile(element, tmpdir.getName());
             }
             return TempFileUtils.readFileNames(tmpdir);
         } finally {

Modified: trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/InterfaceCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -38,7 +38,7 @@
 /**
    This code piece represents an interface declaration.
 */
-public class InterfaceCodePiece extends NamedCodePiece {
+class InterfaceCodePiece extends NamedCodePiece {
     /** The code piece this interface represents. */
     private CodePiece interfaceDef;
 
@@ -98,9 +98,9 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
-        ParseState parseState = (ParseState) parseStateStack.peek();
-        Object mInterface = /*(MInterface)*/ parseState.newClassifier(name);
+                      Stack<ParseState> parseStateStack) throws IOException {
+        ParseState parseState = parseStateStack.peek();
+        Object mInterface = parseState.newClassifier(name);
 
 	if (mInterface != null) {
 	    parseStateStack.push(new ParseState(mInterface));

Modified: trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/NamedCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -39,7 +39,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public abstract class NamedCodePiece extends CodePiece {
+abstract class NamedCodePiece extends CodePiece {
     /**
      * Write the code this piece represents to file. The stack in the
      * parameter list contains the parser state when traversing up and
@@ -57,13 +57,13 @@
      */
     public abstract void write(BufferedReader reader,
                                BufferedWriter writer,
-                               Stack parseStateStack) throws IOException;
+                               Stack<ParseState> parseStateStack) throws IOException;
 
     /**
      * Read until the end of the code piece. As a precondition, the reader
      * must be positioned at the beginning of the code piece. If a writer
      * is given (not <tt>null</tt>), then everything that's read is written
-     * to the writer. (Ususally, both reader and writer point to the same
+     * to the writer. (Usually, both reader and writer point to the same
      * file).
      *
      * @param reader Read original code from this.

Modified: trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/OperationCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -27,9 +27,8 @@
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Stack;
-import java.util.Vector;
 
 import org.argouml.model.Model;
 
@@ -40,7 +39,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class OperationCodePiece extends NamedCodePiece {
+class OperationCodePiece extends NamedCodePiece {
     /**
      * The code piece this operation represents.
      */
@@ -115,18 +114,17 @@
      */
     public void write (BufferedReader reader,
                        BufferedWriter writer,
-                       Stack parseStateStack) throws IOException {
-        ParseState parseState = (ParseState) parseStateStack.peek();
-        Vector features = parseState.getNewFeatures();
+                       Stack<ParseState> parseStateStack) throws IOException {
+        ParseState parseState = parseStateStack.peek();
+        List features = parseState.getNewFeaturesList();
         boolean found = false;
 
-        for (Iterator j = features.iterator(); j.hasNext() && !found;) {
-            Object feature = /*(MFeature)*/ j.next();
+        for (Object feature : features) {
             if (Model.getFacade().getName(feature).equals(name)
                     && Model.getFacade().isAOperation(feature)) {
                 found = true;
                 parseState.newFeature(feature);
-                Object mOperation = /*(MOperation)*/ feature;
+                Object mOperation = feature;
                 writer.write(GeneratorJava.getInstance()
 			     .generateOperation(mOperation, true));
             }

Modified: trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/PackageCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -38,7 +38,7 @@
  *
  * @author Marcus Andersson [email protected]
  */
-public class PackageCodePiece extends NamedCodePiece {
+class PackageCodePiece extends NamedCodePiece {
     /**
      * The code piece for the package identifier.
      */
@@ -94,9 +94,9 @@
      */
     public void write(BufferedReader reader,
                       BufferedWriter writer,
-                      Stack parseStateStack) throws IOException {
+                      Stack<ParseState> parseStateStack) throws IOException {
 
-	ParseState parseState = (ParseState) parseStateStack.peek();
+	ParseState parseState = parseStateStack.peek();
 	Object mNamespace = parseState.getNamespace();
 
 	if (!(Model.getFacade().isAModel(mNamespace))) {

Modified: trunk/src_new/org/argouml/language/java/generator/ParseState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/ParseState.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/ParseState.java&p2=trunk/src_new/org/argouml/language/java/generator/ParseState.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/ParseState.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/ParseState.java	2007-11-23 15:56:51-0800
@@ -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
@@ -30,6 +30,9 @@
 
 package org.argouml.language.java.generator;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.Vector;
 
 import org.argouml.model.Model;
@@ -46,12 +49,12 @@
     /**
      * The inner classes not found yet.
      */
-    private Vector newInnerClasses;
+    private List newInnerClasses;
 
     /**
      * The features not found yet.
      */
-    private Vector newFeatures;
+    private List newFeatures;
 
     /**
      * The current classifier.
@@ -68,14 +71,14 @@
             this.mClassifier = handle;
             namespace = handle;
             newFeatures =
-                new Vector(Model.getFacade().getFeatures(mClassifier));
+                new ArrayList(Model.getFacade().getFeatures(mClassifier));
             newInnerClasses =
-                new Vector(Model.getFacade().getOwnedElements(mClassifier));
+                new ArrayList(Model.getFacade().getOwnedElements(mClassifier));
         } else {
             this.mClassifier = null;
             namespace = handle;
-            newFeatures = new Vector();
-            newInnerClasses = new Vector();
+            newFeatures = new ArrayList();
+            newInnerClasses = new ArrayList();
         }
     }
 
@@ -114,23 +117,46 @@
 
     /**
      * Get all features not in the source.
-     *
+     * 
      * @return all features not in the source
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #getNewFeaturesList()}.
      */
+    @Deprecated
     public Vector getNewFeatures() {
 	return new Vector(newFeatures);
     }
 
     /**
-     * Get all inner classes not in the source.
+     * Get all features not in the source.
      *
+     * @return all features not in the source
+     */
+    List getNewFeaturesList() {
+        return newFeatures;
+    }
+    
+    /**
+     * Get all inner classes not in the source.
+     * 
      * @return all inner classes not in the source
+     * @deprecated for 0.25.4 by tfmorris. Use
+     *             {@link #getNewInnerClassesList()}.
      */
+    @Deprecated
     public Vector getNewInnerClasses() {
 	return new Vector(newInnerClasses);
     }
 
     /**
+     * Get all inner classes not in the source.
+     *
+     * @return all inner classes not in the source
+     */
+    List getNewInnerClassesList() {
+        return newInnerClasses;
+    }
+    
+    /**
      * Get the current namespace.
      *
      * @return the current namespace
@@ -143,7 +169,10 @@
      * Get the association ends.
      *
      * @return the association ends
+     * @deprecated for 0.25.4 by tfmorris. Use
+     *             {@link #getAssociationEndsList()}.
      */
+    @Deprecated
     public Vector getAssociationEnds() {
         Vector result = new Vector();
         if (mClassifier == null) {
@@ -152,4 +181,18 @@
         result.addAll(Model.getFacade().getAssociationEnds(mClassifier));
         return result;
     }
+    
+    /**
+     * Get the association ends.
+     *
+     * @return the association ends
+     */
+    List getAssociationEndsList() {
+        if (mClassifier == null) {
+            return Collections.EMPTY_LIST;
+        }
+        List result = new ArrayList();
+        result.addAll(Model.getFacade().getAssociationEnds(mClassifier));
+        return result;
+    }
 }

Modified: trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java?view=diff&rev=13830&p1=trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java&p2=trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java&r1=13829&r2=13830
==============================================================================
--- trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java	(original)
+++ trunk/src_new/org/argouml/language/java/generator/SimpleCodePiece.java	2007-11-23 15:56:51-0800
@@ -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
@@ -33,7 +33,7 @@
 /**
    This piece of code is just one token.
 */
-public class SimpleCodePiece extends CodePiece
+class SimpleCodePiece extends CodePiece
 {
     private StringBuffer text;
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.