< prev index next >

## src/com/sun/javatest/agent/AgentPanel.java

Print this page

    @@ -688,11 +688,11 @@
             }

             public synchronized void addTask(TaskState task) {
                 if (tasks.size() >= maxTasks) {
                     for (int i = 0; i < tasks.size(); i++) {
    -                    String s = (String) getItem(i);
    +                    String s = getItem(i);
                         // skip over active tasks that will be updated later
                         if (s.startsWith("CONN") || s.startsWith("EXEC"))
                             continue;

                         tasks.removeElementAt(i);

    @@ -704,19 +704,19 @@
                 super.add("CONN " + task.connection.getName());
             }

             public synchronized TaskState getTask(Connection c) {
                 for (int i = 0; i < tasks.size(); i++) {
    -                TaskState ts = (TaskState)(tasks.elementAt(i));
    +                TaskState ts = tasks.elementAt(i);
                     if (ts.connection == c)
                         return ts;
                 }
                 throw new Error("AgentPanel.HistoryList.getTask: can't find socket");
             }

             public synchronized TaskState getSelectedTask() {
    -            return (TaskState)(tasks.elementAt(super.getSelectedIndex()));
    +            return tasks.elementAt(super.getSelectedIndex());
             }

             public synchronized void removeAll() {
                 tasks.setSize(0);
                 if (getItemCount() > 0)

    @@ -756,11 +756,11 @@
             private String getKey(String state, String detail) {
                 return (state + " " + detail);
             }

             private int maxTasks = 10;
    -        private Vector tasks = new Vector();
    +        private Vector<TaskState> tasks = new Vector<>();
         }

         //-------------------------------------------------------------------

    @@ -971,11 +971,11 @@
                 add(f, fc);
                 return f;
             }

    -        private Vector tasks = new Vector();
    +        private Vector<TaskState> tasks = new Vector<>();

             private int[] statusCounts = new int[Status.NUM_STATES];
             private int exceptionsCount;

             private TextField activeField;

< prev index next >