@@ -41,7 +41,7 @@ public class QueryParameterBindingImpl<T> implements QueryParameterBinding<T>, J
4141 private TemporalType explicitTemporalPrecision ;
4242
4343 private T bindValue ;
44- private Collection <T > bindValues ;
44+ private Collection <? extends T > bindValues ;
4545
4646 // todo (6.0) : add TemporalType to QueryParameter and use to default precision here
4747
@@ -164,8 +164,7 @@ private void bindValue(T value) {
164164
165165 if ( bindType == null ) {
166166 if ( value != null ) {
167- //noinspection unchecked
168- this .bindType = (AllowableParameterType <T >) typeResolver .resolveParameterBindType ( value );
167+ this .bindType = typeResolver .resolveParameterBindType ( value );
169168 }
170169 }
171170 }
@@ -239,7 +238,7 @@ else if ( queryParameter.getHibernateType() != null ) {
239238 // multi-valued binding support
240239
241240 @ Override
242- public Collection <T > getBindValues () {
241+ public Collection <? extends T > getBindValues () {
243242 if ( !isMultiValued ) {
244243 throw new IllegalStateException ( "Binding is not multi-valued; illegal call to #getBindValues" );
245244 }
@@ -253,8 +252,7 @@ public void setBindValues(Collection<? extends T> values) {
253252 this .isMultiValued = true ;
254253
255254 this .bindValue = null ;
256- //noinspection unchecked
257- this .bindValues = (Collection <T >) values ;
255+ this .bindValues = values ;
258256
259257 final Iterator <? extends T > iterator = values .iterator ();
260258 T value = null ;
@@ -263,8 +261,7 @@ public void setBindValues(Collection<? extends T> values) {
263261 }
264262
265263 if ( bindType == null && value != null ) {
266- //noinspection unchecked
267- this .bindType = (AllowableParameterType <T >) typeResolver .resolveParameterBindType ( value );
264+ this .bindType = typeResolver .resolveParameterBindType ( value );
268265 }
269266
270267 }
@@ -300,12 +297,12 @@ private void setExplicitTemporalPrecision(TemporalType temporalTypePrecision) {
300297 }
301298
302299 @ Override
303- public MappingModelExpressable getType () {
300+ public MappingModelExpressable < T > getType () {
304301 return type ;
305302 }
306303
307- @ Override
308- public boolean setType (MappingModelExpressable type ) {
304+ @ Override @ SuppressWarnings ( "unchecked" )
305+ public boolean setType (MappingModelExpressable < T > type ) {
309306 this .type = type ;
310307 if ( bindType == null || bindType .getJavaType () == Object .class ) {
311308 if ( type instanceof AllowableParameterType <?> ) {
@@ -329,7 +326,7 @@ private void validate(T value) {
329326 QueryParameterBindingValidator .INSTANCE .validate ( getBindType (), value );
330327 }
331328
332- private void validate (T value , AllowableParameterType clarifiedType ) {
329+ private void validate (T value , AllowableParameterType <?> clarifiedType ) {
333330 QueryParameterBindingValidator .INSTANCE .validate ( clarifiedType , value );
334331 }
335332
0 commit comments