71 72 // Test that ClassCircularityError gets detected for instance fields. 73 try { 74 Class newClass = Class.forName("Circ"); 75 throw new RuntimeException( "java.lang.ClassCircularityError exception not thrown!"); 76 } catch (java.lang.ClassCircularityError e) { 77 if (!e.getMessage().contains("Circ2")) { 78 throw new RuntimeException( "Wrong ClassCircularityError: " + e.getMessage()); 79 } 80 } 81 82 // Test that ClassCircularityError gets detected for static fields. 83 try { 84 Class newClass = Class.forName("CircStaticB"); 85 throw new RuntimeException( "java.lang.ClassCircularityError exception not thrown!"); 86 } catch (java.lang.ClassCircularityError e) { 87 if (!e.getMessage().contains("CircStaticA")) { 88 throw new RuntimeException( "Wrong ClassCircularityError: " + e.getMessage()); 89 } 90 } 91 } 92 } | 71 72 // Test that ClassCircularityError gets detected for instance fields. 73 try { 74 Class newClass = Class.forName("Circ"); 75 throw new RuntimeException( "java.lang.ClassCircularityError exception not thrown!"); 76 } catch (java.lang.ClassCircularityError e) { 77 if (!e.getMessage().contains("Circ2")) { 78 throw new RuntimeException( "Wrong ClassCircularityError: " + e.getMessage()); 79 } 80 } 81 82 // Test that ClassCircularityError gets detected for static fields. 83 try { 84 Class newClass = Class.forName("CircStaticB"); 85 throw new RuntimeException( "java.lang.ClassCircularityError exception not thrown!"); 86 } catch (java.lang.ClassCircularityError e) { 87 if (!e.getMessage().contains("CircStaticA")) { 88 throw new RuntimeException( "Wrong ClassCircularityError: " + e.getMessage()); 89 } 90 } 91 92 runTest("ValueCloneable", "Value Types do not support Cloneable"); 93 } 94 } |