Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8270184: [TESTBUG] Add coverage for jvmci ResolvedJavaType.toJavaName…
…() for lambdas

Backport-of: 6a9bc10
  • Loading branch information
jerboaa committed Jul 13, 2021
1 parent b2416b6 commit d32e42cdd461ee5793331ad237b072c16b096ef4
Showing 1 changed file with 13 additions and 0 deletions.
@@ -162,6 +162,19 @@ public void isArrayTest() {
}
}

@Test
public void internalNameTest() {
// Verify that the last slash in lambda types are not replaced with a '.' as they
// are part of the type name.
Supplier<Runnable> lambda = () -> () -> System.out.println("run");
ResolvedJavaType lambdaType = metaAccess.lookupJavaType(lambda.getClass());
String typeName = lambdaType.getName();
int typeNameLen = TestResolvedJavaType.class.getSimpleName().length();
int index = typeName.indexOf(TestResolvedJavaType.class.getSimpleName());
String suffix = typeName.substring(index + typeNameLen, typeName.length() - 1);
assertEquals(TestResolvedJavaType.class.getName() + suffix, lambdaType.toJavaName());
}

@Test
public void getModifiersTest() {
for (Class<?> c : classes) {

1 comment on commit d32e42c

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on d32e42c Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.