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

View File

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