test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnonymousExtendsTest.java
changeset 55387 761b86d5563d
parent 47216 71c04702a3d5
equal deleted inserted replaced
55386:2f4e214781a1 55387:761b86d5563d
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    50     public class TestClass extends @TA(1) ArrayList<@TA(2) List<Number>> {
    50     public class TestClass extends @TA(1) ArrayList<@TA(2) List<Number>> {
    51     }
    51     }
    52 
    52 
    53     public void testIt() {
    53     public void testIt() {
    54         checkAnnotations(TestClass.class.getAnnotatedSuperclass(),
    54         checkAnnotations(TestClass.class.getAnnotatedSuperclass(),
    55               "[@AnonymousExtendsTest$TA(value=1)],[@AnonymousExtendsTest$TA(value=2)]");
    55               "[@AnonymousExtendsTest$TA(1)],[@AnonymousExtendsTest$TA(2)]");
    56         checkAnnotations(new @TA(3) ArrayList<@TA(4) List<Number>>() {
    56         checkAnnotations(new @TA(3) ArrayList<@TA(4) List<Number>>() {
    57                          }.getClass().getAnnotatedSuperclass(),
    57                          }.getClass().getAnnotatedSuperclass(),
    58               "[@AnonymousExtendsTest$TA(value=3)],[@AnonymousExtendsTest$TA(value=4)]");
    58               "[@AnonymousExtendsTest$TA(3)],[@AnonymousExtendsTest$TA(4)]");
    59     }
    59     }
    60 
    60 
    61     public void checkAnnotations(AnnotatedType type, String expected) {
    61     public void checkAnnotations(AnnotatedType type, String expected) {
    62         String actual = Arrays.asList(((AnnotatedParameterizedType) type)
    62         String actual = Arrays.asList(((AnnotatedParameterizedType) type)
    63                                       .getAnnotations())
    63                                       .getAnnotations())