< prev index next >

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

Print this page

    @@ -536,11 +536,11 @@
                 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));
    +                ZipFile z = zips.get(f);
                     zips.remove(f);
                     z.close();
                 }

                 return status;

    @@ -602,11 +602,11 @@
             }

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

    @@ -639,11 +639,11 @@
                 }
             }

             private File[] split(String s) {
                 char pathCh = File.pathSeparatorChar;
    -            Vector v = new Vector();
    +            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,11 +652,11 @@
                 File[] path = new File[v.size()];
                 v.copyInto(path);
                 return path;
             }

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

             private Connection connection;

    @@ -664,10 +664,10 @@
             private DataOutputStream out;

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

     }

< prev index next >