Skip to content

Commit

Permalink
HHH-16261 - Avoid explicit use of ElementKind.RECORD to make code com…
Browse files Browse the repository at this point in the history
…pilable under JDK 11
  • Loading branch information
cigaly authored and beikov committed Apr 25, 2023
1 parent bece9e9 commit 0b1d1a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -223,7 +223,7 @@ private boolean isJPAEntity(Element element) {
private void handleRootElementAnnotationMirrors(final Element element) {
List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
for ( AnnotationMirror mirror : annotationMirrors ) {
if ( !ElementKind.CLASS.equals( element.getKind() ) && !ElementKind.RECORD.equals( element.getKind() ) ) {
if ( !element.getKind().isClass() || ElementKind.ENUM.equals( element.getKind() ) ) {
continue;
}

Expand Down
Expand Up @@ -316,7 +316,8 @@ public Boolean visitDeclared(DeclaredType declaredType, Element element) {
return Boolean.TRUE;
}

if ( ElementKind.CLASS.equals( element.getKind() ) || ElementKind.INTERFACE.equals( element.getKind() ) || ElementKind.RECORD.equals( element.getKind() ) ) {
if ( ( element.getKind().isClass() && !ElementKind.ENUM.equals( element.getKind() ) ) ||
ElementKind.INTERFACE.equals( element.getKind() ) ) {
TypeElement typeElement = ( (TypeElement) element );
String typeName = typeElement.getQualifiedName().toString();
if ( Constants.BASIC_TYPES.contains( typeName ) ) {
Expand Down

0 comments on commit 0b1d1a1

Please sign in to comment.