test/closed/com/sun/org/apache/xml/internal/security/ClassLoaderUtils.java

Print this page

        

@@ -15,22 +15,18 @@
 import java.lang.reflect.Modifier;
 
 public class ClassLoaderUtils {
 
     public static void main(String[] args) throws Exception {
-        String removedClass =
-            "com.sun.org.apache.xml.internal.security.utils.ClassLoaderUtils";
+
+        String xmlsec = "com.sun.org.apache.xml.internal.security.";
         String[] classes = {
-        "com.sun.org.apache.xml.internal.security.algorithms.ClassLoaderUtils",
-        "com.sun.org.apache.xml.internal.security.transforms.ClassLoaderUtils"
+            xmlsec + "algorithms.ClassLoaderUtils",
+            xmlsec + "transforms.ClassLoaderUtils",
+            xmlsec + "utils.ClassLoaderUtils"
         };
 
-        try {
-            Class.forName(removedClass);
-            throw new Exception(removedClass + " was found");
-        } catch (ClassNotFoundException e) {}
-
         for (String cl : classes) {
             Class c = Class.forName(cl);
             if (Modifier.isPublic(c.getModifiers())) {
                 throw new Exception(cl + " is public");
             }