summaryrefslogtreecommitdiff
path: root/scripting/workben
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-07 09:42:15 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-10 23:43:37 +0200
commita5ff5aad59bbe70cfaa0b18ec9df6f787a7160ca (patch)
tree6313b316dc96b82e5cafec866631d15b01a04e52 /scripting/workben
parente3d9ff3fd0b753a6712e86703e5f69392d241508 (diff)
Java5 update, Convert ArrayList and Vector code to use generics
Change-Id: I6cf6fa8e55005ffdc1d173aeee1e374efbb214fd
Diffstat (limited to 'scripting/workben')
-rw-r--r--scripting/workben/installer/Final.java2
-rw-r--r--scripting/workben/installer/IdeFinal.java2
-rw-r--r--scripting/workben/installer/IdeVersion.java15
-rw-r--r--scripting/workben/installer/InstallWizard.java6
-rw-r--r--scripting/workben/installer/Version.java15
-rw-r--r--scripting/workben/mod/_scripting/TestDataLoader.java4
6 files changed, 23 insertions, 21 deletions
diff --git a/scripting/workben/installer/Final.java b/scripting/workben/installer/Final.java
index 942103382877..95d2a39d5b05 100644
--- a/scripting/workben/installer/Final.java
+++ b/scripting/workben/installer/Final.java
@@ -76,7 +76,7 @@ public class Final extends javax.swing.JPanel implements ActionListener, Install
nav.enableNext(false);
nav.enableBack(false);
nav.enableCancel(false);
- ArrayList locations = wizard.getLocations();
+ ArrayList<?> locations = wizard.getLocations();
//System.out.println("here "+locations.size());
// Returned 1
String progpath=null;
diff --git a/scripting/workben/installer/IdeFinal.java b/scripting/workben/installer/IdeFinal.java
index 06836d3c07d9..bfc4b4b0766f 100644
--- a/scripting/workben/installer/IdeFinal.java
+++ b/scripting/workben/installer/IdeFinal.java
@@ -73,7 +73,7 @@ public class IdeFinal extends javax.swing.JPanel implements ActionListener, Inst
nav.enableNext(false);
nav.enableBack(false);
nav.enableCancel(false);
- ArrayList locations = wizard.getLocations();
+ ArrayList<?> locations = wizard.getLocations();
//System.out.println("here "+locations.size());
// Returned 1
String progpath=null;
diff --git a/scripting/workben/installer/IdeVersion.java b/scripting/workben/installer/IdeVersion.java
index ea969a0e4217..bf626a3aecba 100644
--- a/scripting/workben/installer/IdeVersion.java
+++ b/scripting/workben/installer/IdeVersion.java
@@ -22,6 +22,7 @@ import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
+
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
@@ -177,7 +178,7 @@ public class IdeVersion extends javax.swing.JPanel implements ActionListener, Ta
wizard.clearLocations();
int len = tableModel.data.size();
for (int i = 0; i < len; i++) {
- ArrayList list = (ArrayList)tableModel.data.get(i);
+ ArrayList<?> list = (ArrayList<?>)tableModel.data.get(i);
if (((Boolean)list.get(0)).booleanValue() == true)
wizard.storeLocation((String)list.get(2));
}
@@ -265,12 +266,12 @@ public class IdeVersion extends javax.swing.JPanel implements ActionListener, Ta
}
class MyTableModelIDE extends AbstractTableModel {
- ArrayList data;
+ ArrayList<ArrayList<Object>> data;
String colNames[] = {"", "IDE Name", "IDE Location"};
Object[] longValues = new Object[] {Boolean.TRUE, "Name", "Location"};
MyTableModelIDE (Properties properties, String [] validVersions) {
- data = new ArrayList();
+ data = new ArrayList<ArrayList<Object>>();
//System.out.println(properties);
int len = validVersions.length;
@@ -279,7 +280,7 @@ class MyTableModelIDE extends AbstractTableModel {
String path = null;
if ((path = properties.getProperty(key)) != null) {
- ArrayList row = new ArrayList();
+ ArrayList<Object> row = new ArrayList<Object>();
row.add(0, new Boolean(false));
row.add(1, key);
@@ -314,7 +315,7 @@ class MyTableModelIDE extends AbstractTableModel {
col < 0 || col > getColumnCount())
return null;
- ArrayList aRow = (ArrayList)data.get(row);
+ ArrayList<?> aRow = (ArrayList<?>)data.get(row);
return aRow.get(col);
}
@@ -331,7 +332,7 @@ class MyTableModelIDE extends AbstractTableModel {
}
public void setValueAt(Object value, int row, int col) {
- ArrayList aRow = (ArrayList)data.get(row);
+ ArrayList<Object> aRow = (ArrayList<Object>)data.get(row);
aRow.set(col, value);
fireTableCellUpdated(row, col);
}
@@ -343,7 +344,7 @@ class MyTableModelIDE extends AbstractTableModel {
public boolean isAnySelected() {
Iterator iter = data.iterator();
while (iter.hasNext()) {
- ArrayList row = (ArrayList)iter.next();
+ ArrayList<?> row = (ArrayList<?>)iter.next();
if (((Boolean)row.get(0)).booleanValue() == true) {
return true;
}
diff --git a/scripting/workben/installer/InstallWizard.java b/scripting/workben/installer/InstallWizard.java
index aeac007c296a..096b873b8c4f 100644
--- a/scripting/workben/installer/InstallWizard.java
+++ b/scripting/workben/installer/InstallWizard.java
@@ -89,7 +89,7 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
//setBackground(Color.WHITE);
setBackground(new Color(0,0,0));
- locations = new ArrayList();
+ locations = new ArrayList<String>();
//Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
Point center = new Point( 400, 400 );
int windowWidth=200;
@@ -208,7 +208,7 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
locations.add(path);
}
- public static ArrayList getLocations()
+ public static ArrayList<String> getLocations()
{
return locations;
}
@@ -370,7 +370,7 @@ public class InstallWizard extends javax.swing.JFrame implements ActionListener
private IdeVersion ideversion = null;
private IdeFinal idefinal = null;
private IdeWelcome idewelcome = null;
- private static ArrayList locations = null;
+ private static ArrayList<String> locations = null;
public static String VERSIONS = "VERSIONS";
public static String WELCOME = "WELCOME";
diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java
index 2a7f30be9e52..e2527823b9b7 100644
--- a/scripting/workben/installer/Version.java
+++ b/scripting/workben/installer/Version.java
@@ -22,6 +22,7 @@ import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
+
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
@@ -210,7 +211,7 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table
wizard.clearLocations();
int len = tableModel.data.size();
for (int i = 0; i < len; i++) {
- ArrayList list = (ArrayList)tableModel.data.get(i);
+ ArrayList<?> list = (ArrayList<?>)tableModel.data.get(i);
if (((Boolean)list.get(0)).booleanValue() == true)
wizard.storeLocation((String)list.get(2));
}
@@ -242,12 +243,12 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table
}
class MyTableModel extends AbstractTableModel {
- ArrayList data;
+ ArrayList<ArrayList<Object>> data;
String colNames[] = {"", "Name", "Location"};
Object[] longValues = new Object[] {Boolean.TRUE, "Name", "Location"};
MyTableModel (Properties properties, String [] validVersions) {
- data = new ArrayList();
+ data = new ArrayList<ArrayList<Object>>();
boolean isWindows =
(System.getProperty("os.name").indexOf("Windows") != -1);
int len = validVersions.length;
@@ -269,7 +270,7 @@ class MyTableModel extends AbstractTableModel {
File pkgChk = new File( pkgChkPath );
if ( pkgChk.exists() )
{
- ArrayList row = new ArrayList();
+ ArrayList<Object> row = new ArrayList<Object>();
row.add(0, new Boolean(false));
row.add(1, key);
@@ -305,7 +306,7 @@ class MyTableModel extends AbstractTableModel {
col < 0 || col > getColumnCount())
return null;
- ArrayList aRow = (ArrayList)data.get(row);
+ ArrayList<?> aRow = (ArrayList<?>)data.get(row);
return aRow.get(col);
}
@@ -322,7 +323,7 @@ class MyTableModel extends AbstractTableModel {
}
public void setValueAt(Object value, int row, int col) {
- ArrayList aRow = (ArrayList)data.get(row);
+ ArrayList<Object> aRow = data.get(row);
aRow.set(col, value);
fireTableCellUpdated(row, col);
}
@@ -334,7 +335,7 @@ class MyTableModel extends AbstractTableModel {
public boolean isAnySelected() {
Iterator iter = data.iterator();
while (iter.hasNext()) {
- ArrayList row = (ArrayList)iter.next();
+ ArrayList<?> row = (ArrayList<?>)iter.next();
if (((Boolean)row.get(0)).booleanValue() == true) {
return true;
}
diff --git a/scripting/workben/mod/_scripting/TestDataLoader.java b/scripting/workben/mod/_scripting/TestDataLoader.java
index c4a6da539df8..530b8f2d7a07 100644
--- a/scripting/workben/mod/_scripting/TestDataLoader.java
+++ b/scripting/workben/mod/_scripting/TestDataLoader.java
@@ -50,7 +50,7 @@ public class TestDataLoader {
in = new BufferedReader(new FileReader(f));
String s, previous, current;
- ArrayList list = new ArrayList(11);
+ ArrayList<Parameters> list = new ArrayList<Parameters>(11);
if ((s = in.readLine()) != null) {
StringTokenizer st = new StringTokenizer(s, ";");
@@ -70,7 +70,7 @@ public class TestDataLoader {
if (!current.equals(previous)) {
tEnv.addObjRelation(previous, list);
previous = current;
- list = new ArrayList(11);
+ list = new ArrayList<Parameters>(11);
}
list.add(getParameters(st));