< prev index next >

test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1PrivateMethodIAE.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2018, 2019, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 101,111 **** String message = e.getMessage(); System.out.println(e.toString()); // java.lang.IllegalAccessError: // tried to access private method p2.c2.method2()V from class p1.c1 (p2.c2 is in module m2x of loader // myloaders.MySameClassLoader @<id>; p1.c1 is in module m1x of loader myloaders.MySameClassLoader @<id>) ! if (!message.contains("class p1.c1 tried to access private method 'void p2.c2.method2()' " + "(p1.c1 is in module m1x of loader myloaders.MySameClassLoader @") || !message.contains("; p2.c2 is in module m2x of loader myloaders.MySameClassLoader @")) { throw new RuntimeException("Test Failed, an IAE was thrown with the wrong message: " + e.toString()); } } catch (Throwable e) { --- 101,111 ---- String message = e.getMessage(); System.out.println(e.toString()); // java.lang.IllegalAccessError: // tried to access private method p2.c2.method2()V from class p1.c1 (p2.c2 is in module m2x of loader // myloaders.MySameClassLoader @<id>; p1.c1 is in module m1x of loader myloaders.MySameClassLoader @<id>) ! if (!message.contains("class p1.c1 tried to access private method p2.c2.method2()V " + "(p1.c1 is in module m1x of loader myloaders.MySameClassLoader @") || !message.contains("; p2.c2 is in module m2x of loader myloaders.MySameClassLoader @")) { throw new RuntimeException("Test Failed, an IAE was thrown with the wrong message: " + e.toString()); } } catch (Throwable e) {
< prev index next >