0f442d7083
On Android, the co-variant override of ConcurrentHashMap.keySet()
introduced in Java 8 was undone. [1] If compiled Java code calls that
co-variant override directly, one gets a NoSuchMethodError exception
at run-time on Android.
Making the code call that method via Map.keySet() side-steps this
problem.
This is similar to bug 496262, where the same problem cropped up when
compiling with Java 8 against a Java 7 target, but here we cannot use
bootclasspath. We build against Java 8, not against the Android version
of it.
Recent Android versions should have some bytecode "magic" that adds the
co-variant override in bytecode (see the commit referenced in [1]), but
on older Android version this problem may still occur. (Or perhaps the
"magic" is ineffective...) There are two pull requests on Github for
this problem, both from 2020, [2][3] while the Android commit [1] is
from March 2018. Apparently people still occasionally run into this
problem in the wild.
[1]
|
||
---|---|---|
.. | ||
.settings | ||
META-INF | ||
findBugs | ||
resources/org/eclipse/jgit | ||
src/org/eclipse/jgit | ||
.classpath | ||
.fbprefs | ||
.gitignore | ||
.project | ||
BUILD | ||
about.html | ||
build.properties | ||
plugin.properties | ||
pom.xml |