AnnotationTest.java revision 2942:08092deced3f
1203134Sthompsa/* 2205042Sthompsa * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. 3205042Sthompsa * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4205042Sthompsa * 5260219Skevlo * This code is free software; you can redistribute it and/or modify it 6203134Sthompsa * under the terms of the GNU General Public License version 2 only, as 7203134Sthompsa * published by the Free Software Foundation. 8203134Sthompsa * 9203134Sthompsa * This code is distributed in the hope that it will be useful, but WITHOUT 10203134Sthompsa * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11203134Sthompsa * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12203134Sthompsa * version 2 for more details (a copy is included in the LICENSE file that 13203134Sthompsa * accompanied this code). 14203134Sthompsa * 15203134Sthompsa * You should have received a copy of the GNU General Public License version 16203134Sthompsa * 2 along with this work; if not, write to the Free Software Foundation, 17203134Sthompsa * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18203134Sthompsa * 19203134Sthompsa * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20203134Sthompsa * or visit www.oracle.com if you need additional information or have any 21203134Sthompsa * questions. 22203134Sthompsa */ 23203134Sthompsa 24257955Skevlo/* 25203134Sthompsa * @test 26203134Sthompsa * @bug 8006582 27203134Sthompsa * @summary javac should generate method parameters correctly. 28203134Sthompsa * @modules jdk.jdeps/com.sun.tools.classfile 29203134Sthompsa * @build Tester 30203134Sthompsa * @compile -parameters AnnotationTest.java 31203134Sthompsa * @run main Tester AnnotationTest AnnotationTest.out 32203134Sthompsa */ 33203134Sthompsa 34203134Sthompsaimport java.lang.annotation.*; 35203134Sthompsa 36203134Sthompsa/** Test that annotations do not interfere with recording of parameter names */ 37203134Sthompsaclass AnnotationTest { 38203134Sthompsa 39203134Sthompsa @Repeatable(Annos.class) 40203134Sthompsa @interface Anno { 41203134Sthompsa Class f() default int.class; 42203134Sthompsa } 43203134Sthompsa 44203134Sthompsa @interface Annos { Anno[] value(); String foo() default "hello"; } 45203134Sthompsa 46203134Sthompsa interface I { 47203134Sthompsa int m(@Anno @Anno int i, @Anno int ji); 48203134Sthompsa } 49203134Sthompsa 50203134Sthompsa public AnnotationTest(@Anno @Anno I i, @Anno int ji) { } 51257176Sglebius public @Anno String foo(@Anno @Anno I i, int ji) { return null; } 52203134Sthompsa} 53203134Sthompsa 54203134Sthompsa 55203134Sthompsa 56203134Sthompsa