3131import java .util .regex .Pattern ;
3232
3333import org .jspecify .annotations .Nullable ;
34-
3534import org .springframework .beans .factory .InitializingBean ;
3635import org .springframework .core .CollectionFactory ;
3736import org .springframework .core .convert .ConversionService ;
@@ -173,7 +172,7 @@ public MappingRedisConverter(@Nullable RedisMappingContext mappingContext, @Null
173172 }
174173
175174 @ Override
176- @ SuppressWarnings ({"unchecked" , "NullAway" })
175+ @ SuppressWarnings ({ "unchecked" , "NullAway" })
177176 public <R > R read (Class <R > type , RedisData source ) {
178177
179178 TypeInformation <?> readType = typeMapper .readType (source .getBucket ().getPath (), TypeInformation .of (type ));
@@ -188,8 +187,8 @@ public <R> R read(Class<R> type, RedisData source) {
188187 return source .getBucket ().isEmpty () ? null : doReadInternal (path , type , source );
189188 }
190189
191- @ SuppressWarnings ({"unchecked" , "NullAway" })
192- private <R > R doReadInternal (String path , Class <R > type , RedisData source ) {
190+ @ SuppressWarnings ({ "unchecked" , "NullAway" })
191+ private <R > R doReadInternal (String path , Class <R > type , RedisData source ) {
193192
194193 TypeInformation <?> readType = typeMapper .readType (source .getBucket ().getPath (), TypeInformation .of (type ));
195194
@@ -403,14 +402,8 @@ public void write(@Nullable Object source, RedisData sink) {
403402 return ;
404403 }
405404
406- if (source instanceof Collection ) {
407- writeCollection (
408- sink .getKeyspace (),
409- "" ,
410- (List <?>) source ,
411- TypeInformation .of (Object .class ),
412- sink
413- );
405+ if (source instanceof Collection collection ) {
406+ writeCollection (sink .getKeyspace (), "" , collection , TypeInformation .of (Object .class ), sink );
414407 return ;
415408 }
416409
@@ -432,8 +425,7 @@ public void write(@Nullable Object source, RedisData sink) {
432425 sink .setKeyspace (keySpace );
433426
434427 if (entity .getTypeInformation ().isCollectionLike ()) {
435- writeCollection (keySpace , "" , (List ) source , entity .getTypeInformation ().getRequiredComponentType (),
436- sink );
428+ writeCollection (keySpace , "" , (List ) source , entity .getTypeInformation ().getRequiredComponentType (), sink );
437429 } else {
438430 writeInternal (keySpace , "" , source , entity .getTypeInformation (), sink );
439431 }
@@ -562,8 +554,7 @@ private void writePartialPropertyUpdate(PartialUpdate<?> update, PropertyUpdate
562554 writeMap (keySpace , pUpdate .getPropertyPath (), targetProperty .getMapValueType (), map , sink );
563555 } else {
564556
565- writeInternal (keySpace , pUpdate .getPropertyPath (), pUpdate .getValue (),
566- targetProperty .getTypeInformation (), sink );
557+ writeInternal (keySpace , pUpdate .getPropertyPath (), pUpdate .getValue (), targetProperty .getTypeInformation (), sink );
567558
568559 Set <IndexedData > data = indexResolver .resolveIndexesFor (keySpace , pUpdate .getPropertyPath (),
569560 targetProperty .getTypeInformation (), pUpdate .getValue ());
@@ -586,8 +577,7 @@ RedisPersistentProperty getTargetPropertyOrNullForPath(String path, Class<?> typ
586577 PersistentPropertyPath <RedisPersistentProperty > persistentPropertyPath = mappingContext
587578 .getPersistentPropertyPath (path , type );
588579 return persistentPropertyPath .getLeafProperty ();
589- } catch (Exception ignore ) {
590- }
580+ } catch (Exception ignore ) {}
591581
592582 return null ;
593583 }
@@ -694,7 +684,7 @@ private ReferenceResolver getRequiredReferenceResolver() {
694684
695685 Assert .notNull (referenceResolver , "ReferenceResolver must not be null" );
696686 return referenceResolver ;
697- }
687+ }
698688
699689 private void writeAssociation (String path , RedisPersistentEntity <?> entity , @ Nullable Object value , RedisData sink ) {
700690
@@ -822,7 +812,8 @@ private void writeToBucket(String path, @Nullable Object value, RedisData sink,
822812 }
823813
824814 @ SuppressWarnings ("NullAway" )
825- private @ Nullable Object readCollectionOrArray (String path , Class <?> collectionType , Class <?> valueType , Bucket bucket ) {
815+ private @ Nullable Object readCollectionOrArray (String path , Class <?> collectionType , Class <?> valueType ,
816+ Bucket bucket ) {
826817
827818 List <String > keys = new ArrayList <>(bucket .extractAllKeysFor (path ));
828819 keys .sort (listKeyComparator );
@@ -991,7 +982,7 @@ private Class<?> getTypeHint(String path, Bucket bucket, Class<?> fallback) {
991982 * @return
992983 * @throws ConverterNotFoundException
993984 */
994- public byte @ Nullable [] toBytes (Object source ) {
985+ public byte @ Nullable [] toBytes (Object source ) {
995986
996987 if (source instanceof byte [] bytes ) {
997988 return bytes ;
0 commit comments