summaryrefslogtreecommitdiffstats
path: root/scripting/workben
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 14:35:04 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:45:50 +0200
commit587c59fbc931b12f4d63d077a78bcaa43ffbf83d (patch)
treec1984991960664faf41ea3e32e3804404aecb22d /scripting/workben
parentremove some unnecessary casts (diff)
downloadcore-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.tar.gz
core-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.zip
Java cleanup, Convert Vector to ArrayList
Change-Id: I323a6625f93347e69f3114fc10cb04dc759a539f
Diffstat (limited to 'scripting/workben')
-rw-r--r--scripting/workben/installer/IdeUpdater.java12
-rw-r--r--scripting/workben/installer/XmlUpdater.java12
2 files changed, 10 insertions, 14 deletions
diff --git a/scripting/workben/installer/IdeUpdater.java b/scripting/workben/installer/IdeUpdater.java
index 604decb63537..63cb0c2d389b 100644
--- a/scripting/workben/installer/IdeUpdater.java
+++ b/scripting/workben/installer/IdeUpdater.java
@@ -36,7 +36,7 @@ public class IdeUpdater extends Thread {
private JLabel statusLabel;
- private Vector<InstallListener> listeners;
+ private ArrayList<InstallListener> listeners;
private Thread internalThread;
private boolean threadSuspended;
private JProgressBar progressBar;
@@ -59,7 +59,7 @@ public class IdeUpdater extends Thread {
System.out.println( "IdeUpdater installPath is " + installPath + " isNetbeansPath is " + isNetbeansPath );
this.installPath = installPath;
this.statusLabel = statusLabel;
- listeners = new Vector<InstallListener>();
+ listeners = new ArrayList<InstallListener>();
threadSuspended = false;
progressBar=pBar;
progressBar.setStringPainted(true);
@@ -150,17 +150,15 @@ public class IdeUpdater extends Thread {
public void addInstallListener(InstallListener listener)
{
- listeners.addElement(listener);
+ listeners.add(listener);
}// addInstallListener
private void onInstallComplete()
{
- Enumeration<InstallListener> e = listeners.elements();
- while (e.hasMoreElements())
+ for( InstallListener l : listeners)
{
- InstallListener listener = e.nextElement();
- listener.installationComplete(null);
+ l.installationComplete(null);
}
}// onInstallComplete
diff --git a/scripting/workben/installer/XmlUpdater.java b/scripting/workben/installer/XmlUpdater.java
index fedd1d96ef33..884c0e323ece 100644
--- a/scripting/workben/installer/XmlUpdater.java
+++ b/scripting/workben/installer/XmlUpdater.java
@@ -33,7 +33,7 @@ public class XmlUpdater extends Thread {
private JLabel statusLabel;
- private Vector<InstallListener> listeners;
+ private ArrayList<InstallListener> listeners;
private Thread internalThread;
private boolean threadSuspended;
private JProgressBar progressBar;
@@ -102,7 +102,7 @@ public class XmlUpdater extends Thread {
this.statusLabel = statusLabel;
this.netInstall = netInstall;
this.bindingsInstall = bindingsInstall;
- listeners = new Vector<InstallListener>();
+ listeners = new ArrayList<InstallListener>();
threadSuspended = false;
progressBar=pBar;
progressBar.setStringPainted(true);
@@ -421,17 +421,15 @@ public class XmlUpdater extends Thread {
public void addInstallListener(InstallListener listener)
{
- listeners.addElement(listener);
+ listeners.add(listener);
}// addInstallListener
private void onInstallComplete()
{
- Enumeration<InstallListener> e = listeners.elements();
- while (e.hasMoreElements())
+ for (InstallListener l : listeners)
{
- InstallListener listener = e.nextElement();
- listener.installationComplete(null);
+ l.installationComplete(null);
}
}// onInstallComplete