jgit/org.eclipse.jgit.junit.http
Thomas Wolf 0f442d7083 Use Map interface instead of ConcurrentHashMap class
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] 0e8b937ded/ojluni/src/main/java/java/util/concurrent/ConcurrentHashMap.java (1244)
[2] https://github.com/eclipse/jgit/pull/104
[3] https://github.com/eclipse/jgit/pull/100

Change-Id: I7c07e0cc59871cb7fe60795e22867827fa9c2458
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-01-01 12:49:05 -05:00
..
.settings Enable and fix "Statement unnecessarily nested within else clause" warnings 2019-10-17 10:20:14 +09:00
META-INF Prepare 5.11.0-SNAPSHOT builds 2020-12-02 15:57:16 +01:00
src/org/eclipse/jgit/junit/http Use Map interface instead of ConcurrentHashMap class 2021-01-01 12:49:05 -05:00
.classpath Configure classpath for separate test sources in Eclipse 2018-10-17 11:08:24 +09:00
.gitignore Introduce http test bundle 2010-12-08 16:20:28 +01:00
.project Enforce the use of Java5 API:s only (with a few exceptions) 2011-12-16 01:01:36 +01:00
BUILD Bazel: Add fixes for --incompatible_load_java_rules_from_bzl 2019-09-07 15:36:11 +09:00
build.properties Fix line endings 2013-05-03 16:19:07 +02:00
plugin.properties Fix bundle localization of Apache SSH bundle 2019-06-21 17:54:06 +02:00
pom.xml Prepare 5.11.0-SNAPSHOT builds 2020-12-02 15:57:16 +01:00