8381385: nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002/ fails with --enable-preview and Java Usage Tracker enabled

Reviewed-by: dholmes, lmesnik
This commit is contained in:
Chris Plummer 2026-04-15 19:35:52 +00:00
parent a2e840fd74
commit f87bb766a7

View File

@ -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);
}
}