src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
author vromero
Wed, 10 Jan 2018 22:52:08 -0500
changeset 48513 5b834ec96236
parent 47216 71c04702a3d5
permissions -rw-r--r--
8187805: bogus RuntimeVisibleTypeAnnotations for unused local in a block Reviewed-by: sadayapalam
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     1
/*
48513
5b834ec96236 8187805: bogus RuntimeVisibleTypeAnnotations for unused local in a block
vromero
parents: 47216
diff changeset
     2
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     4
 *
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4873
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4873
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    10
 *
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    15
 * accompanied this code).
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    16
 *
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4873
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4873
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4873
diff changeset
    23
 * questions.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    24
 */
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    25
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    26
package com.sun.tools.javac.code;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    27
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    28
import java.util.Iterator;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    29
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
    30
import com.sun.tools.javac.tree.JCTree.JCLambda;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    31
import com.sun.tools.javac.util.*;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    32
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    33
/** A type annotation position.
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    34
*
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    35
*  <p><b>This is NOT part of any supported API.
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    36
*  If you write code that depends on this, you do so at your own risk.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    37
*  This code and its internal interfaces are subject to change or
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    38
*  deletion without notice.</b>
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    39
*/
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    40
// Code duplicated in com.sun.tools.classfile.TypeAnnotation.Position
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    41
public class TypeAnnotationPosition {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    42
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    43
    public enum TypePathEntryKind {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    44
        ARRAY(0),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    45
        INNER_TYPE(1),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    46
        WILDCARD(2),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    47
        TYPE_ARGUMENT(3);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    48
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    49
        public final int tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    50
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    51
        private TypePathEntryKind(int tag) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    52
            this.tag = tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    53
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    54
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    55
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    56
    public static class TypePathEntry {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    57
        /** The fixed number of bytes per TypePathEntry. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    58
        public static final int bytesPerEntry = 2;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    59
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    60
        public final TypePathEntryKind tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    61
        public final int arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    62
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    63
        public static final TypePathEntry ARRAY = new TypePathEntry(TypePathEntryKind.ARRAY);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    64
        public static final TypePathEntry INNER_TYPE = new TypePathEntry(TypePathEntryKind.INNER_TYPE);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    65
        public static final TypePathEntry WILDCARD = new TypePathEntry(TypePathEntryKind.WILDCARD);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    66
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    67
        private TypePathEntry(TypePathEntryKind tag) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    68
            Assert.check(tag == TypePathEntryKind.ARRAY ||
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    69
                    tag == TypePathEntryKind.INNER_TYPE ||
25848
3bc09f4676a9 8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks.
jlahoda
parents: 24895
diff changeset
    70
                    tag == TypePathEntryKind.WILDCARD);
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    71
            this.tag = tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    72
            this.arg = 0;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    73
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    74
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    75
        public TypePathEntry(TypePathEntryKind tag, int arg) {
25848
3bc09f4676a9 8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks.
jlahoda
parents: 24895
diff changeset
    76
            Assert.check(tag == TypePathEntryKind.TYPE_ARGUMENT);
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    77
            this.tag = tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    78
            this.arg = arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    79
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    80
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    81
        public static TypePathEntry fromBinary(int tag, int arg) {
25848
3bc09f4676a9 8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks.
jlahoda
parents: 24895
diff changeset
    82
            Assert.check(arg == 0 || tag == TypePathEntryKind.TYPE_ARGUMENT.tag);
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    83
            switch (tag) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    84
            case 0:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    85
                return ARRAY;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    86
            case 1:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    87
                return INNER_TYPE;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    88
            case 2:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    89
                return WILDCARD;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    90
            case 3:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    91
                return new TypePathEntry(TypePathEntryKind.TYPE_ARGUMENT, arg);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    92
            default:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    93
                Assert.error("Invalid TypePathEntryKind tag: " + tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    94
                return null;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    95
            }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    96
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    97
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    98
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    99
        public String toString() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   100
            return tag.toString() +
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   101
                    (tag == TypePathEntryKind.TYPE_ARGUMENT ? ("(" + arg + ")") : "");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   102
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   103
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   104
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   105
        public boolean equals(Object other) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   106
            if (! (other instanceof TypePathEntry)) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   107
                return false;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   108
            }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   109
            TypePathEntry tpe = (TypePathEntry) other;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   110
            return this.tag == tpe.tag && this.arg == tpe.arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   111
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   112
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   113
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   114
        public int hashCode() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   115
            return this.tag.hashCode() * 17 + this.arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   116
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   117
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   118
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   119
    public static final List<TypePathEntry> emptyPath = List.nil();
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   120
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   121
    public final TargetType type;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   122
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   123
    // For generic/array types.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   124
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   125
    public List<TypePathEntry> location;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   126
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   127
    // Tree position.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   128
    public final int pos;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   129
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   130
    // For type casts, type tests, new, locals (as start_pc),
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   131
    // and method and constructor reference type arguments.
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   132
    public boolean isValidOffset = false;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   133
    public int offset = -1;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   134
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   135
    // For locals. arrays same length
4866
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   136
    public int[] lvarOffset = null;
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   137
    public int[] lvarLength = null;
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   138
    public int[] lvarIndex = null;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   139
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   140
    // For type parameter bound
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   141
    public final int bound_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   142
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   143
    // For type parameter and method parameter
27545
9b19c6e31489 8029012: parameter_index for type annotation not updated after outer.this added
emc
parents: 26532
diff changeset
   144
    public int parameter_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   145
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   146
    // For class extends, implements, and throws clauses
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   147
    public final int type_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   148
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   149
    // For exception parameters, index into exception table.  In
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   150
    // com.sun.tools.javac.jvm.Gen.genCatch, we first use this to hold
38604
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   151
    // the catch type's constant pool entry index.  Then in
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   152
    // com.sun.tools.javac.jvm.Code.fillExceptionParameterPositions we
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   153
    // use that value to determine the exception table index.
38604
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   154
    // When read from class file, this holds
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   155
    private int exception_index = Integer.MIN_VALUE;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   156
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   157
    // If this type annotation is within a lambda expression,
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   158
    // store a pointer to the lambda expression tree in order
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   159
    // to allow a later translation to the right method.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   160
    public final JCLambda onLambda;
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   161
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   162
    // NOTE: This constructor will eventually go away, and be replaced
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   163
    // by static builder methods.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   164
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   165
    @Override
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   166
    public String toString() {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   167
        StringBuilder sb = new StringBuilder();
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   168
        sb.append('[');
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   169
        sb.append(type);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   170
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   171
        switch (type) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   172
        // instanceof
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   173
        case INSTANCEOF:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   174
        // new expression
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   175
        case NEW:
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   176
        // constructor/method reference receiver
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   177
        case CONSTRUCTOR_REFERENCE:
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   178
        case METHOD_REFERENCE:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   179
            sb.append(", offset = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   180
            sb.append(offset);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   181
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   182
        // local variable
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   183
        case LOCAL_VARIABLE:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   184
        // resource variable
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   185
        case RESOURCE_VARIABLE:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   186
            if (lvarOffset == null) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   187
                sb.append(", lvarOffset is null!");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   188
                break;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   189
            }
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   190
            sb.append(", {");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   191
            for (int i = 0; i < lvarOffset.length; ++i) {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   192
                if (i != 0) sb.append("; ");
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   193
                sb.append("start_pc = ");
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   194
                sb.append(lvarOffset[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   195
                sb.append(", length = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   196
                sb.append(lvarLength[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   197
                sb.append(", index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   198
                sb.append(lvarIndex[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   199
            }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   200
            sb.append("}");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   201
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   202
        // method receiver
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   203
        case METHOD_RECEIVER:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   204
            // Do nothing
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   205
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   206
        // type parameter
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   207
        case CLASS_TYPE_PARAMETER:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   208
        case METHOD_TYPE_PARAMETER:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   209
            sb.append(", param_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   210
            sb.append(parameter_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   211
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   212
        // type parameter bound
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   213
        case CLASS_TYPE_PARAMETER_BOUND:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   214
        case METHOD_TYPE_PARAMETER_BOUND:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   215
            sb.append(", param_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   216
            sb.append(parameter_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   217
            sb.append(", bound_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   218
            sb.append(bound_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   219
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   220
        // class extends or implements clause
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   221
        case CLASS_EXTENDS:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   222
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   223
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   224
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   225
        // throws
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   226
        case THROWS:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   227
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   228
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   229
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   230
        // exception parameter
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   231
        case EXCEPTION_PARAMETER:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   232
            sb.append(", exception_index = ");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   233
            sb.append(exception_index);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   234
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   235
        // method parameter
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   236
        case METHOD_FORMAL_PARAMETER:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   237
            sb.append(", param_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   238
            sb.append(parameter_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   239
            break;
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   240
        // type cast
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   241
        case CAST:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   242
        // method/constructor/reference type argument
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   243
        case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   244
        case METHOD_INVOCATION_TYPE_ARGUMENT:
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   245
        case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   246
        case METHOD_REFERENCE_TYPE_ARGUMENT:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   247
            sb.append(", offset = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   248
            sb.append(offset);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   249
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   250
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   251
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   252
        // We don't need to worry about these
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   253
        case METHOD_RETURN:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   254
        case FIELD:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   255
            break;
26532
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   256
        case UNKNOWN:
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   257
            sb.append(", position UNKNOWN!");
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   258
            break;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   259
        default:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   260
            Assert.error("Unknown target type: " + type);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   261
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   262
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   263
        // Append location data for generics/arrays.
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   264
        if (!location.isEmpty()) {
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   265
            sb.append(", location = (");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   266
            sb.append(location);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   267
            sb.append(")");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   268
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   269
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   270
        sb.append(", pos = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   271
        sb.append(pos);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   272
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   273
        if (onLambda != null) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   274
            sb.append(", onLambda hash = ");
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   275
            sb.append(onLambda.hashCode());
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   276
        }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   277
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   278
        sb.append(']');
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   279
        return sb.toString();
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   280
    }
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   281
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   282
    /**
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   283
     * Indicates whether the target tree of the annotation has been optimized
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   284
     * away from classfile or not.
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   285
     * @return true if the target has not been optimized away
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   286
     */
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   287
    public boolean emitToClassfile() {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   288
        return !type.isLocal() || isValidOffset;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   289
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   290
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   291
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   292
    public boolean matchesPos(int pos) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   293
        return this.pos == pos;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   294
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   295
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   296
    public void updatePosOffset(int to) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   297
        offset = to;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   298
        lvarOffset = new int[]{to};
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   299
        isValidOffset = true;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   300
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   301
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   302
    public boolean hasExceptionIndex() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   303
        return exception_index >= 0;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   304
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   305
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   306
    public int getExceptionIndex() {
38604
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   307
        Assert.check(exception_index >= 0, "exception_index is not set");
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   308
        return exception_index;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   309
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   310
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   311
    public void setExceptionIndex(final int exception_index) {
38604
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   312
        Assert.check(!hasExceptionIndex(), "exception_index already set");
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   313
        Assert.check(exception_index >= 0, "Expected a valid index into exception table");
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   314
        this.exception_index = exception_index;
48513
5b834ec96236 8187805: bogus RuntimeVisibleTypeAnnotations for unused local in a block
vromero
parents: 47216
diff changeset
   315
        this.isValidOffset = true;
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   316
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   317
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   318
    public boolean hasCatchType() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   319
        return exception_index < 0 && exception_index != Integer.MIN_VALUE;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   320
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   321
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   322
    public int getCatchType() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   323
        Assert.check(hasCatchType(),
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   324
                     "exception_index does not contain valid catch info");
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   325
        return ((-this.exception_index) - 1) & 0xff ;
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   326
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   327
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   328
    public int getStartPos() {
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   329
        Assert.check(hasCatchType(),
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   330
                     "exception_index does not contain valid catch info");
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   331
        return ((-this.exception_index) - 1) >> 8 ;
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   332
    }
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   333
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   334
    public void setCatchInfo(final int catchType, final int startPos) {
38604
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   335
        Assert.check(!hasExceptionIndex(),
b65bfa841446 8047024: 7 ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index
sadayapalam
parents: 31751
diff changeset
   336
                     "exception_index is already set");
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   337
        Assert.check(catchType >= 0, "Expected a valid catch type");
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   338
        this.exception_index = -((catchType | startPos << 8) + 1);
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   339
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   340
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   341
    /**
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   342
     * Decode the binary representation for a type path and set
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   343
     * the {@code location} field.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   344
     *
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   345
     * @param list The bytecode representation of the type path.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   346
     */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   347
    public static List<TypePathEntry> getTypePathFromBinary(java.util.List<Integer> list) {
20249
93f8eae31092 6386236: Please rename com.sun.tools.javac.util.ListBuffer.lb()
alundblad
parents: 17578
diff changeset
   348
        ListBuffer<TypePathEntry> loc = new ListBuffer<>();
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   349
        Iterator<Integer> iter = list.iterator();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   350
        while (iter.hasNext()) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   351
            Integer fst = iter.next();
25848
3bc09f4676a9 8043643: Add an crules analyzer avoiding string concatenation in messages of Assert checks.
jlahoda
parents: 24895
diff changeset
   352
            Assert.check(iter.hasNext());
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   353
            Integer snd = iter.next();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   354
            loc = loc.append(TypePathEntry.fromBinary(fst, snd));
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   355
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   356
        return loc.toList();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   357
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   358
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   359
    public static List<Integer> getBinaryFromTypePath(java.util.List<TypePathEntry> locs) {
20249
93f8eae31092 6386236: Please rename com.sun.tools.javac.util.ListBuffer.lb()
alundblad
parents: 17578
diff changeset
   360
        ListBuffer<Integer> loc = new ListBuffer<>();
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   361
        for (TypePathEntry tpe : locs) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   362
            loc = loc.append(tpe.tag.tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   363
            loc = loc.append(tpe.arg);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   364
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   365
        return loc.toList();
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   366
    }
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   367
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   368
    // These methods are the new preferred way to create
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   369
    // TypeAnnotationPositions
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   370
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   371
    // Never make this a public constructor without creating a builder.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   372
    private TypeAnnotationPosition(final TargetType ttype,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   373
                                   final int pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   374
                                   final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   375
                                   final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   376
                                   final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   377
                                   final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   378
                                   final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   379
        Assert.checkNonNull(location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   380
        this.type = ttype;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   381
        this.pos = pos;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   382
        this.parameter_index = parameter_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   383
        this.onLambda = onLambda;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   384
        this.type_index = type_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   385
        this.bound_index = bound_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   386
        this.location = location;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   387
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   388
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   389
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   390
     * Create a {@code TypeAnnotationPosition} for a method return.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   391
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   392
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   393
     * @param onLambda The lambda for this parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   394
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   395
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   396
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   397
        methodReturn(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   398
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   399
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   400
        return new TypeAnnotationPosition(TargetType.METHOD_RETURN, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   401
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   402
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   403
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   404
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   405
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   406
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   407
     * Create a {@code TypeAnnotationPosition} for a method return.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   408
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   409
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   410
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   411
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   412
        methodReturn(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   413
        return methodReturn(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   414
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   415
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   416
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   417
     * Create a {@code TypeAnnotationPosition} for a method return.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   418
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   419
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   420
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   421
    public static TypeAnnotationPosition methodReturn(final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   422
        return methodReturn(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   423
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   424
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   425
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   426
     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   427
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   428
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   429
     * @param onLambda The lambda for this parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   430
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   431
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   432
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   433
        methodReceiver(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   434
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   435
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   436
        return new TypeAnnotationPosition(TargetType.METHOD_RECEIVER, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   437
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   438
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   439
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   440
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   441
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   442
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   443
     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   444
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   445
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   446
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   447
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   448
        methodReceiver(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   449
        return methodReceiver(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   450
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   451
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   452
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   453
     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   454
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   455
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   456
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   457
    public static TypeAnnotationPosition methodReceiver(final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   458
        return methodReceiver(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   459
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   460
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   461
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   462
     * Create a {@code TypeAnnotationPosition} for a method formal parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   463
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   464
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   465
     * @param onLambda The lambda for this parameter.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
   466
     * @param parameter_index The index of the parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   467
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   468
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   469
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   470
        methodParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   471
                        final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   472
                        final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   473
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   474
        return new TypeAnnotationPosition(TargetType.METHOD_FORMAL_PARAMETER,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   475
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   476
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   477
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   478
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   479
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   480
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   481
     * Create a {@code TypeAnnotationPosition} for a method formal parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   482
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   483
     * @param onLambda The lambda for this parameter.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
   484
     * @param parameter_index The index of the parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   485
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   486
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   487
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   488
        methodParameter(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   489
                        final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   490
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   491
        return methodParameter(emptyPath, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   492
                               parameter_index, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   493
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   494
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   495
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   496
     * Create a {@code TypeAnnotationPosition} for a method formal parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   497
     *
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
   498
     * @param parameter_index The index of the parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   499
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   500
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   501
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   502
        methodParameter(final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   503
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   504
        return methodParameter(null, parameter_index, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   505
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   506
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   507
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   508
     * Create a {@code TypeAnnotationPosition} for a method formal parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   509
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   510
     * @param location The type path.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
   511
     * @param parameter_index The index of the parameter.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   512
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   513
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   514
        methodParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   515
                        final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   516
        return methodParameter(location, null, parameter_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   517
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   518
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   519
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   520
     * Create a {@code TypeAnnotationPosition} for a method reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   521
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   522
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   523
     * @param onLambda The lambda for this method reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   524
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   525
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   526
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   527
        methodRef(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   528
                  final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   529
                  final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   530
        return new TypeAnnotationPosition(TargetType.METHOD_REFERENCE, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   531
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   532
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   533
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   534
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   535
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   536
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   537
     * Create a {@code TypeAnnotationPosition} for a method reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   538
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   539
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   540
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   541
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   542
        methodRef(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   543
        return methodRef(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   544
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   545
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   546
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   547
     * Create a {@code TypeAnnotationPosition} for a constructor reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   548
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   549
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   550
     * @param onLambda The lambda for this constructor reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   551
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   552
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   553
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   554
        constructorRef(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   555
                       final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   556
                       final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   557
        return new TypeAnnotationPosition(TargetType.CONSTRUCTOR_REFERENCE, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   558
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   559
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   560
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   561
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   562
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   563
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   564
     * Create a {@code TypeAnnotationPosition} for a constructor reference.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   565
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   566
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   567
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   568
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   569
        constructorRef(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   570
        return constructorRef(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   571
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   572
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   573
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   574
     * Create a {@code TypeAnnotationPosition} for a field.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   575
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   576
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   577
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   578
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   579
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   580
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   581
        field(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   582
              final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   583
              final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   584
        return new TypeAnnotationPosition(TargetType.FIELD, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   585
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   586
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   587
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   588
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   589
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   590
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   591
     * Create a {@code TypeAnnotationPosition} for a field.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   592
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   593
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   594
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   595
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   596
        field(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   597
        return field(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   598
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   599
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   600
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   601
     * Create a {@code TypeAnnotationPosition} for a field.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   602
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   603
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   604
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   605
    public static TypeAnnotationPosition field(final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   606
        return field(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   607
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   608
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   609
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   610
     * Create a {@code TypeAnnotationPosition} for a local variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   611
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   612
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   613
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   614
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   615
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   616
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   617
        localVariable(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   618
                      final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   619
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   620
        return new TypeAnnotationPosition(TargetType.LOCAL_VARIABLE, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   621
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   622
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   623
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   624
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   625
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   626
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   627
     * Create a {@code TypeAnnotationPosition} for a local variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   628
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   629
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   630
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   631
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   632
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   633
        localVariable(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   634
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   635
        return localVariable(emptyPath, onLambda, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   636
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   637
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   638
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   639
     * Create a {@code TypeAnnotationPosition} for a local variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   640
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   641
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   642
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   643
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   644
        localVariable(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   645
        return localVariable(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   646
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   647
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   648
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   649
     * Create a {@code TypeAnnotationPosition} for an exception parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   650
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   651
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   652
     * @param onLambda The lambda for this parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   653
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   654
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   655
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   656
        exceptionParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   657
                           final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   658
                           final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   659
        return new TypeAnnotationPosition(TargetType.EXCEPTION_PARAMETER, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   660
                                          Integer.MIN_VALUE, onLambda,
26532
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   661
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   662
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   663
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   664
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   665
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   666
     * Create a {@code TypeAnnotationPosition} for an exception parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   667
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   668
     * @param onLambda The lambda for this parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   669
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   670
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   671
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   672
        exceptionParameter(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   673
                           final int pos) {
26532
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   674
        return exceptionParameter(emptyPath, onLambda, pos);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   675
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   676
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   677
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   678
     * Create a {@code TypeAnnotationPosition} for an exception parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   679
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   680
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   681
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   682
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   683
        exceptionParameter(final List<TypePathEntry> location) {
26532
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
   684
        return exceptionParameter(location, null, -1);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   685
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   686
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   687
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   688
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   689
     * Create a {@code TypeAnnotationPosition} for a resource variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   690
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   691
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   692
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   693
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   694
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   695
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   696
        resourceVariable(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   697
                         final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   698
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   699
        return new TypeAnnotationPosition(TargetType.RESOURCE_VARIABLE, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   700
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   701
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   702
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   703
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   704
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   705
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   706
     * Create a {@code TypeAnnotationPosition} for a resource variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   707
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   708
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   709
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   710
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   711
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   712
        resourceVariable(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   713
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   714
        return resourceVariable(emptyPath, onLambda, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   715
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   716
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   717
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   718
     * Create a {@code TypeAnnotationPosition} for a resource variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   719
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   720
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   721
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   722
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   723
        resourceVariable(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   724
        return resourceVariable(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   725
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   726
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   727
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   728
     * Create a {@code TypeAnnotationPosition} for a new.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   729
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   730
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   731
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   732
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   733
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   734
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   735
        newObj(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   736
               final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   737
               final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   738
        return new TypeAnnotationPosition(TargetType.NEW, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   739
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   740
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   741
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   742
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   743
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   744
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   745
     * Create a {@code TypeAnnotationPosition} for a new.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   746
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   747
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   748
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   749
    public static TypeAnnotationPosition newObj(final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   750
        return newObj(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   751
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   752
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   753
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   754
     * Create a {@code TypeAnnotationPosition} for a new.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   755
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   756
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   757
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   758
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   759
        newObj(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   760
        return newObj(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   761
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   762
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   763
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   764
     * Create a {@code TypeAnnotationPosition} for a class extension.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   765
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   766
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   767
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   768
     * @param type_index The index of the interface.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   769
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   770
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   771
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   772
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   773
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   774
                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   775
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   776
        return new TypeAnnotationPosition(TargetType.CLASS_EXTENDS, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   777
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   778
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   779
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   780
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   781
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   782
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   783
     * Create a {@code TypeAnnotationPosition} for a class extension.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   784
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   785
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   786
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   787
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   788
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   789
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   790
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   791
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   792
                     final int pos) {
41165
4b05dadfb69d 8164519: Rendering of supertype_target for annotated extends clause
sadayapalam
parents: 38604
diff changeset
   793
        return classExtends(location, onLambda, 65535, pos);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   794
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   795
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   796
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   797
     * Create a {@code TypeAnnotationPosition} for a class extension.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   798
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   799
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   800
     * @param type_index The index of the interface.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   801
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   802
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   803
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   804
                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   805
        return classExtends(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   806
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   807
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   808
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   809
     * Create a {@code TypeAnnotationPosition} for a class extension.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   810
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   811
     * @param type_index The index of the interface.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   812
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   813
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   814
    public static TypeAnnotationPosition classExtends(final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   815
                                                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   816
        return classExtends(emptyPath, null, type_index, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   817
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   818
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   819
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   820
     * Create a {@code TypeAnnotationPosition} for a class extension.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   821
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   822
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   823
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   824
    public static TypeAnnotationPosition classExtends(final int pos) {
41165
4b05dadfb69d 8164519: Rendering of supertype_target for annotated extends clause
sadayapalam
parents: 38604
diff changeset
   825
        return classExtends(65535, pos);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   826
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   827
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   828
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   829
     * Create a {@code TypeAnnotationPosition} for an instanceof.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   830
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   831
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   832
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   833
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   834
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   835
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   836
        instanceOf(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   837
                   final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   838
                   final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   839
        return new TypeAnnotationPosition(TargetType.INSTANCEOF, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   840
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   841
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   842
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   843
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   844
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   845
     * Create a {@code TypeAnnotationPosition} for an instanceof.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   846
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   847
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   848
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   849
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   850
        instanceOf(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   851
        return instanceOf(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   852
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   853
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   854
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   855
     * Create a {@code TypeAnnotationPosition} for a type cast.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   856
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   857
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   858
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   859
     * @param type_index The index into an intersection type.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   860
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   861
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   862
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   863
        typeCast(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   864
                 final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   865
                 final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   866
                 final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   867
        return new TypeAnnotationPosition(TargetType.CAST, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   868
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   869
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   870
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   871
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   872
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   873
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   874
     * Create a {@code TypeAnnotationPosition} for a type cast.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   875
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   876
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   877
     * @param type_index The index into an intersection type.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   878
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   879
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   880
        typeCast(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   881
                 final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   882
        return typeCast(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   883
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   884
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   885
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   886
     * Create a {@code TypeAnnotationPosition} for a method
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   887
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   888
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   889
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   890
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   891
     * @param type_index The index of the type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   892
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   893
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   894
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   895
        methodInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   896
                                final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   897
                                final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   898
                                final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   899
        return new TypeAnnotationPosition(TargetType.METHOD_INVOCATION_TYPE_ARGUMENT,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   900
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   901
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   902
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   903
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   904
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   905
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   906
     * Create a {@code TypeAnnotationPosition} for a method
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   907
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   908
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   909
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   910
     * @param type_index The index of the type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   911
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   912
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   913
        methodInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   914
                                final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   915
        return methodInvocationTypeArg(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   916
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   917
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   918
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   919
     * Create a {@code TypeAnnotationPosition} for a constructor
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   920
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   921
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   922
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   923
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   924
     * @param type_index The index of the type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   925
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   926
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   927
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   928
        constructorInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   929
                                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   930
                                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   931
                                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   932
        return new TypeAnnotationPosition(TargetType.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   933
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   934
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   935
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   936
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   937
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   938
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   939
     * Create a {@code TypeAnnotationPosition} for a constructor
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   940
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   941
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   942
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   943
     * @param type_index The index of the type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   944
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   945
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   946
        constructorInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   947
                                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   948
        return constructorInvocationTypeArg(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   949
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   950
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   951
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   952
     * Create a {@code TypeAnnotationPosition} for a type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   953
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   954
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   955
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   956
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   957
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   958
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   959
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   960
        typeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   961
                      final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   962
                      final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   963
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   964
        return new TypeAnnotationPosition(TargetType.CLASS_TYPE_PARAMETER, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   965
                                          parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   966
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   967
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   968
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   969
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   970
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   971
     * Create a {@code TypeAnnotationPosition} for a type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   972
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   973
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   974
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   975
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   976
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   977
        typeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   978
                      final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   979
        return typeParameter(location, null, parameter_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   980
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   981
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   982
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   983
     * Create a {@code TypeAnnotationPosition} for a method type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   984
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   985
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   986
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   987
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   988
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   989
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   990
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   991
        methodTypeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   992
                            final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   993
                            final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   994
                            final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   995
        return new TypeAnnotationPosition(TargetType.METHOD_TYPE_PARAMETER,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   996
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   997
                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   998
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   999
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1000
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1001
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1002
     * Create a {@code TypeAnnotationPosition} for a method type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1003
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1004
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1005
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1006
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1007
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1008
        methodTypeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1009
                            final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1010
        return methodTypeParameter(location, null, parameter_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1011
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1012
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1013
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1014
     * Create a {@code TypeAnnotationPosition} for a throws clause.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1015
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1016
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1017
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1018
     * @param type_index The index of the exception.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1019
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1020
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1021
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1022
        methodThrows(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1023
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1024
                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1025
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1026
        return new TypeAnnotationPosition(TargetType.THROWS, pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1027
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1028
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1029
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1030
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1031
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1032
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1033
     * Create a {@code TypeAnnotationPosition} for a throws clause.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1034
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1035
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1036
     * @param type_index The index of the exception.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1037
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1038
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1039
        methodThrows(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1040
                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1041
        return methodThrows(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1042
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1043
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1044
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1045
     * Create a {@code TypeAnnotationPosition} for a method reference
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1046
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1047
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1048
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1049
     * @param onLambda The lambda for this variable.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
  1050
     * @param type_index The index of the type argument.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1051
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1052
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1053
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1054
        methodRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1055
                         final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1056
                         final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1057
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1058
        return new TypeAnnotationPosition(TargetType.METHOD_REFERENCE_TYPE_ARGUMENT,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1059
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1060
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1061
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1062
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1063
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1064
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1065
     * Create a {@code TypeAnnotationPosition} for a method reference
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1066
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1067
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1068
     * @param location The type path.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
  1069
     * @param type_index The index of the type argument.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1070
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1071
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1072
        methodRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1073
                         final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1074
        return methodRefTypeArg(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1075
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1076
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1077
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1078
     * Create a {@code TypeAnnotationPosition} for a constructor reference
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1079
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1080
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1081
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1082
     * @param onLambda The lambda for this variable.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
  1083
     * @param type_index The index of the type argument.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1084
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1085
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1086
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1087
        constructorRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1088
                              final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1089
                              final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1090
                              final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1091
        return new TypeAnnotationPosition(TargetType.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1092
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1093
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1094
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1095
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1096
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1097
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1098
     * Create a {@code TypeAnnotationPosition} for a constructor reference
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1099
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1100
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1101
     * @param location The type path.
31751
ec251536a004 8080880: some docs cleanup for langtools
avstepan
parents: 29842
diff changeset
  1102
     * @param type_index The index of the type argument.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1103
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1104
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1105
        constructorRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1106
                              final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1107
        return constructorRefTypeArg(location, null, type_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1108
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1109
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1110
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1111
     * Create a {@code TypeAnnotationPosition} for a type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1112
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1113
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1114
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1115
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1116
     * @param bound_index The index of the type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1117
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1118
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1119
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1120
        typeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1121
                           final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1122
                           final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1123
                           final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1124
                           final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1125
        return new TypeAnnotationPosition(TargetType.CLASS_TYPE_PARAMETER_BOUND,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1126
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1127
                                          Integer.MIN_VALUE, bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1128
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1129
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1130
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1131
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1132
     * Create a {@code TypeAnnotationPosition} for a type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1133
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1134
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1135
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1136
     * @param bound_index The index of the type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1137
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1138
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1139
        typeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1140
                           final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1141
                           final int bound_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1142
        return typeParameterBound(location, null, parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1143
                                  bound_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1144
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1145
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1146
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1147
     * Create a {@code TypeAnnotationPosition} for a method type
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1148
     * parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1149
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1150
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1151
     * @param onLambda The lambda for this variable.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1152
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1153
     * @param bound_index The index of the type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1154
     * @param pos The position from the associated tree node.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1155
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1156
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1157
        methodTypeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1158
                                 final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1159
                                 final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1160
                                 final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1161
                                 final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1162
        return new TypeAnnotationPosition(TargetType.METHOD_TYPE_PARAMETER_BOUND,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1163
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1164
                                          Integer.MIN_VALUE, bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1165
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1166
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1167
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1168
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1169
     * Create a {@code TypeAnnotationPosition} for a method type
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1170
     * parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1171
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1172
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1173
     * @param parameter_index The index of the type parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1174
     * @param bound_index The index of the type parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1175
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1176
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1177
        methodTypeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1178
                                 final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1179
                                 final int bound_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1180
        return methodTypeParameterBound(location, null, parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1181
                                        bound_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1182
    }
26532
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1183
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1184
    // Consider this deprecated on arrival.  We eventually want to get
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1185
    // rid of this value altogether.  Do not use it for anything new.
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1186
    public static final TypeAnnotationPosition unknown =
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1187
        new TypeAnnotationPosition(TargetType.UNKNOWN, -1,
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1188
                                   Integer.MIN_VALUE, null,
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1189
                                   Integer.MIN_VALUE, Integer.MIN_VALUE,
aa84b6606229 8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents: 25874
diff changeset
  1190
                                   emptyPath);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
  1191
}