Skip to content
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 d4e4828 commit 23918db4b7e65797318ec5f5c5a452ec9d3ea0c5
Showing 1 changed file with 13 additions and 0 deletions.
@@ -178,6 +178,19 @@ class LocalClass {}
assertEquals(lambdaType.getHostClass(), nestedLambdaType.getHostClass());
}

@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 23918db

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 23918db 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.