< prev index next >

test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnonymousExtendsTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 50,63 **** public class TestClass extends @TA(1) ArrayList<@TA(2) List<Number>> { } public void testIt() { checkAnnotations(TestClass.class.getAnnotatedSuperclass(), ! "[@AnonymousExtendsTest$TA(value=1)],[@AnonymousExtendsTest$TA(value=2)]"); checkAnnotations(new @TA(3) ArrayList<@TA(4) List<Number>>() { }.getClass().getAnnotatedSuperclass(), ! "[@AnonymousExtendsTest$TA(value=3)],[@AnonymousExtendsTest$TA(value=4)]"); } public void checkAnnotations(AnnotatedType type, String expected) { String actual = Arrays.asList(((AnnotatedParameterizedType) type) .getAnnotations()) --- 50,63 ---- public class TestClass extends @TA(1) ArrayList<@TA(2) List<Number>> { } public void testIt() { checkAnnotations(TestClass.class.getAnnotatedSuperclass(), ! "[@AnonymousExtendsTest$TA(1)],[@AnonymousExtendsTest$TA(2)]"); checkAnnotations(new @TA(3) ArrayList<@TA(4) List<Number>>() { }.getClass().getAnnotatedSuperclass(), ! "[@AnonymousExtendsTest$TA(3)],[@AnonymousExtendsTest$TA(4)]"); } public void checkAnnotations(AnnotatedType type, String expected) { String actual = Arrays.asList(((AnnotatedParameterizedType) type) .getAnnotations())
< prev index next >