langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 24896 986d876a9121
child 30846 2b3f379840f0
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 24896
diff changeset
     2
 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     4
 *
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     8
 *
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    13
 * accompanied this code).
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    14
 *
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    18
 *
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    21
 * questions.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    22
 */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    23
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    24
import static com.sun.tools.classfile.TypeAnnotation.TargetType.*;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    25
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    26
/*
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    27
 * @test
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    28
 * @bug 8042451
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    29
 * @summary Test population of reference info for method parameters
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 24896
diff changeset
    30
 * @modules jdk.compiler/com.sun.tools.classfile
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    31
 * @compile -g Driver.java ReferenceInfoUtil.java MethodParameters.java
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    32
 * @run main Driver MethodParameters
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    33
 */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    34
public class MethodParameters {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    35
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    36
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    37
    public String methodParamAsPrimitive() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    38
        return "void test(@TA int a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    39
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    40
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    41
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    42
    public String methodParamAsObject() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    43
        return "void test(Object b, @TA Object a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    44
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    45
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    46
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    47
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    48
                genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    49
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    50
                genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    51
    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    52
                genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    53
    public String methodParamAsParametrized() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    54
        return "void test(@TA Map<@TB String, @TC List<@TD String>> a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    55
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    56
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    57
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    58
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    59
                genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    60
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    61
                genericLocation = { 3, 0, 2, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    62
    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    63
                genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    64
    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    65
                genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    66
    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    67
                genericLocation = { 3, 1, 3, 0, 2, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    68
    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    69
                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    70
    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    71
                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0, 2, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    72
    @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    73
                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    74
    @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    75
                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 1, 2, 0 }, paramIndex = 0)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    76
    public String methodParamAsWildcard() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    77
        return "void test(@TA Map<@TB ? extends @TC String," +
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    78
                "                 @TD List<@TE ? extends @TF Map<@TG ? super @TH String," +
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    79
                "                                                @TI ? extends @TJ Object>>> a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    80
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    81
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    82
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    83
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    84
                genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    85
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    86
                genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    87
    public String methodParamAsArray() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    88
        return "void test(Object b, @TC String @TA [] @TB [] a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    89
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    90
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    91
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    92
                genericLocation = { 0, 0 }, paramIndex = 1)
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    93
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    94
                genericLocation = { 0, 0 }, paramIndex = 1)
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    95
    public String methodParamAsArray2() {
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    96
        return "void test(Object b, @TA @TB String [] a) { }";
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    97
    }
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    98
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
    99
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   100
                genericLocation = { 0, 0 }, paramIndex = 1)
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   101
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   102
                genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   103
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   104
                genericLocation = { 0, 0 }, paramIndex = 1)
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   105
    public String methodParamAsArray3() {
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   106
        return "void test(Object b, @TA @TB @TC String [] a) { }";
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   107
    }
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   108
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   109
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   110
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   111
                genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   112
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   113
                genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   114
    public String methodParamAsVararg() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   115
        return "void test(Object b, @TC String @TA [] @TB ... a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   116
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   117
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   118
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   119
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   120
                genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   121
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   122
                genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   123
    public String methodParamAsFQVararg() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   124
        return "void test(Object b, java.lang.@TC String @TA [] @TB ... a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   125
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   126
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   127
    @TADescriptions({})
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   128
    public String methodWithDeclarationAnnotatin() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   129
        return "void test(@Decl String a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   130
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   131
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   132
    @TADescriptions({})
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   133
    public String methodWithNoTargetAnno() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   134
        return "void test(@A String a) { }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   135
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   136
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   137
    // Smoke tests
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   138
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   139
    public String interfaceMethodParamAsObject() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   140
        return "interface %TEST_CLASS_NAME% { void test(@TA Object a); }";
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   141
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   142
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   143
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 2)
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   144
    public String abstractMethodParamAsObject() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   145
        return "abstract class %TEST_CLASS_NAME% { abstract void test(Object b, Object c, @TA Object a); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   146
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   147
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   148
    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   149
    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   150
                genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   151
    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   152
                genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   153
    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   154
                genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   155
    public String interfaceMethodParamAsParametrized() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   156
        return "interface %TEST_CLASS_NAME% { void test(@TA Map<@TB String, @TC List<@TD String>> a); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   157
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   158
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   159
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   160
    public String methodParamAsPrimitiveRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   161
        return "void test(@RTA @RTA int a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   162
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   163
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   164
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   165
    public String methodParamAsObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   166
        return "void test(Object b, @RTA @RTA Object a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   167
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   168
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   169
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   170
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   171
            genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   172
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   173
            genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   174
    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   175
            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   176
    public String methodParamAsParametrizedRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   177
        return "void test(@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   178
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   179
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   180
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   181
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   182
            genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   183
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   184
            genericLocation = { 3, 0, 2, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   185
    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   186
            genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   187
    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   188
            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   189
    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   190
            genericLocation = { 3, 1, 3, 0, 2, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   191
    public String methodParamAsWildcardRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   192
        return "void test(@RTA @RTA Map<@RTB @RTB ? extends @RTC @RTC String," +
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   193
                "                 @RTD @RTD List<@RTE @RTE ? super @RTF @RTF String>> a) { }";
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   194
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   195
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   196
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   197
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   198
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   199
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   200
            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   201
    public String methodParamAsArrayRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   202
        return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB [] a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   203
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   204
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   205
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   206
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   207
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   208
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   209
    public String methodParamAsArrayRepeatableAnnotation2() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   210
        return "void test(Object b, @RTA @RTA @RTB @RTB String [] a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   211
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   212
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   213
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   214
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   215
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   216
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   217
    public String methodParamAsArrayRepeatableAnnotation3() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   218
        return "void test(Object b, @RTA @RTA @RTB @RTB String [] a) { }";
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   219
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   220
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   221
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   222
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   223
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   224
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   225
            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   226
    public String methodParamAsVarargRepeatableAnnoattion() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   227
        return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   228
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   229
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   230
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   231
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   232
            genericLocation = { 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   233
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   234
            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   235
    public String methodParamAsFQVarargRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   236
        return "void test(Object b, java.lang.@RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   237
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   238
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   239
    // Smoke tests
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   240
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   241
    public String interfaceMethodParamAsObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   242
        return "interface %TEST_CLASS_NAME% { void test(@RTA @RTA Object a); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   243
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   244
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   245
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 2)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   246
    public String abstractMethodParamAsObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   247
        return "abstract class %TEST_CLASS_NAME% { abstract void test(Object b, Object c, @RTA @RTA Object a); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   248
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   249
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   250
    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   251
    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   252
            genericLocation = { 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   253
    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   254
            genericLocation = { 3, 1 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   255
    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   256
            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   257
    public String interfaceMethodParamAsParametrizedRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   258
        return "interface %TEST_CLASS_NAME% { void test(@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> a); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 22448
diff changeset
   259
    }
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   260
}