test/sun/misc/JarIndex/metaInfFilenames/Basic.java

Print this page

        

@@ -152,12 +152,11 @@
     }
 
     /* run javac <args> */
     static void compile(String... args) {
         debug("Running: javac " + Arrays.toString(args));
-        com.sun.tools.javac.Main compiler = new com.sun.tools.javac.Main();
-        if (compiler.compile(args) != 0) {
+        if (com.sun.tools.javac.Main.compile(args) != 0) {
              throw new RuntimeException("javac failed: args=" + Arrays.toString(args));
         }
     }
 
     static String jar;

@@ -257,19 +256,19 @@
         debug("----------------------------------");
         debug("Running test with sun.misc.Service looking for " + serviceClass);
         URLClassLoader loader = getLoader(baseURL);
         httpServer.reset();
 
-        Class messageServiceClass = null;
+        Class<?> messageServiceClass = null;
         try {
             messageServiceClass = loader.loadClass(serviceClass);
         } catch (ClassNotFoundException cnfe) {
             System.err.println(cnfe);
             throw new RuntimeException("Error in test: " + cnfe);
         }
 
-        Iterator<Class<?>> iterator = sun.misc.Service.providers(messageServiceClass, loader);
+        Iterator<?> iterator = sun.misc.Service.providers(messageServiceClass, loader);
         if (expectToFind && !iterator.hasNext()) {
             debug(messageServiceClass + " NOT found.");
             return false;
         }
 

@@ -299,19 +298,19 @@
         debug("----------------------------------");
         debug("Running test with java.util.ServiceLoader looking for " + serviceClass);
         URLClassLoader loader = getLoader(baseURL);
         httpServer.reset();
 
-        Class messageServiceClass = null;
+        Class<?> messageServiceClass = null;
         try {
             messageServiceClass = loader.loadClass(serviceClass);
         } catch (ClassNotFoundException cnfe) {
             System.err.println(cnfe);
             throw new RuntimeException("Error in test: " + cnfe);
         }
 
-        Iterator<Class<?>> iterator = (ServiceLoader.load(messageServiceClass, loader)).iterator();
+        Iterator<?> iterator = (ServiceLoader.load(messageServiceClass, loader)).iterator();
         if (expectToFind && !iterator.hasNext()) {
             debug(messageServiceClass + " NOT found.");
             return false;
         }
 

@@ -343,11 +342,11 @@
         debug("----------------------------------");
         debug("Running test looking for " + resource);
         URLClassLoader loader = getLoader(baseURL);
         httpServer.reset();
 
-        Class ADotAKlass = null;
+        Class<?> ADotAKlass = null;
         try {
             ADotAKlass = loader.loadClass("a.A");
         } catch (ClassNotFoundException cnfe) {
             System.err.println(cnfe);
             throw new RuntimeException("Error in test: " + cnfe);