The following issues were found
src/main/java/io/reactivex/rxjava3/internal/observers/BlockingDisposableMultiObserver.java
5 issues
Line: 35
extends CountDownLatch
implements MaybeObserver<T>, SingleObserver<T>, CompletableObserver, Disposable {
T value;
Throwable error;
final SequentialDisposable upstream;
public BlockingDisposableMultiObserver() {
Reported by PMD.
Line: 36
implements MaybeObserver<T>, SingleObserver<T>, CompletableObserver, Disposable {
T value;
Throwable error;
final SequentialDisposable upstream;
public BlockingDisposableMultiObserver() {
super(1);
Reported by PMD.
Line: 38
T value;
Throwable error;
final SequentialDisposable upstream;
public BlockingDisposableMultiObserver() {
super(1);
upstream = new SequentialDisposable();
}
Reported by PMD.
Line: 19
import java.util.concurrent.CountDownLatch;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.*;
import io.reactivex.rxjava3.internal.util.BlockingHelper;
/**
Reported by PMD.
Line: 21
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.*;
import io.reactivex.rxjava3.internal.util.BlockingHelper;
/**
* Blocks until the upstream terminates and dispatches the outcome to
* the actual observer.
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeFromCompletable.java
5 issues
Line: 28
*/
public final class MaybeFromCompletable<T> extends Maybe<T> implements HasUpstreamCompletableSource {
final CompletableSource source;
public MaybeFromCompletable(CompletableSource source) {
this.source = source;
}
Reported by PMD.
Line: 28
*/
public final class MaybeFromCompletable<T> extends Maybe<T> implements HasUpstreamCompletableSource {
final CompletableSource source;
public MaybeFromCompletable(CompletableSource source) {
this.source = source;
}
Reported by PMD.
Line: 45
}
static final class FromCompletableObserver<T> implements CompletableObserver, Disposable {
final MaybeObserver<? super T> downstream;
Disposable upstream;
FromCompletableObserver(MaybeObserver<? super T> downstream) {
this.downstream = downstream;
Reported by PMD.
Line: 47
static final class FromCompletableObserver<T> implements CompletableObserver, Disposable {
final MaybeObserver<? super T> downstream;
Disposable upstream;
FromCompletableObserver(MaybeObserver<? super T> downstream) {
this.downstream = downstream;
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.maybe;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamCompletableSource;
/**
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/single/SingleDoOnSuccess.java
5 issues
Line: 23
public final class SingleDoOnSuccess<T> extends Single<T> {
final SingleSource<T> source;
final Consumer<? super T> onSuccess;
public SingleDoOnSuccess(SingleSource<T> source, Consumer<? super T> onSuccess) {
this.source = source;
Reported by PMD.
Line: 25
final SingleSource<T> source;
final Consumer<? super T> onSuccess;
public SingleDoOnSuccess(SingleSource<T> source, Consumer<? super T> onSuccess) {
this.source = source;
this.onSuccess = onSuccess;
}
Reported by PMD.
Line: 40
final class DoOnSuccess implements SingleObserver<T> {
final SingleObserver<? super T> downstream;
DoOnSuccess(SingleObserver<? super T> observer) {
this.downstream = observer;
}
Reported by PMD.
Line: 55
public void onSuccess(T value) {
try {
onSuccess.accept(value);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
downstream.onError(ex);
return;
}
downstream.onSuccess(value);
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.single;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Consumer;
public final class SingleDoOnSuccess<T> extends Single<T> {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCount.java
5 issues
Line: 37
private static final long serialVersionUID = 4973004223787171406L;
Subscription upstream;
long count;
CountSubscriber(Subscriber<? super Long> downstream) {
super(downstream);
Reported by PMD.
Line: 39
Subscription upstream;
long count;
CountSubscriber(Subscriber<? super Long> downstream) {
super(downstream);
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.flowable;
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableCount<T> extends AbstractFlowableWithUpstream<T, Long> {
Reported by PMD.
Line: 18
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableCount<T> extends AbstractFlowableWithUpstream<T, Long> {
public FlowableCount(Flowable<T> source) {
Reported by PMD.
Line: 19
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableCount<T> extends AbstractFlowableWithUpstream<T, Long> {
public FlowableCount(Flowable<T> source) {
super(source);
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableIgnoreElements.java
5 issues
Line: 34
source.subscribe(new IgnoreElementsSubscriber<>(t));
}
static final class IgnoreElementsSubscriber<T> implements FlowableSubscriber<T>, QueueSubscription<T> {
final Subscriber<? super T> downstream;
Subscription upstream;
IgnoreElementsSubscriber(Subscriber<? super T> downstream) {
Reported by PMD.
Line: 35
}
static final class IgnoreElementsSubscriber<T> implements FlowableSubscriber<T>, QueueSubscription<T> {
final Subscriber<? super T> downstream;
Subscription upstream;
IgnoreElementsSubscriber(Subscriber<? super T> downstream) {
this.downstream = downstream;
Reported by PMD.
Line: 37
static final class IgnoreElementsSubscriber<T> implements FlowableSubscriber<T>, QueueSubscription<T> {
final Subscriber<? super T> downstream;
Subscription upstream;
IgnoreElementsSubscriber(Subscriber<? super T> downstream) {
this.downstream = downstream;
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.flowable;
import org.reactivestreams.*;
import io.reactivex.rxjava3.annotations.Nullable;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.fuseable.QueueSubscription;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
Reported by PMD.
Line: 19
import org.reactivestreams.*;
import io.reactivex.rxjava3.annotations.Nullable;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.fuseable.QueueSubscription;
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
public final class FlowableIgnoreElements<T> extends AbstractFlowableWithUpstream<T, T> {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/observables/ConnectableObservable.java
5 issues
Line: 53
* @param <T>
* the type of items emitted by the {@code ConnectableObservable}
*/
public abstract class ConnectableObservable<T> extends Observable<T> {
/**
* Instructs the {@code ConnectableObservable} to begin emitting the items from its underlying
* {@link Observable} to its {@link Observer}s.
* <dl>
Reported by PMD.
Line: 19
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.functions.*;
import io.reactivex.rxjava3.internal.operators.observable.*;
Reported by PMD.
Line: 20
import java.util.concurrent.TimeUnit;
import io.reactivex.rxjava3.annotations.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.functions.*;
import io.reactivex.rxjava3.internal.operators.observable.*;
import io.reactivex.rxjava3.internal.util.ConnectConsumer;
Reported by PMD.
Line: 23
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.functions.*;
import io.reactivex.rxjava3.internal.operators.observable.*;
import io.reactivex.rxjava3.internal.util.ConnectConsumer;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.schedulers.Schedulers;
Reported by PMD.
Line: 24
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.internal.functions.*;
import io.reactivex.rxjava3.internal.operators.observable.*;
import io.reactivex.rxjava3.internal.util.ConnectConsumer;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.schedulers.Schedulers;
/**
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/observers/DeferredScalarDisposable.java
5 issues
Line: 30
private static final long serialVersionUID = -5502432239815349361L;
/** The target of the events. */
protected final Observer<? super T> downstream;
/** The value stored temporarily when in fusion mode. */
protected T value;
/** Indicates there was a call to complete(T). */
Reported by PMD.
Line: 33
protected final Observer<? super T> downstream;
/** The value stored temporarily when in fusion mode. */
protected T value;
/** Indicates there was a call to complete(T). */
static final int TERMINATED = 2;
/** Indicates the Disposable has been disposed. */
Reported by PMD.
Line: 120
public final T poll() {
if (get() == FUSED_READY) {
T v = value;
value = null;
lazySet(FUSED_CONSUMED);
return v;
}
return null;
}
Reported by PMD.
Line: 135
@Override
public final void clear() {
lazySet(FUSED_CONSUMED);
value = null;
}
@Override
public void dispose() {
set(DISPOSED);
Reported by PMD.
Line: 141
@Override
public void dispose() {
set(DISPOSED);
value = null;
}
/**
* Try disposing this Disposable and return true if the current thread succeeded.
* @return true if the current thread succeeded
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/util/NotificationLite.java
5 issues
Line: 37
static final class ErrorNotification implements Serializable {
private static final long serialVersionUID = -8759979445933046293L;
final Throwable e;
ErrorNotification(Throwable e) {
this.e = e;
}
@Override
Reported by PMD.
Line: 68
static final class SubscriptionNotification implements Serializable {
private static final long serialVersionUID = -1322257508628817540L;
final Subscription upstream;
SubscriptionNotification(Subscription s) {
this.upstream = s;
}
@Override
Reported by PMD.
Line: 85
static final class DisposableNotification implements Serializable {
private static final long serialVersionUID = -7482590109178395495L;
final Disposable upstream;
DisposableNotification(Disposable d) {
this.upstream = d;
}
Reported by PMD.
Line: 179
* @param o the notification object
* @return the extracted value
*/
@SuppressWarnings("unchecked")
public static <T> T getValue(Object o) {
return (T)o;
}
/**
Reported by PMD.
Line: 19
import java.io.Serializable;
import java.util.Objects;
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
/**
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableFilter.java
5 issues
Line: 22
import io.reactivex.rxjava3.internal.observers.BasicFuseableObserver;
public final class ObservableFilter<T> extends AbstractObservableWithUpstream<T, T> {
final Predicate<? super T> predicate;
public ObservableFilter(ObservableSource<T> source, Predicate<? super T> predicate) {
super(source);
this.predicate = predicate;
}
Reported by PMD.
Line: 34
}
static final class FilterObserver<T> extends BasicFuseableObserver<T, T> {
final Predicate<? super T> filter;
FilterObserver(Observer<? super T> actual, Predicate<? super T> filter) {
super(actual);
this.filter = filter;
}
Reported by PMD.
Line: 47
boolean b;
try {
b = filter.test(t);
} catch (Throwable e) {
fail(e);
return;
}
if (b) {
downstream.onNext(t);
Reported by PMD.
Line: 17
package io.reactivex.rxjava3.internal.operators.observable;
import io.reactivex.rxjava3.annotations.Nullable;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Predicate;
import io.reactivex.rxjava3.internal.observers.BasicFuseableObserver;
public final class ObservableFilter<T> extends AbstractObservableWithUpstream<T, T> {
final Predicate<? super T> predicate;
Reported by PMD.
Line: 46
if (sourceMode == NONE) {
boolean b;
try {
b = filter.test(t);
} catch (Throwable e) {
fail(e);
return;
}
if (b) {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeLastOne.java
5 issues
Line: 37
private static final long serialVersionUID = -5467847744262967226L;
Subscription upstream;
TakeLastOneSubscriber(Subscriber<? super T> downstream) {
super(downstream);
}
Reported by PMD.
Line: 59
@Override
public void onError(Throwable t) {
value = null;
downstream.onError(t);
}
@Override
public void onComplete() {
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.flowable;
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableTakeLastOne<T> extends AbstractFlowableWithUpstream<T, T> {
Reported by PMD.
Line: 18
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableTakeLastOne<T> extends AbstractFlowableWithUpstream<T, T> {
public FlowableTakeLastOne(Flowable<T> source) {
Reported by PMD.
Line: 19
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.subscriptions.*;
public final class FlowableTakeLastOne<T> extends AbstractFlowableWithUpstream<T, T> {
public FlowableTakeLastOne(Flowable<T> source) {
super(source);
Reported by PMD.