< prev index next >
test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java
Print this page
rev 59275 : [mq]: v1
*** 1,7 ****
/*
! * Copyright (c) 2017, 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) 2017, 2020, 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.
*** 72,83 ****
try {
MissingNestHost m = new MissingNestHost();
m.priv_invoke();
throw new Error("Unexpected success invoking MissingNestHost.priv_invoke");
}
! catch (NoClassDefFoundError ncdfe) {
! System.out.println("Got expected exception:" + ncdfe);
}
}
}
public static void main(String[] args) throws Throwable {
--- 72,87 ----
try {
MissingNestHost m = new MissingNestHost();
m.priv_invoke();
throw new Error("Unexpected success invoking MissingNestHost.priv_invoke");
}
! catch (IllegalAccessError iae) {
! if (iae.getMessage().contains("java.lang.NoClassDefFoundError: NoSuchClass")) {
! System.out.println("Got expected exception:" + iae);
! } else {
! throw new Error("Unexpected exception", iae);
! }
}
}
}
public static void main(String[] args) throws Throwable {
*** 103,115 ****
// Verification of Helper will trigger the nestmate access check failure
try {
Helper.doTest();
}
! catch (NoClassDefFoundError ncdfe) {
if (verifying)
! System.out.println("Got expected exception:" + ncdfe);
else
! throw new Error("Unexpected error loading Helper class with verification disabled");
}
}
}
--- 107,119 ----
// Verification of Helper will trigger the nestmate access check failure
try {
Helper.doTest();
}
! catch (IllegalAccessError iae) {
if (verifying)
! System.out.println("Got expected exception:" + iae);
else
! throw new Error("Unexpected error loading Helper class with verification disabled", iae);
}
}
}
< prev index next >