changeset 14166:8d3fcb58b82c

Incorrect check in jrt test
author alanb
date Thu, 01 Oct 2015 08:59:23 +0100
parents 2d0adcc948a5
children 4b16ae395bbe
files test/sun/net/www/protocol/jrt/OtherResources.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/net/www/protocol/jrt/OtherResources.java	Wed Sep 30 21:00:19 2015 +0100
+++ b/test/sun/net/www/protocol/jrt/OtherResources.java	Thu Oct 01 08:59:23 2015 +0100
@@ -34,9 +34,10 @@
     public static void main(String[] args) throws IOException {
 
         // check that java.desktop is not in the set of readable modules
-        if (ClassLoader.getSystemResource("java/awt/Component.class") != null) {
+        try {
+            Class.forName("java.awt.Component");
             throw new RuntimeException("Need to run with -limitmods java.base");
-        }
+        } catch (ClassNotFoundException expected) { }
 
         // access resource in the java.desktop module
         URL url = new URL("jrt:/java.desktop/java/awt/Component.class");