# HG changeset patch # User ccheung # Date 1570664538 25200 # Node ID d0519b8bd8d94e6e2def549185db89a521fbc730 # Parent f9cc0141574c9d31eb54fd456d2cb708a09c74c7 8231529: [TESTBUG] runtime/cds/appcds/dynamicArchive/DynamicLotsOfClasses.java shouldn't wrap SkippedException into Exception Summary: Removed the try-catch in the test. Reviewed-by: iklam, lfoltan diff -r f9cc0141574c -r d0519b8bd8d9 test/hotspot/jtreg/runtime/cds/appcds/LotsOfClasses.java --- a/test/hotspot/jtreg/runtime/cds/appcds/LotsOfClasses.java Wed Oct 09 16:35:44 2019 -0700 +++ b/test/hotspot/jtreg/runtime/cds/appcds/LotsOfClasses.java Wed Oct 09 16:42:18 2019 -0700 @@ -39,7 +39,7 @@ public class LotsOfClasses { - public static void main(String[] args) throws Throwable { + public static void main(String[] args) throws Exception { ArrayList list = new ArrayList<>(); TestCommon.findAllClasses(list); diff -r f9cc0141574c -r d0519b8bd8d9 test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java --- a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java Wed Oct 09 16:35:44 2019 -0700 +++ b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java Wed Oct 09 16:42:18 2019 -0700 @@ -611,7 +611,7 @@ static Pattern pattern; - static void findAllClasses(ArrayList list) throws Throwable { + static void findAllClasses(ArrayList list) throws Exception { // Find all the classes in the jrt file system pattern = Pattern.compile("/modules/[a-z.]*[a-z]+/([^-]*)[.]class"); FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/")); @@ -619,7 +619,7 @@ findAllClassesAtPath(base, list); } - private static void findAllClassesAtPath(Path p, ArrayList list) throws Throwable { + private static void findAllClassesAtPath(Path p, ArrayList list) throws Exception { try (DirectoryStream stream = Files.newDirectoryStream(p)) { for (Path entry: stream) { Matcher matcher = pattern.matcher(entry.toString()); @@ -629,7 +629,7 @@ } try { findAllClassesAtPath(entry, list); - } catch (Throwable t) {} + } catch (Exception ex) {} } } } diff -r f9cc0141574c -r d0519b8bd8d9 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicLotsOfClasses.java --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicLotsOfClasses.java Wed Oct 09 16:35:44 2019 -0700 +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicLotsOfClasses.java Wed Oct 09 16:42:18 2019 -0700 @@ -45,22 +45,16 @@ public class DynamicLotsOfClasses extends DynamicArchiveTestBase { - public static void main(String[] args) throws Throwable { + public static void main(String[] args) throws Exception { runTest(DynamicLotsOfClasses::testDefaultBase); } static void testDefaultBase() throws Exception { String topArchiveName = getNewArchiveName("top"); - try { - doTest(topArchiveName); - } catch (Throwable th) { - System.out.println(th.toString()); - Exception ex = new Exception(th); - throw ex; - } + doTest(topArchiveName); } - private static void doTest(String topArchiveName) throws Throwable { + private static void doTest(String topArchiveName) throws Exception { ArrayList list = new ArrayList<>(); TestCommon.findAllClasses(list);