Skip to content

Commit c7852fe

Browse files
committed
fix another bug in detecting when a repo method param is multivalued
Signed-off-by: Gavin King <[email protected]>
1 parent 38a41e0 commit c7852fe

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1244,14 +1244,27 @@ else if ( returnArgument
12441244
sessionType,
12451245
operation,
12461246
context.addNonnullAnnotation(),
1247-
declaredType != parameterType,
1247+
isIterableLifecycleParameter(parameterType),
12481248
returnArgument
12491249
)
12501250
);
12511251
}
12521252
}
12531253
}
12541254

1255+
private static boolean isIterableLifecycleParameter(TypeMirror parameterType) {
1256+
switch (parameterType.getKind()) {
1257+
case ARRAY:
1258+
return true;
1259+
case DECLARED:
1260+
final DeclaredType declaredType = (DeclaredType) parameterType;
1261+
final TypeElement typeElement = (TypeElement) declaredType.asElement();
1262+
return typeElement.getQualifiedName().contentEquals(LIST);
1263+
default:
1264+
return false;
1265+
}
1266+
}
1267+
12551268
private static boolean isVoid(TypeMirror returnType) {
12561269
switch (returnType.getKind()) {
12571270
case VOID:

0 commit comments

Comments
 (0)