From d0973b28c1d9fda898c861d9ed8faaf7b0bd0dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Cedomir=20Igaly?= Date: Mon, 17 Jun 2024 17:02:21 +0200 Subject: [PATCH] HHH-18278 - Method org.hibernate.processor.HibernateProcessor#included(Element) should accept both TypeElement and PackageElement --- .../java/org/hibernate/processor/HibernateProcessor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/HibernateProcessor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/HibernateProcessor.java index 0862baf7ed..a04eec8019 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/HibernateProcessor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/HibernateProcessor.java @@ -25,6 +25,7 @@ import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.QualifiedNameable; import javax.lang.model.element.TypeElement; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeKind; @@ -338,9 +339,9 @@ public class HibernateProcessor extends AbstractProcessor { } private boolean included(Element element) { - if ( element instanceof TypeElement) { - final TypeElement typeElement = (TypeElement) element; - return context.isIncluded( typeElement.getQualifiedName().toString() ); + if ( element instanceof TypeElement || element instanceof PackageElement ) { + final QualifiedNameable nameable = (QualifiedNameable) element; + return context.isIncluded( nameable.getQualifiedName().toString() ); } else { return false;