Skip to content

Commit d75a1f1

Browse files
committed
Upcast ConcurrentHashMap to Map to avoid compatibility issue
Resovles ReactiveX#4653 See http://stackoverflow.com/a/32955708/61158
1 parent 5ad1c04 commit d75a1f1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/io/reactivex/internal/schedulers/SchedulerPoolFactory.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616

1717
package io.reactivex.internal.schedulers;
1818

19-
import java.util.*;
20-
import java.util.concurrent.*;
21-
import java.util.concurrent.atomic.AtomicReference;
22-
2319
import io.reactivex.internal.util.SuppressAnimalSniffer;
2420
import io.reactivex.plugins.RxJavaPlugins;
2521

22+
import java.util.ArrayList;
23+
import java.util.Map;
24+
import java.util.Properties;
25+
import java.util.concurrent.*;
26+
import java.util.concurrent.atomic.AtomicReference;
27+
2628
/**
2729
* Manages the creating of ScheduledExecutorServices and sets up purging.
2830
*/
@@ -46,7 +48,9 @@ public enum SchedulerPoolFactory {
4648
static final AtomicReference<ScheduledExecutorService> PURGE_THREAD =
4749
new AtomicReference<ScheduledExecutorService>();
4850

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

5256
/**

0 commit comments

Comments
 (0)