Skip to content

Commit 4396624

Browse files
committed
Making the Subscribers use a common base class- synchronized on each method
1 parent 74567fe commit 4396624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/dataloader/DataLoaderHelper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ public synchronized void onNext(V value) {
726726

727727

728728
@Override
729-
public void onComplete() {
729+
public synchronized void onComplete() {
730730
super.onComplete();
731731
assertResultSize(keys, completedValues);
732732

@@ -735,7 +735,7 @@ public void onComplete() {
735735
}
736736

737737
@Override
738-
public void onError(Throwable ex) {
738+
public synchronized void onError(Throwable ex) {
739739
super.onError(ex);
740740
ex = unwrapThrowable(ex);
741741
// Set the remaining keys to the exception.
@@ -777,7 +777,7 @@ private DataLoaderMapEntrySubscriber(
777777

778778

779779
@Override
780-
public void onNext(Map.Entry<K, V> entry) {
780+
public synchronized void onNext(Map.Entry<K, V> entry) {
781781
super.onNext(entry);
782782
K key = entry.getKey();
783783
V value = entry.getValue();
@@ -791,7 +791,7 @@ public void onNext(Map.Entry<K, V> entry) {
791791
}
792792

793793
@Override
794-
public void onComplete() {
794+
public synchronized void onComplete() {
795795
super.onComplete();
796796

797797
possiblyClearCacheEntriesOnExceptions(clearCacheKeys);
@@ -804,7 +804,7 @@ public void onComplete() {
804804
}
805805

806806
@Override
807-
public void onError(Throwable ex) {
807+
public synchronized void onError(Throwable ex) {
808808
super.onError(ex);
809809
ex = unwrapThrowable(ex);
810810
// Complete the futures for the remaining keys with the exception.

0 commit comments

Comments
 (0)