From f87bb766a79a4f33a5ac9dd3337d31368c1d5b8f Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Wed, 15 Apr 2026 19:35:52 +0000 Subject: [PATCH] 8381385: nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002/ fails with --enable-preview and Java Usage Tracker enabled Reviewed-by: dholmes, lmesnik --- .../visibleClasses/visibleclasses002.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002.java index 8fe41faa886..78cbe664da3 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -138,7 +138,9 @@ public class visibleclasses002 { } } } catch (ClassNotLoadedException e) { - throw new Failure("Unexpected ClassNotLoadedException while getting componentType() of : " + refType); + // ArrayType.componentType() can throw ClassNotLoadedException if the + // type is loaded but not yet prepared. Just swallow the exception. + display("ClassNotLoadedException while getting componentType() of " + refType); } }