Enable and demonstrate Java 9 language features in libcore.
This CL is attempt 2; attempt 1 broke robolectric tests.
This CL demonstrates that Java 9 language features are supported
in libcore, and serves as a regression test. Because the Java 9
language sources added are part of libart sources, targets that
include full libart sources (as opposed to libart stubs or
oj sources) now require java_version: "1.9" in order to build.
Supported Java 9 language features are:
- private interface methods
- try-with-resources on effectively final variables
- diamond operator on anonymous classes
- @SafeVarargs annotation on private method
Not supported:
- JSR 376 modules.
Bug: 112443425
Test: cts-tradefed run cts -m CtsLibcoreTestCases
Test: USE_GOMA=true OUT_DIR=out make core.platform.api.stubs
Test: USE_GOMA=true EXPERIMENTAL_USE_OPENJDK9=true OUT_DIR=out-jdk9 \
make -j25 core.platform.api.stubs
Test: Patched this CL on top of the internal master branch and checked:
1.) make checkbuild docs cts droid
2.) cts-tradefed run cts -m CtsLibcoreTestCases \
-t libcore.libcore.internal.Java9LanguageFeaturesTest
3.) make RunSettingsGoogleRoboTests \
RunCarSetupWizardRoboTests RunCarSetupWizardRoboTests-jacoco \
RunCarSetupWizardLibRoboTests RunCarSetupWizardLibRoboTests-jacoco \
RunCarSettingsRoboTests RunCarSettingsRoboTests-jacoco \
RunCarMessengerRoboTests RunCarMessengerRoboTests-jacoco
Change-Id: I145b4d997a27650aa61a73d6ce5b2eb297274949
Merged-In: I145b4d997a27650aa61a73d6ce5b2eb297274949
6 files changed