Thu, 31 Jan 2013 18:58:17 -0800
8007351: Malformed copyright statements in typeAnnotations test directory
Reviewed-by: jjg
jjg@1521 | 1 | /* |
darcy@1534 | 2 | * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
jjg@1521 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@1521 | 4 | * |
jjg@1521 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@1521 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jjg@1521 | 7 | * published by the Free Software Foundation. |
jjg@1521 | 8 | * |
jjg@1521 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@1521 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@1521 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@1521 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@1521 | 13 | * accompanied this code). |
jjg@1521 | 14 | * |
jjg@1521 | 15 | * You should have received a copy of the GNU General Public License version |
jjg@1521 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@1521 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@1521 | 18 | * |
jjg@1521 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jjg@1521 | 20 | * or visit www.oracle.com if you need additional information or have any |
jjg@1521 | 21 | * questions. |
jjg@1521 | 22 | */ |
jjg@1521 | 23 | |
jjg@1521 | 24 | import static com.sun.tools.classfile.TypeAnnotation.TargetType.*; |
jjg@1521 | 25 | |
jjg@1521 | 26 | /* |
jjg@1521 | 27 | * @test |
jjg@1521 | 28 | * @summary Test population of reference info for nested types |
jjg@1521 | 29 | * @compile -g Driver.java ReferenceInfoUtil.java NestedTypes.java |
jjg@1521 | 30 | * @run main Driver NestedTypes |
jjg@1521 | 31 | */ |
jjg@1521 | 32 | public class NestedTypes { |
jjg@1521 | 33 | |
jjg@1521 | 34 | // method parameters |
jjg@1521 | 35 | |
jjg@1521 | 36 | @TADescriptions({ |
jjg@1521 | 37 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 38 | genericLocation = {}, paramIndex = 0), |
jjg@1521 | 39 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 40 | genericLocation = {1, 0}, paramIndex = 0) |
jjg@1521 | 41 | }) |
jjg@1521 | 42 | public String testParam1() { |
jjg@1521 | 43 | return "void test(@TA Outer.@TB Inner a) { }"; |
jjg@1521 | 44 | } |
jjg@1521 | 45 | |
jjg@1521 | 46 | @TADescriptions({ |
jjg@1521 | 47 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 48 | genericLocation = {3, 0}, paramIndex = 0), |
jjg@1521 | 49 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 50 | genericLocation = {3, 0, 1, 0}, paramIndex = 0) |
jjg@1521 | 51 | }) |
jjg@1521 | 52 | public String testParam1b() { |
jjg@1521 | 53 | return "void test(List<@TA Outer.@TB Inner> a) { }"; |
jjg@1521 | 54 | } |
jjg@1521 | 55 | |
jjg@1521 | 56 | // TODO: the tests that use @TA Map.Entry should fail, as |
jjg@1521 | 57 | // Map cannot be annotated. |
jjg@1521 | 58 | // We need some tests for the fully qualified name syntax. |
jjg@1521 | 59 | /* |
jjg@1521 | 60 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 61 | genericLocation = {}, paramIndex = 0) |
jjg@1521 | 62 | public String testParam1c() { |
jjg@1521 | 63 | return "void test(java.util.@TA Map.Entry a) { }"; |
jjg@1521 | 64 | } |
jjg@1521 | 65 | |
jjg@1521 | 66 | @TADescriptions({ |
jjg@1521 | 67 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 68 | genericLocation = {}, paramIndex = 0), |
jjg@1521 | 69 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 70 | genericLocation = {1, 0}, paramIndex = 0) |
jjg@1521 | 71 | }) |
jjg@1521 | 72 | public String testParam1d() { |
jjg@1521 | 73 | return "void test(java.util.@TA Map.@TB Entry a) { }"; |
jjg@1521 | 74 | } |
jjg@1521 | 75 | |
jjg@1521 | 76 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 77 | genericLocation = {3, 0}, paramIndex = 0) |
jjg@1521 | 78 | public String testParam1e() { |
jjg@1521 | 79 | return "void test(List<java.util.@TA Map.Entry> a) { }"; |
jjg@1521 | 80 | } |
jjg@1521 | 81 | |
jjg@1521 | 82 | @TADescriptions({ |
jjg@1521 | 83 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 84 | genericLocation = {3, 0}, paramIndex = 0), |
jjg@1521 | 85 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 86 | genericLocation = {3, 0, 1, 0}, paramIndex = 0) |
jjg@1521 | 87 | }) |
jjg@1521 | 88 | public String testParam1f() { |
jjg@1521 | 89 | return "void test(List<java.util.@TA Map. @TB Entry> a) { }"; |
jjg@1521 | 90 | } |
jjg@1521 | 91 | */ |
jjg@1521 | 92 | |
jjg@1521 | 93 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 94 | genericLocation = {3, 0}, paramIndex = 0) |
jjg@1521 | 95 | public String testParam1g() { |
jjg@1521 | 96 | return "void test(List<java.util.Map. @TB Entry> a) { }"; |
jjg@1521 | 97 | } |
jjg@1521 | 98 | |
jjg@1521 | 99 | @TADescriptions({ |
jjg@1521 | 100 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 101 | genericLocation = {}, paramIndex = 0), |
jjg@1521 | 102 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 103 | genericLocation = {1, 0}, paramIndex = 0) |
jjg@1521 | 104 | }) |
jjg@1521 | 105 | public String testParam2() { |
jjg@1521 | 106 | return "void test(@TA GOuter<String,String>.@TB GInner<String,String> a) { }"; |
jjg@1521 | 107 | } |
jjg@1521 | 108 | |
jjg@1521 | 109 | @TADescriptions({ |
jjg@1521 | 110 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 111 | genericLocation = {3, 0}, paramIndex = 0), |
jjg@1521 | 112 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 113 | genericLocation = {3, 0, 1, 0}, paramIndex = 0) |
jjg@1521 | 114 | }) |
jjg@1521 | 115 | public String testParam2b() { |
jjg@1521 | 116 | return "void test(List<@TA GOuter<String,String>.@TB GInner<String,String>> a) { }"; |
jjg@1521 | 117 | } |
jjg@1521 | 118 | |
jjg@1521 | 119 | @TADescriptions({ |
jjg@1521 | 120 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 121 | genericLocation = {0, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 122 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 123 | genericLocation = {0, 0, 0, 0, 1, 0}, paramIndex = 0), |
jjg@1521 | 124 | @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 125 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 126 | @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 127 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 128 | @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 129 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 130 | @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 131 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 132 | @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 133 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0), |
jjg@1521 | 134 | @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 135 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 136 | @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 137 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0), |
jjg@1521 | 138 | @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, paramIndex = 0), |
jjg@1521 | 139 | @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 140 | genericLocation = {0, 0}, paramIndex = 0) |
jjg@1521 | 141 | }) |
jjg@1521 | 142 | public String testParam3() { |
jjg@1521 | 143 | return "class Outer {\n" + |
jjg@1521 | 144 | " class GInner<X> {\n" + |
jjg@1521 | 145 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 146 | "}}\n\n" + |
jjg@1521 | 147 | "class Test {\n" + |
jjg@1521 | 148 | " void test(@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a) { }\n" + |
jjg@1521 | 149 | "}"; |
jjg@1521 | 150 | } |
jjg@1521 | 151 | |
jjg@1521 | 152 | @TADescriptions({ |
jjg@1521 | 153 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 154 | genericLocation = {3, 0, 0, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 155 | @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 156 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, paramIndex = 0), |
jjg@1521 | 157 | @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 158 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 159 | @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 160 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 161 | @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 162 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 163 | @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 164 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0), |
jjg@1521 | 165 | @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 166 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0), |
jjg@1521 | 167 | @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 168 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0), |
jjg@1521 | 169 | @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 170 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0), |
jjg@1521 | 171 | @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 172 | genericLocation = {3, 0}, paramIndex = 0), |
jjg@1521 | 173 | @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER, |
jjg@1521 | 174 | genericLocation = {3, 0, 0, 0}, paramIndex = 0) |
jjg@1521 | 175 | }) |
jjg@1521 | 176 | public String testParam4() { |
jjg@1521 | 177 | return "class Outer {\n" + |
jjg@1521 | 178 | " class GInner<X> {\n" + |
jjg@1521 | 179 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 180 | "}}\n\n" + |
jjg@1521 | 181 | "class Test {\n" + |
jjg@1521 | 182 | " void test(List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a) { }\n" + |
jjg@1521 | 183 | "}"; |
jjg@1521 | 184 | } |
jjg@1521 | 185 | |
jjg@1521 | 186 | |
jjg@1521 | 187 | // Local variables |
jjg@1521 | 188 | |
jjg@1521 | 189 | @TADescriptions({ |
jjg@1521 | 190 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 191 | genericLocation = {}, |
jjg@1521 | 192 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 193 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 194 | genericLocation = {1, 0}, |
jjg@1521 | 195 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 196 | }) |
jjg@1521 | 197 | public String testLocal1a() { |
jjg@1521 | 198 | return "void test() { @TA Outer.@TB Inner a = null; }"; |
jjg@1521 | 199 | } |
jjg@1521 | 200 | |
jjg@1521 | 201 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 202 | genericLocation = {}, |
jjg@1521 | 203 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 204 | public String testLocal1b() { |
jjg@1521 | 205 | return "void test() { @TA Outer.Inner a = null; }"; |
jjg@1521 | 206 | } |
jjg@1521 | 207 | |
jjg@1521 | 208 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 209 | genericLocation = {1, 0}, |
jjg@1521 | 210 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 211 | public String testLocal1c() { |
jjg@1521 | 212 | return "void test() { Outer.@TB Inner a = null; }"; |
jjg@1521 | 213 | } |
jjg@1521 | 214 | |
jjg@1521 | 215 | @TADescriptions({ |
jjg@1521 | 216 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 217 | genericLocation = {}, |
jjg@1521 | 218 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 219 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 220 | genericLocation = {1, 0}, |
jjg@1521 | 221 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 222 | }) |
jjg@1521 | 223 | public String testLocal2() { |
jjg@1521 | 224 | return "void test() { @TA GOuter<String,String>.@TB GInner<String,String> a = null; }"; |
jjg@1521 | 225 | } |
jjg@1521 | 226 | |
jjg@1521 | 227 | @TADescriptions({ |
jjg@1521 | 228 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 229 | genericLocation = {0, 0, 0, 0}, |
jjg@1521 | 230 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 231 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 232 | genericLocation = {0, 0, 0, 0, 1, 0}, |
jjg@1521 | 233 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 234 | @TADescription(annotation = "TC", type = LOCAL_VARIABLE, |
jjg@1521 | 235 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, |
jjg@1521 | 236 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 237 | @TADescription(annotation = "TD", type = LOCAL_VARIABLE, |
jjg@1521 | 238 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, |
jjg@1521 | 239 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 240 | @TADescription(annotation = "TE", type = LOCAL_VARIABLE, |
jjg@1521 | 241 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, |
jjg@1521 | 242 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 243 | @TADescription(annotation = "TF", type = LOCAL_VARIABLE, |
jjg@1521 | 244 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, |
jjg@1521 | 245 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 246 | @TADescription(annotation = "TG", type = LOCAL_VARIABLE, |
jjg@1521 | 247 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, |
jjg@1521 | 248 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 249 | @TADescription(annotation = "TH", type = LOCAL_VARIABLE, |
jjg@1521 | 250 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, |
jjg@1521 | 251 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 252 | @TADescription(annotation = "TI", type = LOCAL_VARIABLE, |
jjg@1521 | 253 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, |
jjg@1521 | 254 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 255 | @TADescription(annotation = "TJ", type = LOCAL_VARIABLE, |
jjg@1521 | 256 | genericLocation = {}, |
jjg@1521 | 257 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 258 | @TADescription(annotation = "TK", type = LOCAL_VARIABLE, |
jjg@1521 | 259 | genericLocation = {0, 0}, |
jjg@1521 | 260 | lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 261 | }) |
jjg@1521 | 262 | public String testLocal3() { |
jjg@1521 | 263 | return "class Outer {\n" + |
jjg@1521 | 264 | " class GInner<X> {\n" + |
jjg@1521 | 265 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 266 | "}}\n\n" + |
jjg@1521 | 267 | "class Test {\n" + |
jjg@1521 | 268 | " void test() { @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a = null; }\n" + |
jjg@1521 | 269 | "}"; |
jjg@1521 | 270 | } |
jjg@1521 | 271 | |
jjg@1521 | 272 | @TADescriptions({ |
jjg@1521 | 273 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 274 | genericLocation = {3, 0, 0, 0, 0, 0}, |
jjg@1521 | 275 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 276 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 277 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, |
jjg@1521 | 278 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 279 | @TADescription(annotation = "TC", type = LOCAL_VARIABLE, |
jjg@1521 | 280 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, |
jjg@1521 | 281 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 282 | @TADescription(annotation = "TD", type = LOCAL_VARIABLE, |
jjg@1521 | 283 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, |
jjg@1521 | 284 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 285 | @TADescription(annotation = "TE", type = LOCAL_VARIABLE, |
jjg@1521 | 286 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, |
jjg@1521 | 287 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 288 | @TADescription(annotation = "TF", type = LOCAL_VARIABLE, |
jjg@1521 | 289 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, |
jjg@1521 | 290 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 291 | @TADescription(annotation = "TG", type = LOCAL_VARIABLE, |
jjg@1521 | 292 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, |
jjg@1521 | 293 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 294 | @TADescription(annotation = "TH", type = LOCAL_VARIABLE, |
jjg@1521 | 295 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, |
jjg@1521 | 296 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 297 | @TADescription(annotation = "TI", type = LOCAL_VARIABLE, |
jjg@1521 | 298 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, |
jjg@1521 | 299 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 300 | @TADescription(annotation = "TJ", type = LOCAL_VARIABLE, |
jjg@1521 | 301 | genericLocation = {3, 0}, |
jjg@1521 | 302 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), |
jjg@1521 | 303 | @TADescription(annotation = "TK", type = LOCAL_VARIABLE, |
jjg@1521 | 304 | genericLocation = {3, 0, 0, 0}, |
jjg@1521 | 305 | lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) |
jjg@1521 | 306 | }) |
jjg@1521 | 307 | public String testLocal4() { |
jjg@1521 | 308 | return "class Outer {\n" + |
jjg@1521 | 309 | " class GInner<X> {\n" + |
jjg@1521 | 310 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 311 | "}}\n\n" + |
jjg@1521 | 312 | "class Test {\n" + |
jjg@1521 | 313 | " void test() { List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a = null; }\n" + |
jjg@1521 | 314 | "}"; |
jjg@1521 | 315 | } |
jjg@1521 | 316 | |
jjg@1521 | 317 | |
jjg@1521 | 318 | // fields |
jjg@1521 | 319 | |
jjg@1521 | 320 | @TADescriptions({ |
jjg@1521 | 321 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 322 | genericLocation = {}), |
jjg@1521 | 323 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 324 | genericLocation = {1, 0}) |
jjg@1521 | 325 | }) |
jjg@1521 | 326 | public String testField1a() { |
jjg@1521 | 327 | return "@TA Outer.@TB Inner a;"; |
jjg@1521 | 328 | } |
jjg@1521 | 329 | |
jjg@1521 | 330 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 331 | genericLocation = {}) |
jjg@1521 | 332 | public String testField1b() { |
jjg@1521 | 333 | return "@TA Outer.Inner a;"; |
jjg@1521 | 334 | } |
jjg@1521 | 335 | |
jjg@1521 | 336 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 337 | genericLocation = {1, 0}) |
jjg@1521 | 338 | public String testField1c() { |
jjg@1521 | 339 | return "Outer.@TB Inner a;"; |
jjg@1521 | 340 | } |
jjg@1521 | 341 | |
jjg@1521 | 342 | @TADescriptions({ |
jjg@1521 | 343 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 344 | genericLocation = {}), |
jjg@1521 | 345 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 346 | genericLocation = {1, 0}) |
jjg@1521 | 347 | }) |
jjg@1521 | 348 | public String testField2() { |
jjg@1521 | 349 | return "@TA GOuter<String,String>.@TB GInner<String,String> a;"; |
jjg@1521 | 350 | } |
jjg@1521 | 351 | |
jjg@1521 | 352 | @TADescriptions({ |
jjg@1521 | 353 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 354 | genericLocation = {0, 0, 0, 0}), |
jjg@1521 | 355 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 356 | genericLocation = {0, 0, 0, 0, 1, 0}), |
jjg@1521 | 357 | @TADescription(annotation = "TC", type = FIELD, |
jjg@1521 | 358 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}), |
jjg@1521 | 359 | @TADescription(annotation = "TD", type = FIELD, |
jjg@1521 | 360 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), |
jjg@1521 | 361 | @TADescription(annotation = "TE", type = FIELD, |
jjg@1521 | 362 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), |
jjg@1521 | 363 | @TADescription(annotation = "TF", type = FIELD, |
jjg@1521 | 364 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), |
jjg@1521 | 365 | @TADescription(annotation = "TG", type = FIELD, |
jjg@1521 | 366 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}), |
jjg@1521 | 367 | @TADescription(annotation = "TH", type = FIELD, |
jjg@1521 | 368 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), |
jjg@1521 | 369 | @TADescription(annotation = "TI", type = FIELD, |
jjg@1521 | 370 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), |
jjg@1521 | 371 | @TADescription(annotation = "TJ", type = FIELD), |
jjg@1521 | 372 | @TADescription(annotation = "TK", type = FIELD, |
jjg@1521 | 373 | genericLocation = {0, 0}) |
jjg@1521 | 374 | }) |
jjg@1521 | 375 | public String testField3() { |
jjg@1521 | 376 | return "class Outer {\n" + |
jjg@1521 | 377 | " class GInner<X> {\n" + |
jjg@1521 | 378 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 379 | "}}\n\n" + |
jjg@1521 | 380 | "class Test {\n" + |
jjg@1521 | 381 | " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a;\n" + |
jjg@1521 | 382 | "}"; |
jjg@1521 | 383 | } |
jjg@1521 | 384 | |
jjg@1521 | 385 | @TADescriptions({ |
jjg@1521 | 386 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 387 | genericLocation = {3, 0, 0, 0, 0, 0}), |
jjg@1521 | 388 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 389 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}), |
jjg@1521 | 390 | @TADescription(annotation = "TC", type = FIELD, |
jjg@1521 | 391 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}), |
jjg@1521 | 392 | @TADescription(annotation = "TD", type = FIELD, |
jjg@1521 | 393 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), |
jjg@1521 | 394 | @TADescription(annotation = "TE", type = FIELD, |
jjg@1521 | 395 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), |
jjg@1521 | 396 | @TADescription(annotation = "TF", type = FIELD, |
jjg@1521 | 397 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), |
jjg@1521 | 398 | @TADescription(annotation = "TG", type = FIELD, |
jjg@1521 | 399 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}), |
jjg@1521 | 400 | @TADescription(annotation = "TH", type = FIELD, |
jjg@1521 | 401 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), |
jjg@1521 | 402 | @TADescription(annotation = "TI", type = FIELD, |
jjg@1521 | 403 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), |
jjg@1521 | 404 | @TADescription(annotation = "TJ", type = FIELD, |
jjg@1521 | 405 | genericLocation = {3, 0}), |
jjg@1521 | 406 | @TADescription(annotation = "TK", type = FIELD, |
jjg@1521 | 407 | genericLocation = {3, 0, 0, 0}) |
jjg@1521 | 408 | }) |
jjg@1521 | 409 | public String testField4() { |
jjg@1521 | 410 | return "class Outer {\n" + |
jjg@1521 | 411 | " class GInner<X> {\n" + |
jjg@1521 | 412 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 413 | "}}\n\n" + |
jjg@1521 | 414 | "class Test {\n" + |
jjg@1521 | 415 | " List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a;\n" + |
jjg@1521 | 416 | "}"; |
jjg@1521 | 417 | } |
jjg@1521 | 418 | |
jjg@1521 | 419 | |
jjg@1521 | 420 | // return types |
jjg@1521 | 421 | |
jjg@1521 | 422 | @TADescriptions({ |
jjg@1521 | 423 | @TADescription(annotation = "TA", type = METHOD_RETURN, |
jjg@1521 | 424 | genericLocation = {}), |
jjg@1521 | 425 | @TADescription(annotation = "TB", type = METHOD_RETURN, |
jjg@1521 | 426 | genericLocation = {1, 0}) |
jjg@1521 | 427 | }) |
jjg@1521 | 428 | public String testReturn1() { |
jjg@1521 | 429 | return "@TA Outer.@TB Inner test() { return null; }"; |
jjg@1521 | 430 | } |
jjg@1521 | 431 | |
jjg@1521 | 432 | @TADescriptions({ |
jjg@1521 | 433 | @TADescription(annotation = "TA", type = METHOD_RETURN, |
jjg@1521 | 434 | genericLocation = {}), |
jjg@1521 | 435 | @TADescription(annotation = "TB", type = METHOD_RETURN, |
jjg@1521 | 436 | genericLocation = {1, 0}) |
jjg@1521 | 437 | }) |
jjg@1521 | 438 | public String testReturn2() { |
jjg@1521 | 439 | return "@TA GOuter<String,String>.@TB GInner<String,String> test() { return null; }"; |
jjg@1521 | 440 | } |
jjg@1521 | 441 | |
jjg@1521 | 442 | @TADescriptions({ |
jjg@1521 | 443 | @TADescription(annotation = "TA", type = METHOD_RETURN, |
jjg@1521 | 444 | genericLocation = {0, 0, 0, 0}), |
jjg@1521 | 445 | @TADescription(annotation = "TB", type = METHOD_RETURN, |
jjg@1521 | 446 | genericLocation = {0, 0, 0, 0, 1, 0}), |
jjg@1521 | 447 | @TADescription(annotation = "TC", type = METHOD_RETURN, |
jjg@1521 | 448 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}), |
jjg@1521 | 449 | @TADescription(annotation = "TD", type = METHOD_RETURN, |
jjg@1521 | 450 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), |
jjg@1521 | 451 | @TADescription(annotation = "TE", type = METHOD_RETURN, |
jjg@1521 | 452 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), |
jjg@1521 | 453 | @TADescription(annotation = "TF", type = METHOD_RETURN, |
jjg@1521 | 454 | genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), |
jjg@1521 | 455 | @TADescription(annotation = "TG", type = METHOD_RETURN, |
jjg@1521 | 456 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}), |
jjg@1521 | 457 | @TADescription(annotation = "TH", type = METHOD_RETURN, |
jjg@1521 | 458 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), |
jjg@1521 | 459 | @TADescription(annotation = "TI", type = METHOD_RETURN, |
jjg@1521 | 460 | genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), |
jjg@1521 | 461 | @TADescription(annotation = "TJ", type = METHOD_RETURN), |
jjg@1521 | 462 | @TADescription(annotation = "TK", type = METHOD_RETURN, |
jjg@1521 | 463 | genericLocation = {0, 0}) |
jjg@1521 | 464 | }) |
jjg@1521 | 465 | public String testReturn3() { |
jjg@1521 | 466 | return "class Outer {\n" + |
jjg@1521 | 467 | " class GInner<X> {\n" + |
jjg@1521 | 468 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 469 | "}}\n\n" + |
jjg@1521 | 470 | "class Test {\n" + |
jjg@1521 | 471 | " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] test() { return null; }\n" + |
jjg@1521 | 472 | "}"; |
jjg@1521 | 473 | } |
jjg@1521 | 474 | |
jjg@1521 | 475 | @TADescriptions({ |
jjg@1521 | 476 | @TADescription(annotation = "TA", type = METHOD_RETURN, |
jjg@1521 | 477 | genericLocation = {3, 0, 0, 0, 0, 0}), |
jjg@1521 | 478 | @TADescription(annotation = "TB", type = METHOD_RETURN, |
jjg@1521 | 479 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}), |
jjg@1521 | 480 | @TADescription(annotation = "TC", type = METHOD_RETURN, |
jjg@1521 | 481 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}), |
jjg@1521 | 482 | @TADescription(annotation = "TD", type = METHOD_RETURN, |
jjg@1521 | 483 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), |
jjg@1521 | 484 | @TADescription(annotation = "TE", type = METHOD_RETURN, |
jjg@1521 | 485 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), |
jjg@1521 | 486 | @TADescription(annotation = "TF", type = METHOD_RETURN, |
jjg@1521 | 487 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), |
jjg@1521 | 488 | @TADescription(annotation = "TG", type = METHOD_RETURN, |
jjg@1521 | 489 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}), |
jjg@1521 | 490 | @TADescription(annotation = "TH", type = METHOD_RETURN, |
jjg@1521 | 491 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), |
jjg@1521 | 492 | @TADescription(annotation = "TI", type = METHOD_RETURN, |
jjg@1521 | 493 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), |
jjg@1521 | 494 | @TADescription(annotation = "TJ", type = METHOD_RETURN, |
jjg@1521 | 495 | genericLocation = {3, 0}), |
jjg@1521 | 496 | @TADescription(annotation = "TK", type = METHOD_RETURN, |
jjg@1521 | 497 | genericLocation = {3, 0, 0, 0}) |
jjg@1521 | 498 | }) |
jjg@1521 | 499 | public String testReturn4() { |
jjg@1521 | 500 | return "class Outer {\n" + |
jjg@1521 | 501 | " class GInner<X> {\n" + |
jjg@1521 | 502 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 503 | "}}\n\n" + |
jjg@1521 | 504 | "class Test {\n" + |
jjg@1521 | 505 | " List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> test() { return null; }\n" + |
jjg@1521 | 506 | "}"; |
jjg@1521 | 507 | } |
jjg@1521 | 508 | |
jjg@1521 | 509 | @TADescriptions({ |
jjg@1521 | 510 | @TADescription(annotation = "TA", type = METHOD_RETURN, |
jjg@1521 | 511 | genericLocation = {3, 0}), |
jjg@1521 | 512 | @TADescription(annotation = "TB", type = METHOD_RETURN, |
jjg@1521 | 513 | genericLocation = {3, 0, 3, 0}), |
jjg@1521 | 514 | @TADescription(annotation = "TC", type = METHOD_RETURN, |
jjg@1521 | 515 | genericLocation = {3, 0, 3, 1}), |
jjg@1521 | 516 | @TADescription(annotation = "TD", type = METHOD_RETURN, |
jjg@1521 | 517 | genericLocation = {3, 0, 3, 1, 3, 0}), |
jjg@1521 | 518 | @TADescription(annotation = "TE", type = METHOD_RETURN, |
jjg@1521 | 519 | genericLocation = {3, 0, 1, 0}), |
jjg@1521 | 520 | @TADescription(annotation = "TF", type = METHOD_RETURN, |
jjg@1521 | 521 | genericLocation = {3, 0, 1, 0, 3, 0}), |
jjg@1521 | 522 | @TADescription(annotation = "TG", type = METHOD_RETURN, |
jjg@1521 | 523 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), |
jjg@1521 | 524 | @TADescription(annotation = "TH", type = METHOD_RETURN, |
jjg@1521 | 525 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}), |
jjg@1521 | 526 | @TADescription(annotation = "TI", type = METHOD_RETURN, |
jjg@1521 | 527 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}), |
jjg@1521 | 528 | @TADescription(annotation = "TJ", type = METHOD_RETURN, |
jjg@1521 | 529 | genericLocation = {3, 0, 1, 0, 1, 0}), |
jjg@1521 | 530 | }) |
jjg@1521 | 531 | public String testReturn5() { |
jjg@1521 | 532 | return "class GOuter<A, B> {\n" + |
jjg@1521 | 533 | " class GInner<X> {\n" + |
jjg@1521 | 534 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 535 | "}}\n\n" + |
jjg@1521 | 536 | "class Test {\n" + |
jjg@1521 | 537 | " List<@TA GOuter<@TB String, @TC List<@TD Object>> . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2<String, String>> test() { return null; }\n" + |
jjg@1521 | 538 | "}"; |
jjg@1521 | 539 | } |
jjg@1521 | 540 | |
jjg@1521 | 541 | |
jjg@1521 | 542 | // type parameters |
jjg@1521 | 543 | |
jjg@1521 | 544 | @TADescriptions({ |
jjg@1521 | 545 | @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 546 | genericLocation = {}, paramIndex = 0, boundIndex = 0), |
jjg@1521 | 547 | @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 548 | genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0) |
jjg@1521 | 549 | }) |
jjg@1521 | 550 | public String testTypeparam1() { |
jjg@1521 | 551 | return "<X extends @TA Outer.@TB Inner> X test() { return null; }"; |
jjg@1521 | 552 | } |
jjg@1521 | 553 | |
jjg@1521 | 554 | @TADescriptions({ |
jjg@1521 | 555 | @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 556 | genericLocation = {}, paramIndex = 0, boundIndex = 0), |
jjg@1521 | 557 | @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 558 | genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0) |
jjg@1521 | 559 | }) |
jjg@1521 | 560 | public String testTypeparam2() { |
jjg@1521 | 561 | return "<X extends @TA GOuter<String,String>.@TB GInner<String,String>> X test() { return null; }"; |
jjg@1521 | 562 | } |
jjg@1521 | 563 | |
jjg@1521 | 564 | @TADescriptions({ |
jjg@1521 | 565 | @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 566 | genericLocation = {}, |
jjg@1521 | 567 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 568 | @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 569 | genericLocation = {1, 0}, |
jjg@1521 | 570 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 571 | @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 572 | genericLocation = {1, 0, 3, 0}, |
jjg@1521 | 573 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 574 | @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 575 | genericLocation = {1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, |
jjg@1521 | 576 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 577 | @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 578 | genericLocation = {1, 0, 3, 0, 3, 0}, |
jjg@1521 | 579 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 580 | @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 581 | genericLocation = {1, 0, 3, 0, 3, 0, 0, 0}, |
jjg@1521 | 582 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 583 | @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 584 | genericLocation = {1, 0, 1, 0}, |
jjg@1521 | 585 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 586 | @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 587 | genericLocation = {1, 0, 1, 0, 3, 0}, |
jjg@1521 | 588 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 589 | @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 590 | genericLocation = {1, 0, 1, 0, 3, 1}, |
jjg@1521 | 591 | paramIndex = 0, boundIndex = 0), |
jjg@1521 | 592 | }) |
jjg@1521 | 593 | public String testTypeparam3() { |
jjg@1521 | 594 | return "class Outer {\n" + |
jjg@1521 | 595 | " class GInner<X> {\n" + |
jjg@1521 | 596 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 597 | "}}\n\n" + |
jjg@1521 | 598 | "class Test {\n" + |
jjg@1521 | 599 | " <X extends @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object>> X test() { return null; }\n" + |
jjg@1521 | 600 | "}"; |
jjg@1521 | 601 | } |
jjg@1521 | 602 | |
jjg@1521 | 603 | @TADescriptions({ |
jjg@1521 | 604 | @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 605 | genericLocation = {3, 0, 0, 0, 0, 0}, |
jjg@1521 | 606 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 607 | @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 608 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, |
jjg@1521 | 609 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 610 | @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 611 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, |
jjg@1521 | 612 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 613 | @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 614 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, |
jjg@1521 | 615 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 616 | @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 617 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, |
jjg@1521 | 618 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 619 | @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 620 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, |
jjg@1521 | 621 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 622 | @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 623 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, |
jjg@1521 | 624 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 625 | @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 626 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, |
jjg@1521 | 627 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 628 | @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 629 | genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, |
jjg@1521 | 630 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 631 | @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 632 | genericLocation = {3, 0}, |
jjg@1521 | 633 | paramIndex = 0, boundIndex = 1), |
jjg@1521 | 634 | @TADescription(annotation = "TK", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 635 | genericLocation = {3, 0, 0, 0}, |
jjg@1521 | 636 | paramIndex = 0, boundIndex = 1) |
jjg@1521 | 637 | }) |
jjg@1521 | 638 | public String testTypeparam4() { |
jjg@1521 | 639 | return "class Outer {\n" + |
jjg@1521 | 640 | " class GInner<X> {\n" + |
jjg@1521 | 641 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 642 | "}}\n\n" + |
jjg@1521 | 643 | "class Test {\n" + |
jjg@1521 | 644 | " <X extends List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]>> X test() { return null; }\n" + |
jjg@1521 | 645 | "}"; |
jjg@1521 | 646 | } |
jjg@1521 | 647 | |
jjg@1521 | 648 | @TADescriptions({ |
jjg@1521 | 649 | @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 650 | genericLocation = {3, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 651 | @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 652 | genericLocation = {3, 0, 3, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 653 | @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 654 | genericLocation = {3, 0, 3, 1}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 655 | @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 656 | genericLocation = {3, 0, 3, 1, 3, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 657 | @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 658 | genericLocation = {3, 0, 1, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 659 | @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 660 | genericLocation = {3, 0, 1, 0, 3, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 661 | @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 662 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 663 | @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 664 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 665 | @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 666 | genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 667 | @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND, |
jjg@1521 | 668 | genericLocation = {3, 0, 1, 0, 1, 0}, paramIndex = 0, boundIndex = 1), |
jjg@1521 | 669 | }) |
jjg@1521 | 670 | public String testTypeparam5() { |
jjg@1521 | 671 | return "class GOuter<A, B> {\n" + |
jjg@1521 | 672 | " class GInner<X> {\n" + |
jjg@1521 | 673 | " class GInner2<Y, Z> {}\n" + |
jjg@1521 | 674 | "}}\n\n" + |
jjg@1521 | 675 | "class Test {\n" + |
jjg@1521 | 676 | " <X extends List<@TA GOuter<@TB String, @TC List<@TD Object>> . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2<String, String>>> X test() { return null; }\n" + |
jjg@1521 | 677 | "}"; |
jjg@1521 | 678 | } |
jjg@1521 | 679 | |
jjg@1521 | 680 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 681 | genericLocation = {3, 0, 1, 0}) |
jjg@1521 | 682 | public String testUses1a() { |
jjg@1521 | 683 | return "class Test { class Inner {} List<@TA Inner> f; }"; |
jjg@1521 | 684 | } |
jjg@1521 | 685 | |
jjg@1521 | 686 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 687 | genericLocation = {3, 0}) |
jjg@1521 | 688 | public String testUses1b() { |
jjg@1521 | 689 | return "class Test { class Inner {} List<@TA Test.Inner> f; }"; |
jjg@1521 | 690 | } |
jjg@1521 | 691 | |
jjg@1521 | 692 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 693 | genericLocation = {3, 0, 1, 0, 1, 0}) |
jjg@1521 | 694 | @TestClass("Test$Inner") |
jjg@1521 | 695 | public String testUses2a() { |
jjg@1521 | 696 | return "class Test { class Inner { class Inner2{} List<@TA Inner2> f; }}"; |
jjg@1521 | 697 | } |
jjg@1521 | 698 | |
jjg@1521 | 699 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 700 | genericLocation = {3, 0, 1, 0}) |
jjg@1521 | 701 | @TestClass("Test$Inner") |
jjg@1521 | 702 | public String testUses2b() { |
jjg@1521 | 703 | return "class Test { class Inner { class Inner2{} List<@TA Inner.Inner2> f; }}"; |
jjg@1521 | 704 | } |
jjg@1521 | 705 | |
jjg@1521 | 706 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 707 | genericLocation = {3, 0, 1, 0, 1, 0}) |
jjg@1521 | 708 | @TestClass("Test$Inner") |
jjg@1521 | 709 | public String testUses2c() { |
jjg@1521 | 710 | return "class Test { class Inner { class Inner2{} List<Inner.@TA Inner2> f; }}"; |
jjg@1521 | 711 | } |
jjg@1521 | 712 | |
jjg@1521 | 713 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 714 | genericLocation = {3, 0}) |
jjg@1521 | 715 | @TestClass("Test$Inner") |
jjg@1521 | 716 | public String testUses2d() { |
jjg@1521 | 717 | return "class Test{ class Inner { class Inner2{} List<@TA Test.Inner.Inner2> f; }}"; |
jjg@1521 | 718 | } |
jjg@1521 | 719 | |
jjg@1521 | 720 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 721 | genericLocation = {3, 0, 1, 0}) |
jjg@1521 | 722 | @TestClass("Test$Inner") |
jjg@1521 | 723 | public String testUses2e() { |
jjg@1521 | 724 | return "class Test { class Inner { class Inner2{} List<Test.@TA Inner.Inner2> f; }}"; |
jjg@1521 | 725 | } |
jjg@1521 | 726 | |
jjg@1521 | 727 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 728 | genericLocation = {3, 0, 1, 0, 1, 0}) |
jjg@1521 | 729 | @TestClass("Test$Inner") |
jjg@1521 | 730 | public String testUses2f() { |
jjg@1521 | 731 | return "class Test { class Inner { class Inner2{} List<Test.Inner.@TA Inner2> f; }}"; |
jjg@1521 | 732 | } |
jjg@1521 | 733 | |
jjg@1521 | 734 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 735 | genericLocation = {3, 0, 1, 0, 1, 0}) |
jjg@1521 | 736 | @TestClass("Test$Inner") |
jjg@1521 | 737 | public String testUses3a() { |
jjg@1521 | 738 | return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" + |
jjg@1521 | 739 | " List<Test.Inner.@TA Inner2> f; }}"; |
jjg@1521 | 740 | } |
jjg@1521 | 741 | |
jjg@1521 | 742 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 743 | genericLocation = {3, 0, 1, 0}) |
jjg@1521 | 744 | @TestClass("Test$Inner") |
jjg@1521 | 745 | public String testUses3b() { |
jjg@1521 | 746 | return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" + |
jjg@1521 | 747 | " List<Test.@TA Inner.Inner2> f; }}"; |
jjg@1521 | 748 | } |
jjg@1521 | 749 | |
jjg@1521 | 750 | @TADescriptions({ |
jjg@1521 | 751 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 752 | genericLocation = {}), |
jjg@1521 | 753 | @TADescription(annotation = "TB", type = FIELD, |
jjg@1521 | 754 | genericLocation = {3, 0}) |
jjg@1521 | 755 | }) |
jjg@1521 | 756 | public String testUses4() { |
jjg@1521 | 757 | return "class Test { static class TInner {}\n" + |
jjg@1521 | 758 | " @TA TInner f; \n" + |
jjg@1521 | 759 | " List<@TB TInner> g; }"; |
jjg@1521 | 760 | } |
jjg@1521 | 761 | |
jjg@1521 | 762 | @TADescription(annotation = "TA", type = FIELD, |
jjg@1521 | 763 | genericLocation = {3, 0, 1, 0, 3, 1}) |
jjg@1521 | 764 | @TestClass("Test$Inner") |
jjg@1521 | 765 | public String testUses3c() { |
jjg@1521 | 766 | return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" + |
jjg@1521 | 767 | " List<Test.Inner<String, @TA Object>.Inner2<Test, Test>> f; }}"; |
jjg@1521 | 768 | } |
jjg@1521 | 769 | |
jjg@1521 | 770 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex=0) |
jjg@1521 | 771 | public String testFullyQualified1() { |
jjg@1521 | 772 | return "void testme(java.security.@TA ProtectionDomain protectionDomain) {}"; |
jjg@1521 | 773 | } |
jjg@1521 | 774 | |
jjg@1521 | 775 | @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex=0, |
jjg@1521 | 776 | genericLocation = {3, 0}) |
jjg@1521 | 777 | public String testFullyQualified2() { |
jjg@1521 | 778 | return "void testme(List<java.security.@TA ProtectionDomain> protectionDomain) {}"; |
jjg@1521 | 779 | } |
jjg@1521 | 780 | |
jjg@1521 | 781 | @TADescriptions({ |
jjg@1521 | 782 | @TADescription(annotation = "TA", type = LOCAL_VARIABLE, |
jjg@1521 | 783 | genericLocation = {}, |
jjg@1521 | 784 | lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 785 | lvarLength = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 786 | lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), |
jjg@1521 | 787 | @TADescription(annotation = "TB", type = LOCAL_VARIABLE, |
jjg@1521 | 788 | genericLocation = {1, 0}, |
jjg@1521 | 789 | lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 790 | lvarLength = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 791 | lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), |
jjg@1521 | 792 | @TADescription(annotation = "TC", type = LOCAL_VARIABLE, |
jjg@1521 | 793 | // Only classes count, not methods. |
jjg@1521 | 794 | genericLocation = {1, 0, 1, 0}, |
jjg@1521 | 795 | lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 796 | lvarLength = ReferenceInfoUtil.IGNORE_VALUE, |
jjg@1521 | 797 | lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), |
jjg@1521 | 798 | }) |
jjg@1521 | 799 | @TestClass("Outer$Inner") |
jjg@1521 | 800 | public String testMethodNesting1() { |
jjg@1521 | 801 | return "class Outer {\n" + |
jjg@1521 | 802 | " class Inner {\n" + |
jjg@1521 | 803 | " void foo() {\n" + |
jjg@1521 | 804 | " class MInner {}\n" + |
jjg@1521 | 805 | " @TA Outer . @TB Inner l1 = null;\n" + |
jjg@1521 | 806 | " @TC MInner l2 = null;\n" + |
jjg@1521 | 807 | " }\n" + |
jjg@1521 | 808 | "}}\n"; |
jjg@1521 | 809 | } |
jjg@1521 | 810 | |
jjg@1521 | 811 | @TADescriptions({ |
jjg@1521 | 812 | @TADescription(annotation = "TA", type = NEW, |
jjg@1521 | 813 | genericLocation = {}, |
jjg@1521 | 814 | offset = 0), |
jjg@1521 | 815 | @TADescription(annotation = "TB", type = NEW, |
jjg@1521 | 816 | genericLocation = {1, 0}, |
jjg@1521 | 817 | offset = 0), |
jjg@1521 | 818 | @TADescription(annotation = "TC", type = NEW, |
jjg@1521 | 819 | // Only classes count, not methods. |
jjg@1521 | 820 | genericLocation = {1, 0, 1, 0}, |
jjg@1521 | 821 | offset = 12), |
jjg@1521 | 822 | }) |
jjg@1521 | 823 | @TestClass("Outer$Inner") |
jjg@1521 | 824 | public String testMethodNesting2() { |
jjg@1521 | 825 | return "class Outer {\n" + |
jjg@1521 | 826 | " class Inner {\n" + |
jjg@1521 | 827 | " void foo() {\n" + |
jjg@1521 | 828 | " class MInner {}\n" + |
jjg@1521 | 829 | " Object o1 = new @TA Outer . @TB Inner();" + |
jjg@1521 | 830 | " Object o2 = new @TC MInner();\n" + |
jjg@1521 | 831 | " }\n" + |
jjg@1521 | 832 | "}}\n"; |
jjg@1521 | 833 | } |
jjg@1521 | 834 | } |