From ba47babb41afb2914a6d294fe34dca0cda799864 Mon Sep 17 00:00:00 2001 From: Satyen Subramaniam Date: Tue, 11 Mar 2025 05:05:59 +0000 Subject: [PATCH] Backport d13fd5738f8a3d4b4009c2e15cfd967332d97bbd --- .../ctw/src/sun/hotspot/tools/ctw/Compiler.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java index 961090c1d40..ae8850ce6b6 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java @@ -87,17 +87,16 @@ public static void compileClass(Class aClass, long id, Executor executor) { private static void preloadClasses(String className, long id, ConstantPool constantPool) { - try { - for (int i = 0, n = constantPool.getSize(); i < n; ++i) { - try { + for (int i = 0, n = constantPool.getSize(); i < n; ++i) { + try { + if (constantPool.getTagAt(i) == ConstantPool.Tag.CLASS) { constantPool.getClassAt(i); - } catch (IllegalArgumentException ignore) { } + } catch (Throwable t) { + CompileTheWorld.OUT.println(String.format("[%d]\t%s\tWARNING preloading failed : %s", + id, className, t)); + t.printStackTrace(CompileTheWorld.ERR); } - } catch (Throwable t) { - CompileTheWorld.OUT.println(String.format("[%d]\t%s\tWARNING preloading failed : %s", - id, className, t)); - t.printStackTrace(CompileTheWorld.ERR); } }