langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java
author mchung
Wed, 27 May 2015 13:25:18 -0700
changeset 30846 2b3f379840f0
parent 30730 d3ce7619db2c
permissions -rw-r--r--
8074432: Move jdeps and javap to jdk.jdeps module Reviewed-by: jjg, alanb, erikj
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: 17578
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 new object creations
30846
2b3f379840f0 8074432: Move jdeps and javap to jdk.jdeps module
mchung
parents: 30730
diff changeset
    30
 * @modules jdk.jdeps/com.sun.tools.classfile
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    31
 * @compile -g Driver.java ReferenceInfoUtil.java NewObjects.java
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    32
 * @run main Driver NewObjects
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 NewObjects {
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 = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    37
    public String returnObject() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    38
        return "Object returnObject() { return new @TA String(); }";
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
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    41
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    42
    @TADescription(annotation = "TB", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    43
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    44
    public String returnObjectGeneric() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    45
        return "Object returnObjectGeneric() { return new @TA ArrayList<@TB String>(); }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    46
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    47
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    48
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    49
    public String initObject() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    50
        return "void initObject() { Object a =  new @TA String(); }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    51
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    52
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    53
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    54
    @TADescription(annotation = "TB", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    55
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    56
    @TADescription(annotation = "TC", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    57
            genericLocation = { 3, 1 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    58
    public String initObjectGeneric() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    59
        return "void initObjectGeneric() { Object a = new @TA HashMap<@TB String, @TC String>(); }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    60
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    61
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    62
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    63
    public String eqtestObject() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    64
        return "void eqtestObject() { if (null == new @TA String()); }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    65
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    66
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    67
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    68
    @TADescription(annotation = "TB", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    69
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    70
    public String eqtestObjectGeneric() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    71
        return "void eqtestObjectGeneric() { if (null == new @TA ArrayList<@TB String >()); }";
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    72
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
    73
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    74
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    75
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    76
    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    77
    public String returnNewArray1() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    78
        return "Object returnNewArray1() { return new @TA String @TB[1]; }";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    79
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    80
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    81
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    82
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    83
    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    84
    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    85
            genericLocation = {0, 0})
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    86
    public String returnNewArray2() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    87
        return "Object returnNewArray2() { return new @TA String @TB [1] @TC [2]; }";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    88
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    89
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    90
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    91
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    92
    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    93
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    94
    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    95
    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
    96
            genericLocation = {0, 0})
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    97
    public String returnNewArray3() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    98
        return "Object returnNewArray3() { return new @TA Outer. @TB Inner @TC [1] @TD [2]; }";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
    99
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   100
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   101
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   102
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   103
    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   104
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   105
    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   106
            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   107
    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   108
    @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   109
            genericLocation = {0, 0})
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   110
    public String returnNewArray4() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   111
        return "Object returnNewArray4() { return new @TA Outer. @TB Middle. @TC MInner @TD [1] @TE [2]; }";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   112
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   113
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   114
    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   115
    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   116
            genericLocation = {3, 0, 0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   117
    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   118
            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   119
    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   120
            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   121
    @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   122
            genericLocation = {3, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   123
    @TADescription(annotation = "TF", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   124
            genericLocation = {3, 0, 0, 0})
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   125
    public String returnNewArray5() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   126
        return "Object returnNewArray5() { return new @TA ArrayList<@TB Outer. @TC Middle. @TD MInner @TE [] @TF []>(); }";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   127
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   128
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   129
    @TADescription(annotation = "TA", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   130
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   131
    @TADescription(annotation = "TB", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   132
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   133
    @TADescription(annotation = "TC", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   134
    @TADescription(annotation = "TD", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   135
    genericLocation = {0, 0})
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   136
    public String arrayField() {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   137
        return "@TA Outer. @TB Inner @TC [] @TD [] f;";
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15557
diff changeset
   138
    }
24896
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   139
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   140
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   141
    public String returnObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   142
        return "Object returnObject() { return new @RTA @RTA String(); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   143
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   144
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   145
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   146
    @TADescription(annotation = "RTBs", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   147
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   148
    public String returnObjectGenericRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   149
        return "Object returnObjectGeneric() { return new @RTA @RTA ArrayList<@RTB @RTB String>(); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   150
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   151
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   152
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   153
    public String initObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   154
        return "void initObject() { Object a =  new @RTA @RTA String(); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   155
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   156
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   157
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   158
    @TADescription(annotation = "RTBs", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   159
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   160
    @TADescription(annotation = "RTCs", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   161
            genericLocation = { 3, 1 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   162
    public String initObjectGenericRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   163
        return "void initObjectGeneric() { Object a = new @RTA @RTA HashMap<@RTB @RTB String, @RTC @RTC String>(); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   164
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   165
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   166
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   167
    public String eqtestObjectRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   168
        return "void eqtestObject() { if (null == new @RTA @RTA String()); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   169
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   170
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   171
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   172
    @TADescription(annotation = "RTBs", type = NEW,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   173
            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   174
    public String eqtestObjectGenericRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   175
        return "void eqtestObjectGeneric() { if (null == new @RTA @RTA ArrayList<@RTB @RTB String >()); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   176
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   177
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   178
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   179
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   180
    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   181
    public String returnNewArrayRepeatableAnnotation1() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   182
        return "Object returnNewArray1() { return new @RTA @RTA String @RTB @RTB[1]; }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   183
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   184
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   185
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   186
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   187
    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   188
    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   189
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   190
    public String returnNewArrayRepeatableAnnotation2() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   191
        return "Object returnNewArray2() { return new @RTA @RTA String @RTB @RTB [1] @RTC @RTC [2]; }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   192
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   193
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   194
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   195
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   196
    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   197
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   198
    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   199
    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   200
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   201
    public String returnNewArrayRepeatableAnnotation3() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   202
        return "Object returnNewArray3() { return new @RTA @RTA Outer. @RTB @RTB Inner @RTC @RTC [1] @RTD @RTD [2]; }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   203
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   204
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   205
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   206
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   207
    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   208
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   209
    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   210
            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   211
    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   212
    @TADescription(annotation = "RTEs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   213
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   214
    public String returnNewArrayRepeatableAnnotation4() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   215
        return "Object returnNewArray4() { return new @RTA @RTA Outer." +
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   216
                " @RTB @RTB Middle. @RTC @RTC MInner @RTD @RTD [1] @RTE @RTE [2]; }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   217
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   218
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   219
    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   220
    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   221
            genericLocation = {3, 0, 0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   222
    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   223
            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   224
    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   225
            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   226
    @TADescription(annotation = "RTEs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   227
            genericLocation = {3, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   228
    @TADescription(annotation = "RTFs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   229
            genericLocation = {3, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   230
    public String returnNewArrayRepeatableAnnotation5() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   231
        return "Object returnNewArray5() { return new @RTA @RTA ArrayList<@RTB @RTB Outer." +
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   232
                " @RTC @RTC Middle. @RTD @RTD MInner @RTE @RTE [] @RTF @RTF []>(); }";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   233
    }
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   234
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   235
    @TADescription(annotation = "RTAs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   236
            genericLocation = {0, 0, 0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   237
    @TADescription(annotation = "RTBs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   238
            genericLocation = {0, 0, 0, 0, 1, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   239
    @TADescription(annotation = "RTCs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE)
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   240
    @TADescription(annotation = "RTDs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   241
            genericLocation = {0, 0})
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   242
    public String arrayFieldRepeatableAnnotation() {
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   243
        return "@RTA @RTA Outer. @RTB @RTB Inner @RTC @RTC [] @RTD @RTD [] f;";
986d876a9121 8042451: Write tests for all possible kinds of type annotation
aeremeev
parents: 17578
diff changeset
   244
    }
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents:
diff changeset
   245
}