< prev index next >

## src/com/sun/javatest/batch/ObserverCommand.java

Print this page

    @@ -54,11 +54,11 @@
         }

         ObserverCommand(ListIterator argIter) throws Fault {
             super(getName());

    -        Vector v = null;
    +        Vector<String> v = null;

             while (argIter.hasNext()) {
                 String arg = nextArg(argIter);

                 if (arg.equals("-cp") && argIter.hasNext())

    @@ -71,11 +71,11 @@
                         arg = nextArg(argIter);
                         if (arg.equals("-end"))
                             break;
                         else {
                             if (v == null)
    -                            v = new Vector();
    +                            v = new Vector<>();
                             v.add(arg);
                         }
                     }
                     break;
                 }

    @@ -128,11 +128,11 @@
             catch (InvocationTargetException e) {
                 throw new Fault(i18n, "observer.cantCreateClass", className);
             }
         }

    -    private Harness.Observer tryConstructor(Class obsClass, Class[] argTypes, Object[] args)
    +    private Harness.Observer tryConstructor(Class<?> obsClass, Class[] argTypes, Object[] args)
             throws IllegalAccessException, InstantiationException, InvocationTargetException
         {
             try {
                 Constructor c = obsClass.getConstructor(argTypes);
                 return (Harness.Observer) (c.newInstance(args));

    @@ -142,11 +142,11 @@
             }
         }

         private void setClassPath(String s) throws Fault {
             char pathCh = File.pathSeparatorChar;
    -        Vector v = new Vector();
    +        Vector<URL> v = new Vector<>();
             int start = 0;
             for (int i = s.indexOf(pathCh); i != -1; i = s.indexOf(pathCh, start)) {
                 addClassPathEntry(s.substring(start, i), v);
                 start = i + 1;
             }

    @@ -162,11 +162,11 @@

         private Class loadClass(String name) throws ClassNotFoundException {
             return (classLoader == null ? Class.forName(name) : classLoader.loadClass(name));
         }

    -    private void addClassPathEntry(String s, Vector v) throws Fault {
    +    private void addClassPathEntry(String s, Vector<URL> v) throws Fault {
             try {
                 if (s.length() > 0)
                     v.add(new File(s).toURL());
             }
             catch (MalformedURLException e) {

< prev index next >