< prev index next >

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

Print this page

    *** 54,64 ****
          }

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

    !         Vector v = null;

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

                  if (arg.equals("-cp") && argIter.hasNext())
    --- 54,64 ----
          }

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

    !         Vector<String> v = null;

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

                  if (arg.equals("-cp") && argIter.hasNext())
    *** 71,81 ****
                          arg = nextArg(argIter);
                          if (arg.equals("-end"))
                              break;
                          else {
                              if (v == null)
    !                             v = new Vector();
                              v.add(arg);
                          }
                      }
                      break;
                  }
    --- 71,81 ----
                          arg = nextArg(argIter);
                          if (arg.equals("-end"))
                              break;
                          else {
                              if (v == null)
    !                             v = new Vector<>();
                              v.add(arg);
                          }
                      }
                      break;
                  }
    *** 128,138 ****
              catch (InvocationTargetException e) {
                  throw new Fault(i18n, "observer.cantCreateClass", className);
              }
          }

    !     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));
    --- 128,138 ----
              catch (InvocationTargetException e) {
                  throw new Fault(i18n, "observer.cantCreateClass", className);
              }
          }

    !     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,152 ****
              }
          }

          private void setClassPath(String s) throws Fault {
              char pathCh = File.pathSeparatorChar;
    !         Vector 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;
              }
    --- 142,152 ----
              }
          }

          private void setClassPath(String s) throws Fault {
              char pathCh = File.pathSeparatorChar;
    !         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,172 ****

          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 {
              try {
                  if (s.length() > 0)
                      v.add(new File(s).toURL());
              }
              catch (MalformedURLException e) {
    --- 162,172 ----

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

    !     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 >