Fields.java revision 3233:b5d08bc0d224
1219732Sume/* 2219732Sume * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 3219732Sume * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4219732Sume * 5219732Sume * This code is free software; you can redistribute it and/or modify it 6219732Sume * under the terms of the GNU General Public License version 2 only, as 7219732Sume * published by the Free Software Foundation. 8219732Sume * 9219732Sume * This code is distributed in the hope that it will be useful, but WITHOUT 10219732Sume * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11219732Sume * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12219732Sume * version 2 for more details (a copy is included in the LICENSE file that 13219732Sume * accompanied this code). 14219732Sume * 15219732Sume * You should have received a copy of the GNU General Public License version 16219732Sume * 2 along with this work; if not, write to the Free Software Foundation, 17219732Sume * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18219732Sume * 19219732Sume * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20219732Sume * or visit www.oracle.com if you need additional information or have any 21219732Sume * questions. 22219732Sume */ 23219732Sume 24219732Sumepackage typeannos; 25219732Sume 26219732Sumeimport java.lang.annotation.*; 27219732Sume 28219732Sume/* 29219732Sume * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. 30219732Sume */ 31219732Sumeclass DefaultScope { 32219732Sume Parameterized<String, String> unannotated; 33225524Shrs Parameterized<@FldA String, String> firstTypeArg; 34225524Shrs Parameterized<String, @FldA String> secondTypeArg; 35219732Sume Parameterized<@FldA String, @FldB String> bothTypeArgs; 36219732Sume 37219732Sume Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String> 38219732Sume nestedParameterized; 39219732Sume 40219732Sume @FldA String [] array1; 41219732Sume @FldA String @FldB [] array1Deep; 42219732Sume @FldA String [] [] array2; 43219732Sume @FldD String @FldC @FldA [] @FldC @FldB [] array2Deep; 44219732Sume String @FldA [] [] array2First; 45219732Sume String [] @FldB [] array2Second; 46219732Sume 47225524Shrs // Old-style array syntax 48219732Sume String array2FirstOld @FldA []; 49219732Sume String array2SecondOld [] @FldB []; 50219732Sume} 51219732Sume 52219732Sumeclass ModifiedScoped { 53225524Shrs public final Parameterized<String, String> unannotated = null; 54225524Shrs public final Parameterized<@FldA String, String> firstTypeArg = null; 55219732Sume public final Parameterized<String, @FldA String> secondTypeArg = null; 56219732Sume public final Parameterized<@FldA String, @FldB String> bothTypeArgs = null; 57219732Sume 58225524Shrs public final Parameterized<@FldA Parameterized<@FldA String, @FldB String>, @FldB String> 59219732Sume nestedParameterized = null; 60219732Sume 61219732Sume public final @FldA String [] array1 = null; 62225524Shrs public final @FldA String @FldB [] array1Deep = null; 63225524Shrs public final @FldA String [] [] array2 = null; 64225524Shrs public final @FldA String @FldA [] @FldB [] array2Deep = null; 65219732Sume public final String @FldA [] [] array2First = null; 66219732Sume public final String [] @FldB [] array2Second = null; 67225524Shrs} 68219732Sume 69219732Sumeclass Parameterized<K, V> { } 70219732Sume 71225524Shrs@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 72219732Sume@Documented 73219732Sume@interface FldA { } 74219732Sume@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 75219732Sume@Documented 76219732Sume@interface FldB { } 77219732Sume@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 78219732Sume@Documented 79225524Shrs@interface FldC { } 80219732Sume@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 81225524Shrs@Documented 82219732Sume@interface FldD { } 83219732Sume