Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;

import io.reactivex.internal.util.SuppressAnimalSniffer;
import io.reactivex.plugins.RxJavaPlugins;

/**
Expand All @@ -46,7 +45,9 @@ public enum SchedulerPoolFactory {
static final AtomicReference<ScheduledExecutorService> PURGE_THREAD =
new AtomicReference<ScheduledExecutorService>();

static final ConcurrentHashMap<ScheduledThreadPoolExecutor, Object> POOLS =
// Upcast to the Map interface here to avoid 8.x compatibility issues.
// See http://stackoverflow.com/a/32955708/61158
static final Map<ScheduledThreadPoolExecutor, Object> POOLS =
new ConcurrentHashMap<ScheduledThreadPoolExecutor, Object>();

/**
Expand All @@ -63,10 +64,9 @@ public static void start() {

next.scheduleAtFixedRate(new Runnable() {
@Override
@SuppressAnimalSniffer
public void run() {
try {
for (ScheduledThreadPoolExecutor e : new ArrayList<ScheduledThreadPoolExecutor>(POOLS.keySet())) { // CHM.keySet returns KeySetView in Java 8+; false positive here
for (ScheduledThreadPoolExecutor e : new ArrayList<ScheduledThreadPoolExecutor>(POOLS.keySet())) {
if (e.isShutdown()) {
POOLS.remove(e);
} else {
Expand Down