Skip to content

Commit

Permalink
8270184: [TESTBUG] Add coverage for jvmci ResolvedJavaType.toJavaName…
Browse files Browse the repository at this point in the history
…() for lambdas

Backport-of: 6a9bc10
  • Loading branch information
jerboaa committed Jul 13, 2021
1 parent d4e4828 commit 23918db
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

1 comment on commit 23918db

@openjdk-notifier
Copy link

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.