The following issues were found
src/main/java/io/reactivex/rxjava3/internal/schedulers/RxThreadFactory.java
3 issues
Line: 29
private static final long serialVersionUID = -7789753024099756196L;
final String prefix;
final int priority;
final boolean nonBlocking;
Reported by PMD.
Line: 31
final String prefix;
final int priority;
final boolean nonBlocking;
// static volatile boolean CREATE_TRACE;
Reported by PMD.
Line: 33
final int priority;
final boolean nonBlocking;
// static volatile boolean CREATE_TRACE;
public RxThreadFactory(String prefix) {
this(prefix, Thread.NORM_PRIORITY, false);
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/schedulers/ScheduledDirectPeriodicTask.java
3 issues
Line: 36
runner = Thread.currentThread();
try {
runnable.run();
runner = null;
} catch (Throwable ex) {
// Exceptions.throwIfFatal(ex); nowhere to go
dispose();
runner = null;
RxJavaPlugins.onError(ex);
Reported by PMD.
Line: 37
try {
runnable.run();
runner = null;
} catch (Throwable ex) {
// Exceptions.throwIfFatal(ex); nowhere to go
dispose();
runner = null;
RxJavaPlugins.onError(ex);
throw ex;
Reported by PMD.
Line: 40
} catch (Throwable ex) {
// Exceptions.throwIfFatal(ex); nowhere to go
dispose();
runner = null;
RxJavaPlugins.onError(ex);
throw ex;
}
}
}
Reported by PMD.
src/jmh/java/io/reactivex/rxjava3/core/ObservableFlatMapPerf.java
3 issues
Line: 32
@State(Scope.Thread)
public class ObservableFlatMapPerf {
@Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
public int count;
Observable<Integer> source;
@Setup
public void setup() {
Reported by PMD.
Line: 34
@Param({ "1", "10", "100", "1000", "10000", "100000", "1000000" })
public int count;
Observable<Integer> source;
@Setup
public void setup() {
int d = 1000000 / count;
Reported by PMD.
Line: 19
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import io.reactivex.rxjava3.functions.Function;
@BenchmarkMode(Mode.Throughput)
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableOnBackpressureReduce.java
3 issues
Line: 26
public final class FlowableOnBackpressureReduce<T> extends AbstractFlowableWithUpstream<T, T> {
final BiFunction<T, T, T> reducer;
public FlowableOnBackpressureReduce(@NonNull Flowable<T> source, @NonNull BiFunction<T, T, T> reducer) {
super(source);
this.reducer = reducer;
}
Reported by PMD.
Line: 42
private static final long serialVersionUID = 821363947659780367L;
final BiFunction<T, T, T> reducer;
BackpressureReduceSubscriber(@NonNull Subscriber<? super T> downstream, @NonNull BiFunction<T, T, T> reducer) {
super(downstream);
this.reducer = reducer;
}
Reported by PMD.
Line: 60
} else {
try {
current.lazySet(Objects.requireNonNull(reducer.apply(v, t), "The reducer returned a null value"));
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
upstream.cancel();
onError(ex);
return;
}
Reported by PMD.
src/jmh/java/io/reactivex/rxjava3/core/LatchedSingleObserver.java
3 issues
Line: 23
import io.reactivex.rxjava3.disposables.Disposable;
public final class LatchedSingleObserver<T> implements SingleObserver<T> {
final CountDownLatch cdl;
final Blackhole bh;
public LatchedSingleObserver(Blackhole bh) {
this.bh = bh;
this.cdl = new CountDownLatch(1);
}
Reported by PMD.
Line: 24
public final class LatchedSingleObserver<T> implements SingleObserver<T> {
final CountDownLatch cdl;
final Blackhole bh;
public LatchedSingleObserver(Blackhole bh) {
this.bh = bh;
this.cdl = new CountDownLatch(1);
}
Reported by PMD.
Line: 43
@Override
public void onError(Throwable e) {
e.printStackTrace();
cdl.countDown();
}
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMapPublisher.java
3 issues
Line: 31
*/
public final class FlowableMapPublisher<T, U> extends Flowable<U> {
final Publisher<T> source;
final Function<? super T, ? extends U> mapper;
public FlowableMapPublisher(Publisher<T> source, Function<? super T, ? extends U> mapper) {
this.source = source;
this.mapper = mapper;
Reported by PMD.
Line: 33
final Publisher<T> source;
final Function<? super T, ? extends U> mapper;
public FlowableMapPublisher(Publisher<T> source, Function<? super T, ? extends U> mapper) {
this.source = source;
this.mapper = mapper;
}
Reported by PMD.
Line: 16
package io.reactivex.rxjava3.internal.operators.flowable;
import org.reactivestreams.*;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.operators.flowable.FlowableMap.MapSubscriber;
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/subscriptions/ArrayCompositeSubscription.java
3 issues
Line: 54
}
if (compareAndSet(index, o, resource)) {
if (o != null) {
o.cancel();
}
return true;
}
}
}
Reported by PMD.
Line: 90
Subscription o = get(i);
if (o != SubscriptionHelper.CANCELLED) {
o = getAndSet(i, SubscriptionHelper.CANCELLED);
if (o != SubscriptionHelper.CANCELLED && o != null) {
o.cancel();
}
}
}
}
Reported by PMD.
Line: 91
if (o != SubscriptionHelper.CANCELLED) {
o = getAndSet(i, SubscriptionHelper.CANCELLED);
if (o != SubscriptionHelper.CANCELLED && o != null) {
o.cancel();
}
}
}
}
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFromCallable.java
3 issues
Line: 28
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
public final class FlowableFromCallable<T> extends Flowable<T> implements Supplier<T> {
final Callable<? extends T> callable;
public FlowableFromCallable(Callable<? extends T> callable) {
this.callable = callable;
}
@Override
Reported by PMD.
Line: 41
T t;
try {
t = Objects.requireNonNull(callable.call(), "The callable returned a null value");
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
if (deferred.isCancelled()) {
RxJavaPlugins.onError(ex);
} else {
s.onError(ex);
Reported by PMD.
Line: 40
T t;
try {
t = Objects.requireNonNull(callable.call(), "The callable returned a null value");
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
if (deferred.isCancelled()) {
RxJavaPlugins.onError(ex);
} else {
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/util/VolatileSizeArrayList.java
3 issues
Line: 27
* @param <T> the element type
* @since 2.0.7
*/
public final class VolatileSizeArrayList<T> extends AtomicInteger implements List<T>, RandomAccess {
private static final long serialVersionUID = 3972397474470203923L;
final ArrayList<T> list;
Reported by PMD.
Line: 31
private static final long serialVersionUID = 3972397474470203923L;
final ArrayList<T> list;
public VolatileSizeArrayList() {
list = new ArrayList<>();
}
Reported by PMD.
Line: 31
private static final long serialVersionUID = 3972397474470203923L;
final ArrayList<T> list;
public VolatileSizeArrayList() {
list = new ArrayList<>();
}
Reported by PMD.
src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFromAction.java
3 issues
Line: 32
*/
public final class FlowableFromAction<T> extends Flowable<T> implements Supplier<T> {
final Action action;
public FlowableFromAction(Action action) {
this.action = action;
}
Reported by PMD.
Line: 47
try {
action.run();
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
if (!qs.isDisposed()) {
subscriber.onError(ex);
} else {
RxJavaPlugins.onError(ex);
Reported by PMD.
Line: 20
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.*;
import io.reactivex.rxjava3.internal.fuseable.CancellableQueueFuseable;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
/**
* Executes an {@link Action} and signals its exception or completes normally.
Reported by PMD.