Enable and demonstrate Java 9 language features in libcore.
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: 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
Change-Id: I94f9248befbc8a99d1b3a36da43d7c283bc0c36b
6 files changed