HHH-18920 Proper class name is JpaSelection.getJavaTypeName(), not JpaSelection.getJavaType().getName()

This commit is contained in:
Čedomir Igaly 2024-12-06 16:24:46 +01:00 committed by Gavin King
parent 54781895db
commit 2ff75df6a1
1 changed files with 3 additions and 4 deletions

View File

@ -2678,12 +2678,11 @@ public class AnnotationMetaEntity extends AnnotationMeta {
private static boolean parameterMatches(VariableElement parameter, JpaSelection<?> item) { private static boolean parameterMatches(VariableElement parameter, JpaSelection<?> item) {
final Class<?> javaType = item.getJavaType(); final Class<?> javaType = item.getJavaType();
return javaType != null && parameterMatches( parameter.asType(), javaType ); return javaType != null && parameterMatches( parameter.asType(), javaType, item.getJavaTypeName() );
} }
private static boolean parameterMatches(TypeMirror parameterType, Class<?> itemType) { private static boolean parameterMatches(TypeMirror parameterType, Class<?> itemType, String itemTypeName) {
final TypeKind kind = parameterType.getKind(); final TypeKind kind = parameterType.getKind();
final String itemTypeName = itemType.getName();
if ( kind == TypeKind.DECLARED ) { if ( kind == TypeKind.DECLARED ) {
final DeclaredType declaredType = (DeclaredType) parameterType; final DeclaredType declaredType = (DeclaredType) parameterType;
final TypeElement paramTypeElement = (TypeElement) declaredType.asElement(); final TypeElement paramTypeElement = (TypeElement) declaredType.asElement();
@ -2695,7 +2694,7 @@ public class AnnotationMetaEntity extends AnnotationMeta {
else if ( kind == TypeKind.ARRAY ) { else if ( kind == TypeKind.ARRAY ) {
final ArrayType arrayType = (ArrayType) parameterType; final ArrayType arrayType = (ArrayType) parameterType;
return itemType.isArray() return itemType.isArray()
&& parameterMatches( arrayType.getComponentType(), itemType.getComponentType() ); && parameterMatches( arrayType.getComponentType(), itemType.getComponentType(), itemType.getComponentType().getTypeName() );
} }
else { else {
return false; return false;