Skip to content

Commit

Permalink
Use proper Unnamed Class API.
Browse files Browse the repository at this point in the history
- See eclipse-jdtls/eclipse-jdt-core-incubator#102

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
  • Loading branch information
rgrunber committed Mar 18, 2024
1 parent 5367708 commit 6bca713
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,11 @@ public static boolean isGenerated(IMember member) {
}

public static boolean isUnnamedClass(IJavaElement element) {
return element.getElementType() == IJavaElement.TYPE && element.getElementName().startsWith("<unnamed_class$");
try {
return element.getElementType() == IJavaElement.TYPE && ((IType) element).isImplicitlyDeclared();
} catch (JavaModelException e) {
return false;
}
}

}

0 comments on commit 6bca713

Please sign in to comment.