Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.56 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.56 KB

Java 10 Compatibility Shim

This internal module provides ForJava10AndLater, the implementation of the java8-shim adapter that uses newer JDK collection factories and copy operations. Its setCopyOf method uses an unmodifiable LinkedHashSet to preserve encounter order.

It is compiled with maven.compiler.release set to 10 and may use Java 9 and Java 10 APIs, but no newer APIs.

The core library loads this implementation when the running JDK supports it and otherwise uses the Java 8 fallback. Both shim modules are shaded into the published sanitizer JAR; this module is not independently published and is not a supported consumer API.

The sanitizer JAR is a Java 8 JAR, and Java 8 builds commonly reject any dependency with a class compiled for a later release outside META-INF/versions/. So the build compiles ForJava10AndLater twice: into META-INF/versions/10/, the only copy shaded into the multi-release sanitizer JAR, where Java 10 and later find it and Java 8 and 9 never look; and into the root of this module's classes, the copy the reactor's tests load. Nothing else in this module is shaded. See issue #515.

Build

The build requires JDK 11 or newer. Run from the repository root to build this module and its dependencies:

./mvnw -pl java10-shim -am package

Changes to the shim should also be checked in the final shaded artifact with the full ./mvnw clean verify build.