Skip to content

Warnings cleanup #2547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/rx/exceptions/OnErrorThrowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private static String renderValue(Object value){
return (String) value;
}
if (value instanceof Enum) {
return ((Enum) value).name();
return ((Enum<?>) value).name();
}
return value.getClass().getName() + ".class";
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/rx/functions/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package rx.functions;

import rx.Observer;

/**
* Utility class for the Action interfaces.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public void remove() {

private static class NextObserver<T> extends Subscriber<Notification<? extends T>> {
private final BlockingQueue<Notification<? extends T>> buf = new ArrayBlockingQueue<Notification<? extends T>>(1);
@SuppressWarnings("unused")
volatile int waiting;
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater<NextObserver> WAITING_UPDATER
Expand Down
1 change: 0 additions & 1 deletion src/main/java/rx/internal/operators/OnSubscribeCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.observers.Subscribers;
import rx.subjects.ReplaySubject;
import rx.subjects.Subject;

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/rx/internal/operators/OperatorGroupBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
*/
package rx.internal.operators;

import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
Expand Down Expand Up @@ -206,6 +204,7 @@ private Object groupedKey(K key) {
return key == null ? NULL_KEY : key;
}

@SuppressWarnings("unchecked")
private K getKey(Object groupedKey) {
return groupedKey == NULL_KEY ? null : (K) groupedKey;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/rx/internal/operators/OperatorObserveOn.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ private static final class ObserveOnSubscriber<T> extends Subscriber<T> {
private boolean completed = false;
private boolean failure = false;

@SuppressWarnings("unused")
private volatile long requested = 0;
@SuppressWarnings("rawtypes")
static final AtomicLongFieldUpdater<ObserveOnSubscriber> REQUESTED = AtomicLongFieldUpdater.newUpdater(ObserveOnSubscriber.class, "requested");

@SuppressWarnings("unused")
volatile long counter;
@SuppressWarnings("rawtypes")
static final AtomicLongFieldUpdater<ObserveOnSubscriber> COUNTER_UPDATER = AtomicLongFieldUpdater.newUpdater(ObserveOnSubscriber.class, "counter");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/rx/internal/operators/OperatorPublish.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package rx.internal.operators;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -266,6 +265,7 @@ public synchronized void removeSubscriber(Subscriber<? super T> subscriber) {
resetAfterSubscriberUpdate();
}

@SuppressWarnings("unchecked")
private long resetAfterSubscriberUpdate() {
subscribers = new Subscriber[ss.size()];
int i = 0;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/rx/internal/operators/OperatorScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import rx.exceptions.OnErrorThrowable;
import rx.functions.Func0;
import rx.functions.Func2;
import rx.internal.util.UtilityFunctions;

/**
* Returns an Observable that applies a function to the first item emitted by a source Observable, then feeds
Expand Down
1 change: 0 additions & 1 deletion src/main/java/rx/observables/BlockingObservable.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import rx.Subscription;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.functions.Functions;
import rx.internal.operators.BlockingOperatorLatest;
import rx.internal.operators.BlockingOperatorMostRecent;
import rx.internal.operators.BlockingOperatorNext;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/rx/schedulers/CachedThreadScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public Worker createWorker() {
private static final class EventLoopWorker extends Scheduler.Worker {
private final CompositeSubscription innerSubscription = new CompositeSubscription();
private final ThreadWorker threadWorker;
@SuppressWarnings("unused")
volatile int once;
static final AtomicIntegerFieldUpdater<EventLoopWorker> ONCE_UPDATER
= AtomicIntegerFieldUpdater.newUpdater(EventLoopWorker.class, "once");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/rx/schedulers/TrampolineScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public Worker createWorker() {

private static class InnerCurrentThreadScheduler extends Scheduler.Worker implements Subscription {

private static final AtomicIntegerFieldUpdater COUNTER_UPDATER = AtomicIntegerFieldUpdater.newUpdater(InnerCurrentThreadScheduler.class, "counter");
private static final AtomicIntegerFieldUpdater<InnerCurrentThreadScheduler> COUNTER_UPDATER = AtomicIntegerFieldUpdater.newUpdater(InnerCurrentThreadScheduler.class, "counter");
@SuppressWarnings("unused")
volatile int counter;
private final PriorityBlockingQueue<TimedAction> queue = new PriorityBlockingQueue<TimedAction>();
private final BooleanSubscription innerSubscription = new BooleanSubscription();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/rx/subjects/TestSubject.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.Observer;
import rx.Scheduler;
import rx.functions.Action0;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/rx/subscriptions/Subscriptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
package rx.subscriptions;

import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

import rx.Subscription;
import rx.annotations.Experimental;
import rx.functions.Action0;
import rx.functions.Actions;

/**
* Helper methods and utilities for creating and working with {@link Subscription} objects
Expand Down