-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
1.x: Workaround for CHM.keySet bad type with Java 8 compiler #5602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 !
static void purgeExecutors() { | ||
try { | ||
Iterator<ScheduledThreadPoolExecutor> it = EXECUTORS.keySet().iterator(); | ||
Map<ScheduledThreadPoolExecutor, ScheduledThreadPoolExecutor> map = EXECUTORS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment I guess
Please give me some time to run test scenario that failed before as a sanity check |
7abc8c7
to
a319eb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked with test scenario from artem-zinnatullin/RxJavaProGuardRules#62 (comment)
static void purgeExecutors() { | ||
try { | ||
Iterator<ScheduledThreadPoolExecutor> it = EXECUTORS.keySet().iterator(); | ||
// This prevents map.keySet to compile to a Java 8+ KeySetView return type | ||
// and cause NoClassDefFound on Java 6-7 runtimes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NoSuchMethodError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Added comment. I assume if the PR is verified by @artem-zinnatullin, we should release 1.3.2 asap. |
a319eb2
to
64a6e03
Compare
There is quite a backlog piled up on Travis. May not clear before I go to sleep. |
Ok, you might want to check "Concurrent jobs" related options in build settings on Travis |
Codecov Report
@@ Coverage Diff @@
## 1.x #5602 +/- ##
============================================
- Coverage 84.34% 84.21% -0.14%
+ Complexity 2891 2886 -5
============================================
Files 291 291
Lines 18198 18199 +1
Branches 2480 2480
============================================
- Hits 15349 15326 -23
- Misses 1989 1999 +10
- Partials 860 874 +14
Continue to review full report at Codecov.
|
This PR fixes the problem that
ConcurrentHashMap::keySet
, when compiled on JDK 8, adds theKeySetView
type in the bytecode which is not available in JDK 7 and before. The change forces the offending place to use the the standardMap::keySet
which returns a standardSet
.