6161 *
6262 * @param <TARGET> Object type (entity).
6363 */
64- @ SuppressWarnings ("unchecked" )
6564public class ToMany <TARGET > implements List <TARGET >, Serializable {
6665 private static final long serialVersionUID = 2367317778240689006L ;
6766 private final static Integer ONE = Integer .valueOf (1 );
@@ -85,7 +84,7 @@ public class ToMany<TARGET> implements List<TARGET>, Serializable {
8584 List <TARGET > entitiesToRemoveFromDb ;
8685
8786 transient private BoxStore boxStore ;
88- transient private Box entityBox ;
87+ transient private Box < Object > entityBox ;
8988 transient private volatile Box <TARGET > targetBox ;
9089 transient private boolean removeFromTargetBox ;
9190 transient private Comparator <TARGET > comparator ;
@@ -295,12 +294,12 @@ public synchronized void clear() {
295294 entitiesToClear .clear ();
296295 }
297296
298- Map setToClear = entitiesAdded ;
297+ Map < TARGET , Boolean > setToClear = entitiesAdded ;
299298 if (setToClear != null ) {
300299 setToClear .clear ();
301300 }
302301
303- Map entityCountsToClear = this .entityCounts ;
302+ Map < TARGET , Integer > entityCountsToClear = this .entityCounts ;
304303 if (entityCountsToClear != null ) {
305304 entityCountsToClear .clear ();
306305 }
@@ -557,7 +556,7 @@ public void applyChangesToDb() {
557556 if (internalCheckApplyToDbRequired ()) {
558557 // We need a TX because we use two writers and both must use same TX (without: unchecked, SIGSEGV)
559558 boxStore .runInTx (() -> {
560- Cursor sourceCursor = InternalAccess .getActiveTxCursor (entityBox );
559+ Cursor < Object > sourceCursor = InternalAccess .getActiveTxCursor (entityBox );
561560 Cursor <TARGET > targetCursor = InternalAccess .getActiveTxCursor (targetBox );
562561 internalApplyToDb (sourceCursor , targetCursor );
563562 });
@@ -782,7 +781,7 @@ private boolean prepareToOneBacklinkEntitiesForDb(long entityId, IdGetter<TARGET
782781 * Convention: {@link #internalCheckApplyToDbRequired()} must be called before this call as it prepares .
783782 */
784783 @ Internal
785- public void internalApplyToDb (Cursor sourceCursor , Cursor <TARGET > targetCursor ) {
784+ public void internalApplyToDb (Cursor <?> sourceCursor , Cursor <TARGET > targetCursor ) {
786785 TARGET [] toRemoveFromDb ;
787786 TARGET [] toPut ;
788787 TARGET [] addedStandalone = null ;
@@ -848,7 +847,7 @@ public void internalApplyToDb(Cursor sourceCursor, Cursor<TARGET> targetCursor)
848847 /**
849848 * The list of removed entities may contain non-persisted entities, which will be ignored (removed from the list).
850849 */
851- private void removeStandaloneRelations (Cursor cursor , long sourceEntityId , List <TARGET > removed ,
850+ private void removeStandaloneRelations (Cursor <?> cursor , long sourceEntityId , List <TARGET > removed ,
852851 IdGetter <TARGET > targetIdGetter ) {
853852 Iterator <TARGET > iterator = removed .iterator ();
854853 while (iterator .hasNext ()) {
@@ -868,7 +867,7 @@ private void removeStandaloneRelations(Cursor cursor, long sourceEntityId, List<
868867 }
869868
870869 /** The target array may not contain non-persisted entities. */
871- private void addStandaloneRelations (Cursor cursor , long sourceEntityId , TARGET [] added ,
870+ private void addStandaloneRelations (Cursor <?> cursor , long sourceEntityId , TARGET [] added ,
872871 IdGetter <TARGET > targetIdGetter ) {
873872 int length = added .length ;
874873 long [] targetIds = new long [length ];
0 commit comments