Skip to content

Commit f1c54b5

Browse files
Merge pull request #211 from benjchristensen/issue-192
Remove use of JSR 305 and dependency on com.google.code.findbugs
2 parents 77c7011 + 256e083 commit f1c54b5

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

rxjava-core/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ targetCompatibility = JavaVersion.VERSION_1_6
88

99
dependencies {
1010
compile 'org.slf4j:slf4j-api:1.7.0'
11-
compile 'com.google.code.findbugs:jsr305:2.0.0'
1211
provided 'junit:junit:4.10'
1312
provided 'org.mockito:mockito-core:1.8.5'
1413
}

rxjava-core/src/main/java/rx/operators/OperationZip.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
import java.util.concurrent.ConcurrentLinkedQueue;
2424
import java.util.concurrent.atomic.AtomicBoolean;
2525

26-
import javax.annotation.concurrent.GuardedBy;
27-
import javax.annotation.concurrent.ThreadSafe;
28-
2926
import org.junit.Test;
3027
import org.mockito.InOrder;
3128

@@ -68,7 +65,9 @@ public static <T0, T1, T2, T3, R> Func1<Observer<R>, Subscription> zip(Observabl
6865
return a;
6966
}
7067

71-
@ThreadSafe
68+
/*
69+
* ThreadSafe
70+
*/
7271
private static class ZipObserver<R, T> implements Observer<T> {
7372
final Observable<T> w;
7473
final Aggregator<R> a;
@@ -110,9 +109,10 @@ public void onNext(T args) {
110109
/**
111110
* Receive notifications from each of the Observables we are reducing and execute the zipFunction whenever we have received events from all Observables.
112111
*
112+
* This class is thread-safe.
113+
*
113114
* @param <T>
114115
*/
115-
@ThreadSafe
116116
private static class Aggregator<T> implements Func1<Observer<T>, Subscription> {
117117

118118
private volatile SynchronizedObserver<T> observer;
@@ -132,10 +132,11 @@ public Aggregator(FuncN<T> zipFunction) {
132132

133133
/**
134134
* Receive notification of a Observer starting (meaning we should require it for aggregation)
135+
*
136+
* Thread Safety => Invoke ONLY from the static factory methods at top of this class which are always an atomic execution by a single thread.
135137
*
136138
* @param w
137139
*/
138-
@GuardedBy("Invoked ONLY from the static factory methods at top of this class which are always an atomic execution by a single thread.")
139140
private void addObserver(ZipObserver<T, ?> w) {
140141
// initialize this ZipObserver
141142
observers.add(w);

rxjava-core/src/main/java/rx/util/AtomicObservableSubscription.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import java.util.concurrent.atomic.AtomicBoolean;
1919
import java.util.concurrent.atomic.AtomicReference;
2020

21-
import javax.annotation.concurrent.ThreadSafe;
22-
2321
import rx.Subscription;
2422

2523
/**
@@ -32,7 +30,6 @@
3230
* <li>handle both synchronous and asynchronous subscribe() execution flows</li>
3331
* </ul>
3432
*/
35-
@ThreadSafe
3633
public final class AtomicObservableSubscription implements Subscription {
3734

3835
private AtomicReference<Subscription> actualSubscription = new AtomicReference<Subscription>();

rxjava-core/src/main/java/rx/util/SynchronizedObserver.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import java.util.concurrent.TimeUnit;
2727
import java.util.concurrent.atomic.AtomicInteger;
2828

29-
import javax.annotation.concurrent.ThreadSafe;
30-
3129
import org.junit.Before;
3230
import org.junit.Test;
3331
import org.mockito.Mock;
@@ -50,7 +48,6 @@
5048
*
5149
* @param <T>
5250
*/
53-
@ThreadSafe
5451
public final class SynchronizedObserver<T> implements Observer<T> {
5552

5653
/**

0 commit comments

Comments
 (0)