< prev index next >
src/com/sun/javatest/exec/BP_TestListSubpanel.java
Print this page
@@ -442,11 +442,11 @@
return liveData.get(row);
}
} else if (column == 1) {
synchronized (liveData) {
if ((liveData.get(row)) instanceof TestResult)
- return (getSelectedProperty((TestResult) (liveData.get(row))));
+ return getSelectedProperty(liveData.get(row));
else
// should not happen
return uif.getI18NString("br.list.notAvailable.txt");
}
} else
@@ -462,11 +462,11 @@
// ---------- Custom methods for this model ----------
/**
* @param suppressNotify
* Actively request that no update be scheduled.
*/
- void addTest(Object tr, boolean suppressNotify) {
+ void addTest(TestResult tr, boolean suppressNotify) {
synchronized (vLock) {
// make sure this item is not already in the list
if (!inQueue.contains(tr) && !liveData.contains(tr))
inQueue.addElement(tr);
} // sync
@@ -487,11 +487,11 @@
* @param column
* Number of column sorting to be applied to
* @param mode
* Indicates ascending (0) or descending (1) sorting
*/
- void sortTests(LinkedList v, int column, boolean mode) {
+ void sortTests(LinkedList<TestResult> v, int column, boolean mode) {
synchronized (vLock) {
inQueue = sort(v, mode);
TableNotifier tn = new TableNotifier(subpanelNode, this);
pendingEvents.addElement(tn);
@@ -501,11 +501,11 @@
/**
* Remove the given test from the list. Ignored if the test is not in
* the list.
*/
- void removeTest(Object tr) {
+ void removeTest(TestResult tr) {
synchronized (vLock) {
rmQueue.addElement(tr);
// try not to saturate the GUI event thread
if (!isUpdateScheduled) {
TableNotifier tn = new TableNotifier(subpanelNode, this);
@@ -567,18 +567,18 @@
TableNotifier tn = (TableNotifier) (pendingEvents.get(i));
tn.cancel();
} // for
}
- inQueue = new Vector();
- rmQueue = new Vector();
- liveData = new LinkedList();
+ inQueue = new Vector<>();
+ rmQueue = new Vector<>();
+ liveData = new LinkedList<>();
isUpdateScheduled = false;
}
- private Vector sort(LinkedList v, boolean mode) {
+ private Vector<TestResult> sort(LinkedList<TestResult> v, boolean mode) {
o = new Object[v.size()];
if (SORTING_COLUMN == 0)
o = v.toArray();
@@ -610,11 +610,11 @@
else
// descending
aaa[i] = rows[rows.length - i - 1].index;
}
- Vector temp = new Vector(v.size());
+ Vector<TestResult> temp = new Vector<>(v.size());
for (int i = 0; i < v.size(); i++)
temp.addElement(v.get(aaa[i]));
return temp;
@@ -679,11 +679,11 @@
liveData.clear();
sortingRequested = false;
}
for (int i = 0; i < BATCH_SIZE; i++) {
- Object o = inQueue.remove(0);
+ TestResult o = inQueue.remove(0);
liveData.add(o);
}
// schedule a future update
@@ -733,11 +733,11 @@
private void processRemoveQueue() {
if (rmQueue.size() == 0)
return;
while (rmQueue.size() > 0) {
- TestResult target = (TestResult) (rmQueue.remove(0));
+ TestResult target = rmQueue.remove(0);
int targetIndex = liveData.indexOf(target);
if (targetIndex != -1) {
synchronized (liveData) {
// necessary for proper synchronization
// should not be a problem really, based on how other
@@ -834,17 +834,17 @@
// must sync. on vLock anytime you access inQueue or liveData
private final Object vLock = new Object(); // lock for inQueue &
// rmQueue
- private Vector inQueue; // queue of items to be added to live data
+ private Vector<TestResult> inQueue; // queue of items to be added to live data
- private Vector rmQueue; // queue of items to be removed from live data
+ private Vector<TestResult> rmQueue; // queue of items to be removed from live data
- private LinkedList liveData; // to allow manual synchronization
+ private LinkedList<TestResult> liveData; // to allow manual synchronization
- Vector pendingEvents = new Vector();
+ Vector<TableNotifier> pendingEvents = new Vector<>();
volatile boolean isUpdateScheduled; // are updates waiting in inQueue or
// rmQueue
private static final int BATCH_SIZE = 100;
@@ -1355,9 +1355,9 @@
private boolean sortingRequested = false;
private String show = TestResult.EXEC_STATUS;
- private Vector[] newData;
+ private Vector<TestResult>[] newData;
private boolean updateRequired;
}
< prev index next >