< prev index next >

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

Print this page

    *** 536,546 ****
                  ref.flush();

                  // might be better not to flush these ...
                  for (Enumeration e = zips.keys(); e.hasMoreElements(); ) {
                      File f = (File)(e.nextElement());
    !                 ZipFile z = (ZipFile)(zips.get(f));
                      zips.remove(f);
                      z.close();
                  }

                  return status;
    --- 536,546 ----
                  ref.flush();

                  // might be better not to flush these ...
                  for (Enumeration e = zips.keys(); e.hasMoreElements(); ) {
                      File f = (File)(e.nextElement());
    !                 ZipFile z = zips.get(f);
                      zips.remove(f);
                      z.close();
                  }

                  return status;
    *** 602,612 ****
              }

              private byte[] readFromJar(String name, File jarFile) {
                  //System.err.println("readFromJar: " + name + " " + jarFile);
                  try {
    !                 ZipFile z = (ZipFile)zips.get(jarFile);
                      if (z == null) {
                          z = new ZipFile(jarFile);
                          zips.put(jarFile, z);
                      }
                      ZipEntry ze = z.getEntry(name);
    --- 602,612 ----
              }

              private byte[] readFromJar(String name, File jarFile) {
                  //System.err.println("readFromJar: " + name + " " + jarFile);
                  try {
    !                 ZipFile z = zips.get(jarFile);
                      if (z == null) {
                          z = new ZipFile(jarFile);
                          zips.put(jarFile, z);
                      }
                      ZipEntry ze = z.getEntry(name);
    *** 639,649 ****
                  }
              }

              private File[] split(String s) {
                  char pathCh = File.pathSeparatorChar;
    !             Vector v = new Vector();
                  int start = 0;
                  for (int i = s.indexOf(pathCh); i != -1; i = s.indexOf(pathCh, start)) {
                      add(s.substring(start, i), v);
                      start = i + 1;
                  }
    --- 639,649 ----
                  }
              }

              private File[] split(String s) {
                  char pathCh = File.pathSeparatorChar;
    !             Vector<File> v = new Vector<>();
                  int start = 0;
                  for (int i = s.indexOf(pathCh); i != -1; i = s.indexOf(pathCh, start)) {
                      add(s.substring(start, i), v);
                      start = i + 1;
                  }
    *** 652,662 ****
                  File[] path = new File[v.size()];
                  v.copyInto(path);
                  return path;
              }

    !         private void add(String s, Vector v) {
                  if (s.length() != 0)
                      v.addElement(new File(s));
              }

              private Connection connection;
    --- 652,662 ----
                  File[] path = new File[v.size()];
                  v.copyInto(path);
                  return path;
              }

    !         private void add(String s, Vector<File> v) {
                  if (s.length() != 0)
                      v.addElement(new File(s));
              }

              private Connection connection;
    *** 664,673 ****
              private DataOutputStream out;

              private File[] classPath;
              private boolean sharedCl;
              private int timeout = 0;
    !         private Hashtable zips = new Hashtable();
          }

      }

    --- 664,673 ----
              private DataOutputStream out;

              private File[] classPath;
              private boolean sharedCl;
              private int timeout = 0;
    !         private Hashtable<File, ZipFile> zips = new Hashtable<>();
          }

      }

< prev index next >