Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @bug 8350704
* @summary Test behaviors with various bad EnclosingMethod attribute
* @library /test/lib
* @run junit BadEnclosingMethodTest
* @run junit/othervm -Xfuture BadEnclosingMethodTest
*/

import jdk.test.lib.ByteCodeLoader;
Expand Down Expand Up @@ -104,14 +104,14 @@ void testMalformedTypes() throws Exception {
@Test
void testAbsentMethods() throws Exception {
var absentMethodType = loadTestClass("methodName", "(Ldoes/not/Exist;)V");
var ex = assertThrows(TypeNotPresentException.class,
var ex = assertThrows(NoSuchMethodError.class,
absentMethodType::getEnclosingMethod);
assertEquals("does.not.Exist", ex.typeName());
assertTrue(ex.getMessage().contains("does/not/Exist"));

var absentConstructorType = loadTestClass(INIT_NAME, "(Ldoes/not/Exist;)V");
ex = assertThrows(TypeNotPresentException.class,
ex = assertThrows(NoSuchMethodError.class,
absentConstructorType::getEnclosingConstructor);
assertEquals("does.not.Exist", ex.typeName());
assertTrue(ex.getMessage().contains("does/not/Exist"));
}
}

Expand Down