61
61
*
62
62
* @param <TARGET> Object type (entity).
63
63
*/
64
- @ SuppressWarnings ("unchecked" )
65
64
public class ToMany <TARGET > implements List <TARGET >, Serializable {
66
65
private static final long serialVersionUID = 2367317778240689006L ;
67
66
private final static Integer ONE = Integer .valueOf (1 );
@@ -85,7 +84,7 @@ public class ToMany<TARGET> implements List<TARGET>, Serializable {
85
84
List <TARGET > entitiesToRemoveFromDb ;
86
85
87
86
transient private BoxStore boxStore ;
88
- transient private Box entityBox ;
87
+ transient private Box < Object > entityBox ;
89
88
transient private volatile Box <TARGET > targetBox ;
90
89
transient private boolean removeFromTargetBox ;
91
90
transient private Comparator <TARGET > comparator ;
@@ -295,12 +294,12 @@ public synchronized void clear() {
295
294
entitiesToClear .clear ();
296
295
}
297
296
298
- Map setToClear = entitiesAdded ;
297
+ Map < TARGET , Boolean > setToClear = entitiesAdded ;
299
298
if (setToClear != null ) {
300
299
setToClear .clear ();
301
300
}
302
301
303
- Map entityCountsToClear = this .entityCounts ;
302
+ Map < TARGET , Integer > entityCountsToClear = this .entityCounts ;
304
303
if (entityCountsToClear != null ) {
305
304
entityCountsToClear .clear ();
306
305
}
@@ -557,7 +556,7 @@ public void applyChangesToDb() {
557
556
if (internalCheckApplyToDbRequired ()) {
558
557
// We need a TX because we use two writers and both must use same TX (without: unchecked, SIGSEGV)
559
558
boxStore .runInTx (() -> {
560
- Cursor sourceCursor = InternalAccess .getActiveTxCursor (entityBox );
559
+ Cursor < Object > sourceCursor = InternalAccess .getActiveTxCursor (entityBox );
561
560
Cursor <TARGET > targetCursor = InternalAccess .getActiveTxCursor (targetBox );
562
561
internalApplyToDb (sourceCursor , targetCursor );
563
562
});
@@ -782,7 +781,7 @@ private boolean prepareToOneBacklinkEntitiesForDb(long entityId, IdGetter<TARGET
782
781
* Convention: {@link #internalCheckApplyToDbRequired()} must be called before this call as it prepares .
783
782
*/
784
783
@ Internal
785
- public void internalApplyToDb (Cursor sourceCursor , Cursor <TARGET > targetCursor ) {
784
+ public void internalApplyToDb (Cursor <?> sourceCursor , Cursor <TARGET > targetCursor ) {
786
785
TARGET [] toRemoveFromDb ;
787
786
TARGET [] toPut ;
788
787
TARGET [] addedStandalone = null ;
@@ -848,7 +847,7 @@ public void internalApplyToDb(Cursor sourceCursor, Cursor<TARGET> targetCursor)
848
847
/**
849
848
* The list of removed entities may contain non-persisted entities, which will be ignored (removed from the list).
850
849
*/
851
- private void removeStandaloneRelations (Cursor cursor , long sourceEntityId , List <TARGET > removed ,
850
+ private void removeStandaloneRelations (Cursor <?> cursor , long sourceEntityId , List <TARGET > removed ,
852
851
IdGetter <TARGET > targetIdGetter ) {
853
852
Iterator <TARGET > iterator = removed .iterator ();
854
853
while (iterator .hasNext ()) {
@@ -868,7 +867,7 @@ private void removeStandaloneRelations(Cursor cursor, long sourceEntityId, List<
868
867
}
869
868
870
869
/** 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 ,
872
871
IdGetter <TARGET > targetIdGetter ) {
873
872
int length = added .length ;
874
873
long [] targetIds = new long [length ];
0 commit comments