< prev index next >

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

Print this page

    *** 201,212 ****
                  if (map == null)
                      traceOut.println("set map null");
                  else {
                      traceOut.println("set map:");
                      map.setTracing(tracing, traceOut);
    !                 for (Enumeration e = map.enumerate(); e.hasMoreElements(); ) {
    !                     String[] entry = (String[])(e.nextElement());
                          traceOut.println("map-from: " + entry[0]);
                          traceOut.println("map-to:   " + entry[1]);
                      }
                      traceOut.println("end of map");
                  }
    --- 201,212 ----
                  if (map == null)
                      traceOut.println("set map null");
                  else {
                      traceOut.println("set map:");
                      map.setTracing(tracing, traceOut);
    !                 for (Enumeration<String[]> e = map.enumerate(); e.hasMoreElements(); ) {
    !                     String[] entry = e.nextElement();
                          traceOut.println("map-from: " + entry[0]);
                          traceOut.println("map-to:   " + entry[1]);
                      }
                      traceOut.println("end of map");
                  }
    *** 333,343 ****
          public synchronized void close() throws InterruptedException {
              closing = true;  // will prevent new tasks from being created

              // interrupt any threads that are running
              for (int i = 0; i < threads.size(); i++) {
    !             Thread t = (Thread)(threads.elementAt(i));
                  if (tracing)
                      traceOut.println("INTERRUPTING THREAD " + t.getName());
                  t.interrupt();
              }

    --- 333,343 ----
          public synchronized void close() throws InterruptedException {
              closing = true;  // will prevent new tasks from being created

              // interrupt any threads that are running
              for (int i = 0; i < threads.size(); i++) {
    !             Thread t = threads.elementAt(i);
                  if (tracing)
                      traceOut.println("INTERRUPTING THREAD " + t.getName());
                  t.interrupt();
              }

    *** 345,355 ****
              traceOut.println("WAITING 3s FOR THREADS TO CLEANUP");
              Thread.currentThread().sleep(3000);

              // close any tasks that are running
              for (int i = 0; i < tasks.size(); i++) {
    !             Task t = (Task)(tasks.elementAt(i));
                  if (tracing) {
                      Connection c = t.connection; // maybe null; if it is, task is already closing
                      traceOut.println("CLOSING TASK " + (c == null ? "[unknown]" : c.getName()));
                  }
                  t.close();
    --- 345,355 ----
              traceOut.println("WAITING 3s FOR THREADS TO CLEANUP");
              Thread.currentThread().sleep(3000);

              // close any tasks that are running
              for (int i = 0; i < tasks.size(); i++) {
    !             Task t = tasks.elementAt(i);
                  if (tracing) {
                      Connection c = t.connection; // maybe null; if it is, task is already closing
                      traceOut.println("CLOSING TASK " + (c == null ? "[unknown]" : c.getName()));
                  }
                  t.close();
    *** 540,551 ****
          }

          private boolean closing;
          private Thread mainThread;
          private int maxThreads;
    !     private Vector threads = new Vector();
    !     private Vector tasks = new Vector();
          private Notifier notifier = new Notifier();
          private Object currSystemStreamOwner = null;
          private PrintStream saveOut;
          private PrintStream saveErr;

    --- 540,551 ----
          }

          private boolean closing;
          private Thread mainThread;
          private int maxThreads;
    !     private Vector<Thread> threads = new Vector<>();
    !     private Vector<Task> tasks = new Vector<>();
          private Notifier notifier = new Notifier();
          private Object currSystemStreamOwner = null;
          private PrintStream saveOut;
          private PrintStream saveErr;

    *** 934,944 ****
                      return result;
                  }

              }

    !         private Status executeMain(Class c, String[] args,
                      PrintWriter testLog, PrintWriter testRef)
                      throws IOException, ClassNotFoundException, IllegalAccessException {
                  notifier.execMain(connection, tag, c.getName(), args);

                  PrintStream out = Deprecated.createPrintStream(new WriterStream(testRef));
    --- 934,944 ----
                      return result;
                  }

              }

    !         private Status executeMain(Class<?> c, String[] args,
                      PrintWriter testLog, PrintWriter testRef)
                      throws IOException, ClassNotFoundException, IllegalAccessException {
                  notifier.execMain(connection, tag, c.getName(), args);

                  PrintStream out = Deprecated.createPrintStream(new WriterStream(testRef));
    *** 1105,1115 ****
                  return data;
              }

              private ClassLoader getAgentClassLoader(boolean useSharedClassLoader)
                      throws InstantiationException, IllegalAccessException {
    !             Class classLoaderClass;
                  try {
                      String s = getClass().getName();
                      String pkg = s.substring(0, s.lastIndexOf('.'));
                      classLoaderClass = Class.forName(pkg + ".AgentClassLoader2");
                  } catch (Throwable t) {
    --- 1105,1115 ----
                  return data;
              }

              private ClassLoader getAgentClassLoader(boolean useSharedClassLoader)
                      throws InstantiationException, IllegalAccessException {
    !             Class<?> classLoaderClass;
                  try {
                      String s = getClass().getName();
                      String pkg = s.substring(0, s.lastIndexOf('.'));
                      classLoaderClass = Class.forName(pkg + ".AgentClassLoader2");
                  } catch (Throwable t) {

< prev index next >