< prev index next >

src/com/sun/javatest/ResourceLoader.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

@@ -43,21 +43,21 @@
 
 import com.sun.javatest.util.DynamicArray;
 
 public class ResourceLoader {
 
-    public static Enumeration getResources(String name, Class ownClass) throws IOException  {
+    public static Enumeration<URL> getResources(String name, Class<?> ownClass) throws IOException  {
         URL extResource = getExtResource(name, null);
         if (extResource != null) {
             Vector<URL> r = new Vector<>();
             r.add(extResource);
             return r.elements();
         }
         return ownClass.getClassLoader().getResources(name);
     }
 
-    public static InputStream getResourceAsStream(final String name, final Class ownClass) {
+    public static InputStream getResourceAsStream(final String name, final Class<?> ownClass) {
         URL url = getExtResource(name, ownClass);
         try {
             if (url != null) {
                 return url.openStream();
             } else {

@@ -73,11 +73,11 @@
         } catch (IOException e) {
             return null;
         }
     }
 
-    public static File getResourceFile(String name, Class ownClass) {
+    public static File getResourceFile(String name, Class<?> ownClass) {
         File f = getExtResourceFile(name, ownClass);
         if (f != null) {
             return f;
         } else {
             return new File(ownClass.getResource(name).getFile());

@@ -99,11 +99,11 @@
         }   // catch
 
         return url;
     }
 
-    private static URL getExtResource(String name, Class ownClass) {
+    private static URL getExtResource(String name, Class<?> ownClass) {
         URL ret = null;
         File rf = getExtResourceFile(name, ownClass);
         if (rf != null) {
             try {
                 ret = rf.toURI().toURL();

@@ -112,11 +112,11 @@
             }
         }
         return ret;
     }
 
-    private static File getExtResourceFile(String name, Class ownClass) {
+    private static File getExtResourceFile(String name, Class<?> ownClass) {
         if (ext != null) {
             String relName;
             if (ownClass == null) {
                 relName = name;
             } else {

@@ -131,11 +131,11 @@
         return null;
     }
 
 
     // get from java.lang.Class with minimal changes
-    private static String resolveName(String name, Class baseClass) {
+    private static String resolveName(String name, Class<?> baseClass) {
         if (name == null || baseClass == null) {
             return name;
         }
 
         if (!name.startsWith("/")) {
< prev index next >