< prev index next >

test/hotspot/jtreg/runtime/LoaderConstraints/differentLE/Test.java

Print this page
rev 51756 : 8205611: Improve the wording of LinkageErrors to include module and class loader information
Summary: Clean up the wording of loader constraint violations to include the module and class loader information.
Reviewed-by: coleenp, goetz, hseigel

*** 76,90 **** // superclass C. This fails as D1 is already loaded with the same superclass. // Break the expectedErrorMessage into 2 pieces since the loader name will include // its identity hash and can not be compared against. static String expectedErrorMessage_part1 = "loader constraint violation: loader PreemptingClassLoader @"; ! static String expectedErrorMessage_part2 = " (instance of PreemptingClassLoader, " + ! "child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) wants to load " + ! "class test.D_ambgs. A different class with the same name was previously loaded " + ! "by 'app' (instance of jdk.internal.loader.ClassLoaders$AppClassLoader)."; ! public static void test_access() throws Exception { try { // Make a Class 'D_ambgs' under the default loader. // This uses the implementation from the .java file. C c_1 = new D_ambgs(); --- 76,88 ---- // superclass C. This fails as D1 is already loaded with the same superclass. // Break the expectedErrorMessage into 2 pieces since the loader name will include // its identity hash and can not be compared against. static String expectedErrorMessage_part1 = "loader constraint violation: loader PreemptingClassLoader @"; ! static String expectedErrorMessage_part2 = " wants to load class test.D_ambgs. A different class " + ! "with the same name was previously loaded by 'app'. " + ! "(test.D_ambgs is in unnamed module of loader 'app')"; public static void test_access() throws Exception { try { // Make a Class 'D_ambgs' under the default loader. // This uses the implementation from the .java file. C c_1 = new D_ambgs();
*** 116,121 **** public static void main(String[] args) throws Exception { test_access(); } } - --- 114,118 ----
< prev index next >