8157146: Add debug printlns to tests FieldSetAccessibleTest and VerifyJimage.java
authorsundar
Tue, 17 May 2016 19:53:43 +0530
changeset 38329 254b331d0059
parent 38328 40435a469d25
child 38369 73280b96de24
8157146: Add debug printlns to tests FieldSetAccessibleTest and VerifyJimage.java Reviewed-by: alanb, shade
jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
jdk/test/tools/jimage/VerifyJimage.java
--- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java	Tue May 17 12:06:41 2016 +0200
+++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java	Tue May 17 19:53:43 2016 +0530
@@ -228,12 +228,18 @@
     }
 
     static boolean test(String s, boolean addExports) {
+        String clsName = s.replace('/', '.').substring(0, s.length() - 6);
         try {
+            System.out.println("Loading " + clsName);
             final Class<?> c = Class.forName(
-                    s.replace('/', '.').substring(0, s.length() - 6),
+                    clsName,
                     false,
                     systemClassLoader);
             return test(c, addExports);
+        } catch (VerifyError ve) {
+            System.err.println("VerifyError for " + clsName);
+            ve.printStackTrace(System.err);
+            failed.add(s);
         } catch (Exception t) {
             t.printStackTrace(System.err);
             failed.add(s);
--- a/jdk/test/tools/jimage/VerifyJimage.java	Tue May 17 12:06:41 2016 +0200
+++ b/jdk/test/tools/jimage/VerifyJimage.java	Tue May 17 19:53:43 2016 +0530
@@ -188,7 +188,11 @@
                         String cn = removeModule(n).replaceAll("\\.class$", "").replace('/', '.');
                         count.incrementAndGet();
                         try {
+                            System.out.println("Loading " + cn);
                             Class.forName(cn, false, loader);
+                        } catch (VerifyError ve) {
+                            System.err.println("VerifyError for " + cn);
+                            failed.add(reader.imageName() + ": " + cn + " not verified: " + ve.getMessage());
                         } catch (ClassNotFoundException e) {
                             failed.add(reader.imageName() + ": " + cn + " not found");
                         }