simplification to JD generated code

because I got a requirement removed from spec
This commit is contained in:
Gavin King 2024-03-23 16:44:57 +01:00
parent f3dd73dd2f
commit dc4c87c182
1 changed files with 3 additions and 15 deletions
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation

View File

@ -8,8 +8,6 @@ package org.hibernate.processor.annotation;
import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import static org.hibernate.processor.util.TypeUtils.isPrimitive;
@ -147,22 +145,12 @@ public abstract class AbstractCriteriaMethod extends AbstractFinderMethod {
.append(".in(");
if ( paramType.endsWith("[]") ) {
declaration
.append("(Object[]) ")
//TODO: only safe if we are binding literals as parameters!!!
.append(parameterName);
.append("(Object[]) ");
}
else {
declaration
.append(annotationMetaEntity.staticImport(StreamSupport.class.getName(), "stream"))
.append('(')
//TODO: only safe if we are binding literals as parameters!!!
.append(parameterName)
.append(".spliterator(), false).collect(") // ugh, very ugly!
.append(annotationMetaEntity.staticImport(Collectors.class.getName(), "toList"))
.append("())");
}
declaration
//TODO: only safe if we are binding literals as parameters!!!
.append(parameterName)
.append(")");
}
else {