Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

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 b2416b6 commit d32e42c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

1 comment on commit d32e42c

@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.