aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikaël Peltier <mikaelpeltier@google.com>2017-10-18 17:19:57 +0200
committerMikaël Peltier <mikaelpeltier@google.com>2017-10-18 17:19:57 +0200
commit6d86ed631e55337e3d248aaa4d0b03cdb138bdc3 (patch)
treefe79d805310754a8b6269ef815f4049860fb3066
parent80e57e9645a94900263ab8a53a482aa46ba03d08 (diff)
downloadr8-6d86ed631e55337e3d248aaa4d0b03cdb138bdc3.tar.gz
Adapt parameter annotation test
- Java 8 and Java 9 runtime does not have the same behavior regarding implicit parameter thus adapt the test to produce the expected output until the right behavior for Android is defined. Change-Id: I22590dfb251b63924da8dd8aade159cee9b20e8c Bug: 67936230
-rw-r--r--src/test/examples/regress_62300145/Regress.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/test/examples/regress_62300145/Regress.java b/src/test/examples/regress_62300145/Regress.java
index f151e83ce..0efc7a66c 100644
--- a/src/test/examples/regress_62300145/Regress.java
+++ b/src/test/examples/regress_62300145/Regress.java
@@ -29,10 +29,17 @@ public class Regress {
public static void main(String[] args) throws NoSuchMethodException {
Constructor<InnerClass> constructor = InnerClass.class.getDeclaredConstructor(
Regress.class, String.class, String.class, String.class);
- int i = 0;
- for (Annotation[] annotations : constructor.getParameterAnnotations()) {
- System.out.print(i++ + ": ");
- for (Annotation annotation : annotations) {
+ Annotation[][] annotations = constructor.getParameterAnnotations();
+ int index = 0;
+ for (int i = 0; i < annotations.length; i++) {
+ // TODO(b/67936230): Java 8 and Java 9 runtime does not have the same behavior regarding
+ // implicit parameter such as 'outer this' for instance. Disable this test on Java 9 runtime
+ // due to this divergence.
+ if (System.getProperty("java.specification.version").equals("9") && i == 0) {
+ continue;
+ }
+ System.out.print(index++ + ": ");
+ for (Annotation annotation : annotations[i]) {
System.out.println(annotation);
}
}