Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -137,9 +137,11 @@ default boolean isAbstract() {
}

/**
* Checks that this element is concrete and not abstract.
* Returns true if a method is with a real implementation, or if a type can
Copy link
Member

Choose a reason for hiding this comment

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

"if this element is a method with a concrete implementation, or a type that can be instantiated"

* be instantiated. For example, array types return true for both
* {@link #isAbstract()} and this method.
*
* @return whether this element is concrete
* @see ResolvedJavaType#isConcrete()
*/
default boolean isConcrete() {
return !isAbstract();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ public void isArrayTest() {
}
}

@Test
public void isConcreteClassTest() {
for (Class<?> c : classes) {
ResolvedJavaType type = metaAccess.lookupJavaType(c);
boolean expected = c.isArray() || !isAbstract(c.getModifiers());
boolean actual = type.isConcrete();
assertEquals(expected, actual);
}
}

@Test
public void lambdaInternalNameTest() {
// Verify that the last dot in lambda types is properly handled when transitioning from
Expand Down