jjg@1521: /* darcy@1534: * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. jjg@1521: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@1521: * jjg@1521: * This code is free software; you can redistribute it and/or modify it jjg@1521: * under the terms of the GNU General Public License version 2 only, as jjg@1521: * published by the Free Software Foundation. jjg@1521: * jjg@1521: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@1521: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@1521: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@1521: * version 2 for more details (a copy is included in the LICENSE file that jjg@1521: * accompanied this code). jjg@1521: * jjg@1521: * You should have received a copy of the GNU General Public License version jjg@1521: * 2 along with this work; if not, write to the Free Software Foundation, jjg@1521: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@1521: * jjg@1521: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jjg@1521: * or visit www.oracle.com if you need additional information or have any jjg@1521: * questions. jjg@1521: */ jjg@1521: jjg@1521: import static com.sun.tools.classfile.TypeAnnotation.TargetType.*; jjg@1521: jjg@1521: /* jjg@1521: * @test jjg@1521: * @summary Test population of reference info for nested types jjg@1521: * @compile -g Driver.java ReferenceInfoUtil.java NestedTypes.java jjg@1521: * @run main Driver NestedTypes jjg@1521: */ jjg@1521: public class NestedTypes { jjg@1521: jjg@1521: // method parameters jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam1() { jjg@1521: return "void test(@TA Outer.@TB Inner a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam1b() { jjg@1521: return "void test(List<@TA Outer.@TB Inner> a) { }"; jjg@1521: } jjg@1521: jjg@1521: // TODO: the tests that use @TA Map.Entry should fail, as jjg@1521: // Map cannot be annotated. jjg@1521: // We need some tests for the fully qualified name syntax. jjg@1521: /* jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {}, paramIndex = 0) jjg@1521: public String testParam1c() { jjg@1521: return "void test(java.util.@TA Map.Entry a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam1d() { jjg@1521: return "void test(java.util.@TA Map.@TB Entry a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0) jjg@1521: public String testParam1e() { jjg@1521: return "void test(List a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam1f() { jjg@1521: return "void test(List a) { }"; jjg@1521: } jjg@1521: */ jjg@1521: jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0) jjg@1521: public String testParam1g() { jjg@1521: return "void test(List a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam2() { jjg@1521: return "void test(@TA GOuter.@TB GInner a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 1, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam2b() { jjg@1521: return "void test(List<@TA GOuter.@TB GInner> a) { }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, paramIndex = 0), jjg@1521: @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {0, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam3() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " void test(@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a) { }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0}, paramIndex = 0), jjg@1521: @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER, jjg@1521: genericLocation = {3, 0, 0, 0}, paramIndex = 0) jjg@1521: }) jjg@1521: public String testParam4() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " 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: "}"; jjg@1521: } jjg@1521: jjg@1521: jjg@1521: // Local variables jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {1, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: }) jjg@1521: public String testLocal1a() { jjg@1521: return "void test() { @TA Outer.@TB Inner a = null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: public String testLocal1b() { jjg@1521: return "void test() { @TA Outer.Inner a = null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {1, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: public String testLocal1c() { jjg@1521: return "void test() { Outer.@TB Inner a = null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {1, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: }) jjg@1521: public String testLocal2() { jjg@1521: return "void test() { @TA GOuter.@TB GInner a = null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TC", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TD", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TE", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TF", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TG", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TH", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TI", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TJ", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TK", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {0, 0}, jjg@1521: lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: }) jjg@1521: public String testLocal3() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " 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: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TC", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TD", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TE", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TF", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TG", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TH", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TI", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TJ", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}), jjg@1521: @TADescription(annotation = "TK", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {3, 0, 0, 0}, jjg@1521: lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}) jjg@1521: }) jjg@1521: public String testLocal4() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " 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: "}"; jjg@1521: } jjg@1521: jjg@1521: jjg@1521: // fields jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {}), jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {1, 0}) jjg@1521: }) jjg@1521: public String testField1a() { jjg@1521: return "@TA Outer.@TB Inner a;"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {}) jjg@1521: public String testField1b() { jjg@1521: return "@TA Outer.Inner a;"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {1, 0}) jjg@1521: public String testField1c() { jjg@1521: return "Outer.@TB Inner a;"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {}), jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {1, 0}) jjg@1521: }) jjg@1521: public String testField2() { jjg@1521: return "@TA GOuter.@TB GInner a;"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TC", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TD", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TE", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TF", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TG", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TH", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TI", type = FIELD, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), jjg@1521: @TADescription(annotation = "TJ", type = FIELD), jjg@1521: @TADescription(annotation = "TK", type = FIELD, jjg@1521: genericLocation = {0, 0}) jjg@1521: }) jjg@1521: public String testField3() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a;\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TC", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TD", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TE", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TF", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TG", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TH", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TI", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), jjg@1521: @TADescription(annotation = "TJ", type = FIELD, jjg@1521: genericLocation = {3, 0}), jjg@1521: @TADescription(annotation = "TK", type = FIELD, jjg@1521: genericLocation = {3, 0, 0, 0}) jjg@1521: }) jjg@1521: public String testField4() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a;\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: jjg@1521: // return types jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_RETURN, jjg@1521: genericLocation = {}), jjg@1521: @TADescription(annotation = "TB", type = METHOD_RETURN, jjg@1521: genericLocation = {1, 0}) jjg@1521: }) jjg@1521: public String testReturn1() { jjg@1521: return "@TA Outer.@TB Inner test() { return null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_RETURN, jjg@1521: genericLocation = {}), jjg@1521: @TADescription(annotation = "TB", type = METHOD_RETURN, jjg@1521: genericLocation = {1, 0}) jjg@1521: }) jjg@1521: public String testReturn2() { jjg@1521: return "@TA GOuter.@TB GInner test() { return null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TB", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TC", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TD", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TE", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TF", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TG", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TH", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TI", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_RETURN), jjg@1521: @TADescription(annotation = "TK", type = METHOD_RETURN, jjg@1521: genericLocation = {0, 0}) jjg@1521: }) jjg@1521: public String testReturn3() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] test() { return null; }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TB", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TC", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TD", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TE", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TF", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TG", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TH", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TI", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0}), jjg@1521: @TADescription(annotation = "TK", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 0, 0}) jjg@1521: }) jjg@1521: public String testReturn4() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " 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: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0}), jjg@1521: @TADescription(annotation = "TB", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TC", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 3, 1}), jjg@1521: @TADescription(annotation = "TD", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 3, 1, 3, 0}), jjg@1521: @TADescription(annotation = "TE", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0}), jjg@1521: @TADescription(annotation = "TF", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TG", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TH", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}), jjg@1521: @TADescription(annotation = "TI", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_RETURN, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}), jjg@1521: }) jjg@1521: public String testReturn5() { jjg@1521: return "class GOuter {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " List<@TA GOuter<@TB String, @TC List<@TD Object>> . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2> test() { return null; }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: jjg@1521: // type parameters jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {}, paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0) jjg@1521: }) jjg@1521: public String testTypeparam1() { jjg@1521: return " X test() { return null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {}, paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0) jjg@1521: }) jjg@1521: public String testTypeparam2() { jjg@1521: return ".@TB GInner> X test() { return null; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 3, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 3, 0, 3, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 1, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 1, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {1, 0, 1, 0, 3, 1}, jjg@1521: paramIndex = 0, boundIndex = 0), jjg@1521: }) jjg@1521: public String testTypeparam3() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " >. @TG GInner2<@TH Integer, @TI Object>> X test() { return null; }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0}, jjg@1521: paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TK", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 0, 0}, jjg@1521: paramIndex = 0, boundIndex = 1) jjg@1521: }) jjg@1521: public String testTypeparam4() { jjg@1521: return "class Outer {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " >. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]>> X test() { return null; }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 3, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 3, 1}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 3, 1, 3, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}, paramIndex = 0, boundIndex = 1), jjg@1521: }) jjg@1521: public String testTypeparam5() { jjg@1521: return "class GOuter {\n" + jjg@1521: " class GInner {\n" + jjg@1521: " class GInner2 {}\n" + jjg@1521: "}}\n\n" + jjg@1521: "class Test {\n" + jjg@1521: " > . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2>> X test() { return null; }\n" + jjg@1521: "}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0}) jjg@1521: public String testUses1a() { jjg@1521: return "class Test { class Inner {} List<@TA Inner> f; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0}) jjg@1521: public String testUses1b() { jjg@1521: return "class Test { class Inner {} List<@TA Test.Inner> f; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2a() { jjg@1521: return "class Test { class Inner { class Inner2{} List<@TA Inner2> f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2b() { jjg@1521: return "class Test { class Inner { class Inner2{} List<@TA Inner.Inner2> f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2c() { jjg@1521: return "class Test { class Inner { class Inner2{} List f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2d() { jjg@1521: return "class Test{ class Inner { class Inner2{} List<@TA Test.Inner.Inner2> f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2e() { jjg@1521: return "class Test { class Inner { class Inner2{} List f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses2f() { jjg@1521: return "class Test { class Inner { class Inner2{} List f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses3a() { jjg@1521: return "class Test { class Inner { class Inner2{}\n" + jjg@1521: " List f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses3b() { jjg@1521: return "class Test { class Inner { class Inner2{}\n" + jjg@1521: " List f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {}), jjg@1521: @TADescription(annotation = "TB", type = FIELD, jjg@1521: genericLocation = {3, 0}) jjg@1521: }) jjg@1521: public String testUses4() { jjg@1521: return "class Test { static class TInner {}\n" + jjg@1521: " @TA TInner f; \n" + jjg@1521: " List<@TB TInner> g; }"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = FIELD, jjg@1521: genericLocation = {3, 0, 1, 0, 3, 1}) jjg@1521: @TestClass("Test$Inner") jjg@1521: public String testUses3c() { jjg@1521: return "class Test { class Inner { class Inner2{}\n" + jjg@1521: " List.Inner2> f; }}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex=0) jjg@1521: public String testFullyQualified1() { jjg@1521: return "void testme(java.security.@TA ProtectionDomain protectionDomain) {}"; jjg@1521: } jjg@1521: jjg@1521: @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex=0, jjg@1521: genericLocation = {3, 0}) jjg@1521: public String testFullyQualified2() { jjg@1521: return "void testme(List protectionDomain) {}"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {}, jjg@1521: lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarLength = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), jjg@1521: @TADescription(annotation = "TB", type = LOCAL_VARIABLE, jjg@1521: genericLocation = {1, 0}, jjg@1521: lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarLength = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), jjg@1521: @TADescription(annotation = "TC", type = LOCAL_VARIABLE, jjg@1521: // Only classes count, not methods. jjg@1521: genericLocation = {1, 0, 1, 0}, jjg@1521: lvarOffset = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarLength = ReferenceInfoUtil.IGNORE_VALUE, jjg@1521: lvarIndex = ReferenceInfoUtil.IGNORE_VALUE), jjg@1521: }) jjg@1521: @TestClass("Outer$Inner") jjg@1521: public String testMethodNesting1() { jjg@1521: return "class Outer {\n" + jjg@1521: " class Inner {\n" + jjg@1521: " void foo() {\n" + jjg@1521: " class MInner {}\n" + jjg@1521: " @TA Outer . @TB Inner l1 = null;\n" + jjg@1521: " @TC MInner l2 = null;\n" + jjg@1521: " }\n" + jjg@1521: "}}\n"; jjg@1521: } jjg@1521: jjg@1521: @TADescriptions({ jjg@1521: @TADescription(annotation = "TA", type = NEW, jjg@1521: genericLocation = {}, jjg@1521: offset = 0), jjg@1521: @TADescription(annotation = "TB", type = NEW, jjg@1521: genericLocation = {1, 0}, jjg@1521: offset = 0), jjg@1521: @TADescription(annotation = "TC", type = NEW, jjg@1521: // Only classes count, not methods. jjg@1521: genericLocation = {1, 0, 1, 0}, jjg@1521: offset = 12), jjg@1521: }) jjg@1521: @TestClass("Outer$Inner") jjg@1521: public String testMethodNesting2() { jjg@1521: return "class Outer {\n" + jjg@1521: " class Inner {\n" + jjg@1521: " void foo() {\n" + jjg@1521: " class MInner {}\n" + jjg@1521: " Object o1 = new @TA Outer . @TB Inner();" + jjg@1521: " Object o2 = new @TC MInner();\n" + jjg@1521: " }\n" + jjg@1521: "}}\n"; jjg@1521: } jjg@1521: }