--- old/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/src/jdk/test/Main.java 2018-04-24 16:18:39.004923196 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/src/jdk/test/Main.java 2018-04-24 16:18:38.696894122 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,10 +96,12 @@ } // Make sure we got the right version of the class. toString() of an instance // of the overridden version of the class should return "hi". - String s = clazz.newInstance().toString(); - if (!s.equals("hi")) { - throw new RuntimeException(testName + " FAILED: toString() returned \"" + s - + "\" instead of \"hi\"" ); + if (actualLoader == SYS_LOADER) { + String s = clazz.newInstance().toString(); + if (!s.equals("hi")) { + throw new RuntimeException(testName + " FAILED: toString() returned \"" + s + + "\" instead of \"hi\"" ); + } } System.out.println(testName + " PASSED: class loaded as expected."); } else {