Author: tfmorris
Date: 2007-06-30 22:53:25-0700
New Revision: 12946
Modified:
trunk/src_new/org/argouml/application/Main.java
Log:
Add Java 5 generics.
Modified: trunk/src_new/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/Main.java?view=diff&rev=12946&p1=trunk/src_new/org/argouml/application/Main.java&p2=trunk/src_new/org/argouml/application/Main.java&r1=12945&r2=12946
==============================================================================
--- trunk/src_new/org/argouml/application/Main.java (original)
+++ trunk/src_new/org/argouml/application/Main.java 2007-06-30 22:53:25-0700
@@ -100,9 +100,6 @@
*/
private static final Logger LOG = Logger.getLogger(Main.class);
- ////////////////////////////////////////////////////////////////
- // constants
-
/**
* The location of the default logging configuration (.lcf) file.
*/
@@ -115,15 +112,7 @@
private static final String DEFAULT_MODEL_IMPLEMENTATION =
"org.argouml.model.mdr.MDRModelImplementation";
-
-
- ////////////////////////////////////////////////////////////////
- // static variables
-
- private static Vector postLoadActions = new Vector();
-
- ////////////////////////////////////////////////////////////////
- // main
+ private static List<Runnable> postLoadActions = new ArrayList<Runnable>();
/**
* The main entry point of ArgoUML.
@@ -184,7 +173,7 @@
boolean reloadRecent =
Configuration.getBoolean(Argo.KEY_RELOAD_RECENT_PROJECT, false);
boolean batch = false;
- List commands = new ArrayList();
+ List<String> commands = new ArrayList<String>();
String projectName = null;
@@ -554,7 +543,7 @@
* @param r a "Runnable" action
*/
public static void addPostLoadAction(Runnable r) {
- postLoadActions.addElement(r);
+ postLoadActions.add(r);
}
/**
@@ -823,17 +812,28 @@
/**
* The list of actions to perform.
*/
- private Vector postLoadActions;
+ private List<Runnable> postLoadActions;
/**
* Constructor.
*
* @param v The actions to perform.
+ * @deprecated for 0.25.4 by tfmorris. Use {@link #PostLoad(List)}.
*/
- public PostLoad(Vector v) {
- postLoadActions = v;
+ @Deprecated
+ public PostLoad(Vector<Runnable> v) {
+ this((List<Runnable>) v);
}
+ /**
+ * Constructor.
+ *
+ * @param v The actions to perform.
+ */
+ public PostLoad(List<Runnable> actions) {
+ postLoadActions = actions;
+ }
+
/*
* @see java.lang.Runnable#run()
*/
@@ -843,9 +843,7 @@
} catch (Exception ex) {
LOG.error("post load no sleep", ex);
}
- int size = postLoadActions.size();
- for (int i = 0; i < size; i++) {
- Runnable r = (Runnable) postLoadActions.elementAt(i);
+ for (Runnable r : postLoadActions) {
r.run();
try {
Thread.sleep(100);
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.