langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
author emc
Fri, 06 Jun 2014 16:00:59 -0400
changeset 24895 dd091d389fbf
parent 24396 3c36c6afcbca
child 25848 3bc09f4676a9
permissions -rw-r--r--
8027262: Determine location for type annotations earlier in compiler pipeline 8027261: Single codepath for attaching annotations to symbols 8027258: Permit a single source annotation to generate multiple bytecode annotations 8027182: Incorrect annotation attributes for type annotations on constructor type parameters 8044010: TypeAnnotation attribute is not generated for repeatable annotation in type argument 8044009: TypeAnnotation attribute is not generated for repeatable annotation in nested types 8043974: TypeAnnotation attribute is not generated for repeatable annotation in lambda 8043669: Few of the ANNOT tests in JCK9 test suite fail with an AssertionError for exception_index 8042060: Type parameter annotations don't work with multiple type parameters 8037348: RuntimeInvisibleAnnotations should not be generated for type annotation on anonymous innerclass creation Summary: Initial rearchitecting of type annotations frontend pipeline Reviewed-by: jjg, jfranck, mcimadamore, jlahoda, wmdietl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
     1
/*
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
     2
 * Copyright (c) 2003, 2013, 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 ||
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    70
                    tag == TypePathEntryKind.WILDCARD,
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    71
                    "Invalid TypePathEntryKind: " + tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    72
            this.tag = tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    73
            this.arg = 0;
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
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    76
        public TypePathEntry(TypePathEntryKind tag, int arg) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    77
            Assert.check(tag == TypePathEntryKind.TYPE_ARGUMENT,
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    78
                    "Invalid TypePathEntryKind: " + tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    79
            this.tag = tag;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    80
            this.arg = arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    81
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    82
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    83
        public static TypePathEntry fromBinary(int tag, int arg) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    84
            Assert.check(arg == 0 || tag == TypePathEntryKind.TYPE_ARGUMENT.tag,
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    85
                    "Invalid TypePathEntry tag/arg: " + tag + "/" + arg);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    86
            switch (tag) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    87
            case 0:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    88
                return ARRAY;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    89
            case 1:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    90
                return INNER_TYPE;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    91
            case 2:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    92
                return WILDCARD;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    93
            case 3:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    94
                return new TypePathEntry(TypePathEntryKind.TYPE_ARGUMENT, arg);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    95
            default:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    96
                Assert.error("Invalid TypePathEntryKind tag: " + tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    97
                return null;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    98
            }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
    99
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   100
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   101
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   102
        public String toString() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   103
            return tag.toString() +
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   104
                    (tag == TypePathEntryKind.TYPE_ARGUMENT ? ("(" + arg + ")") : "");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   105
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   106
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   107
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   108
        public boolean equals(Object other) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   109
            if (! (other instanceof TypePathEntry)) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   110
                return false;
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
            TypePathEntry tpe = (TypePathEntry) other;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   113
            return this.tag == tpe.tag && this.arg == tpe.arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   114
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   115
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   116
        @Override
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   117
        public int hashCode() {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   118
            return this.tag.hashCode() * 17 + this.arg;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   119
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   120
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   121
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   122
    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
   123
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   124
    // NOTE: All of these will be converted to final fields eventually.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   125
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   126
    public final TargetType type;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   127
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   128
    // For generic/array types.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   129
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   130
    // This field is in the process of being made final.  Do not
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   131
    // introduce new mutations.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   132
    public List<TypePathEntry> location;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   133
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   134
    // Tree position.
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   135
    public final int pos;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   136
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   137
    // For type casts, type tests, new, locals (as start_pc),
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   138
    // 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
   139
    public boolean isValidOffset = false;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   140
    public int offset = -1;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   141
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   142
    // For locals. arrays same length
4866
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   143
    public int[] lvarOffset = null;
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   144
    public int[] lvarLength = null;
21f0ac9e5a20 6918127: improve handling of TypeAnnotationPosition fields
jjg
parents: 3300
diff changeset
   145
    public int[] lvarIndex = null;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   146
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   147
    // For type parameter bound
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   148
    public final int bound_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   149
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   150
    // For type parameter and method parameter
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   151
    public final int parameter_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   152
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   153
    // 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
   154
    public final int type_index;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   155
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   156
    // 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
   157
    // com.sun.tools.javac.jvm.Gen.genCatch, we first use this to hold
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   158
    // the catch type index.  Then in
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   159
    // 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
   160
    // use that value to determine the exception table index.
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   161
    private int exception_index = Integer.MIN_VALUE;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   162
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   163
    // If this type annotation is within a lambda expression,
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   164
    // store a pointer to the lambda expression tree in order
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   165
    // 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
   166
    public final JCLambda onLambda;
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   167
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   168
    // 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
   169
    // by static builder methods.
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   170
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   171
    @Override
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   172
    public String toString() {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   173
        StringBuilder sb = new StringBuilder();
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   174
        sb.append('[');
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   175
        sb.append(type);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   176
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   177
        switch (type) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   178
        // instanceof
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   179
        case INSTANCEOF:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   180
        // new expression
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   181
        case NEW:
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   182
        // constructor/method reference receiver
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   183
        case CONSTRUCTOR_REFERENCE:
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   184
        case METHOD_REFERENCE:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   185
            sb.append(", offset = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   186
            sb.append(offset);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   187
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   188
        // local variable
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   189
        case LOCAL_VARIABLE:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   190
        // resource variable
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   191
        case RESOURCE_VARIABLE:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   192
            if (lvarOffset == null) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   193
                sb.append(", lvarOffset is null!");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   194
                break;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   195
            }
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   196
            sb.append(", {");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   197
            for (int i = 0; i < lvarOffset.length; ++i) {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   198
                if (i != 0) sb.append("; ");
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   199
                sb.append("start_pc = ");
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   200
                sb.append(lvarOffset[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   201
                sb.append(", length = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   202
                sb.append(lvarLength[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   203
                sb.append(", index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   204
                sb.append(lvarIndex[i]);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   205
            }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   206
            sb.append("}");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   207
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   208
        // method receiver
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   209
        case METHOD_RECEIVER:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   210
            // Do nothing
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
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   213
        case CLASS_TYPE_PARAMETER:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   214
        case METHOD_TYPE_PARAMETER:
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
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   218
        // type parameter bound
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   219
        case CLASS_TYPE_PARAMETER_BOUND:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   220
        case METHOD_TYPE_PARAMETER_BOUND:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   221
            sb.append(", param_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   222
            sb.append(parameter_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   223
            sb.append(", bound_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   224
            sb.append(bound_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   225
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   226
        // class extends or implements clause
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   227
        case CLASS_EXTENDS:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   228
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   229
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   230
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   231
        // throws
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   232
        case THROWS:
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   233
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   234
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   235
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   236
        // exception parameter
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   237
        case EXCEPTION_PARAMETER:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   238
            sb.append(", exception_index = ");
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   239
            sb.append(exception_index);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   240
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   241
        // method parameter
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   242
        case METHOD_FORMAL_PARAMETER:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   243
            sb.append(", param_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   244
            sb.append(parameter_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   245
            break;
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   246
        // type cast
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   247
        case CAST:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   248
        // method/constructor/reference type argument
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   249
        case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   250
        case METHOD_INVOCATION_TYPE_ARGUMENT:
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   251
        case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   252
        case METHOD_REFERENCE_TYPE_ARGUMENT:
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   253
            sb.append(", offset = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   254
            sb.append(offset);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   255
            sb.append(", type_index = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   256
            sb.append(type_index);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   257
            break;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   258
        // We don't need to worry about these
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   259
        case METHOD_RETURN:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   260
        case FIELD:
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   261
            break;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   262
        default:
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   263
            Assert.error("Unknown target type: " + type);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   264
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   265
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   266
        // Append location data for generics/arrays.
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   267
        if (!location.isEmpty()) {
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   268
            sb.append(", location = (");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   269
            sb.append(location);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   270
            sb.append(")");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   271
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   272
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   273
        sb.append(", pos = ");
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   274
        sb.append(pos);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   275
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   276
        if (onLambda != null) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   277
            sb.append(", onLambda hash = ");
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   278
            sb.append(onLambda.hashCode());
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   279
        }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   280
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   281
        sb.append(']');
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   282
        return sb.toString();
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   283
    }
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   284
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   285
    /**
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   286
     * 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
   287
     * away from classfile or not.
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   288
     * @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
   289
     */
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   290
    public boolean emitToClassfile() {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   291
        return !type.isLocal() || isValidOffset;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   292
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   293
17578
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
    public boolean matchesPos(int pos) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   296
        return this.pos == pos;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   297
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   298
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   299
    public void updatePosOffset(int to) {
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   300
        offset = to;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   301
        lvarOffset = new int[]{to};
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   302
        isValidOffset = true;
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   303
    }
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15718
diff changeset
   304
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   305
    public boolean hasExceptionIndex() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   306
        return exception_index >= 0;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   307
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   308
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   309
    public int getExceptionIndex() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   310
        Assert.check(exception_index >= 0, "exception_index does not contain a bytecode offset");
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   311
        return exception_index;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   312
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   313
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   314
    public void setExceptionIndex(final int exception_index) {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   315
        Assert.check(hasCatchType(), "exception_index already contains a bytecode offset");
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   316
        Assert.check(exception_index >= 0, "Expected a valid bytecode offset");
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   317
        this.exception_index = exception_index;
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   318
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   319
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   320
    public boolean hasCatchType() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   321
        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
   322
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   323
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   324
    public int getCatchType() {
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   325
        Assert.check(hasCatchType(),
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   326
                     "exception_index does not contain valid catch info");
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   327
        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
   328
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   329
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   330
    public int getStartPos() {
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   331
        Assert.check(hasCatchType(),
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   332
                     "exception_index does not contain valid catch info");
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   333
        return ((-this.exception_index) - 1) >> 8 ;
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   334
    }
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   335
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   336
    public void setCatchInfo(final int catchType, final int startPos) {
23975
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   337
        Assert.check(this.exception_index < 0,
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   338
                     "exception_index already contains a bytecode index");
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   339
        Assert.check(catchType >= 0, "Expected a valid catch type");
24396
3c36c6afcbca 8040327: Eliminate AnnotatedType
emc
parents: 23975
diff changeset
   340
        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
   341
    }
c7c81595aea9 8040319: Clean up type annotation exception index generating code in Code.java
emc
parents: 22702
diff changeset
   342
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   343
    /**
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   344
     * Decode the binary representation for a type path and set
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   345
     * the {@code location} field.
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
     * @param list The bytecode representation of the type path.
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   348
     */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   349
    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
   350
        ListBuffer<TypePathEntry> loc = new ListBuffer<>();
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   351
        Iterator<Integer> iter = list.iterator();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   352
        while (iter.hasNext()) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   353
            Integer fst = iter.next();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   354
            Assert.check(iter.hasNext(), "Could not decode type path: " + list);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   355
            Integer snd = iter.next();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   356
            loc = loc.append(TypePathEntry.fromBinary(fst, snd));
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
        return loc.toList();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   359
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   360
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   361
    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
   362
        ListBuffer<Integer> loc = new ListBuffer<>();
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   363
        for (TypePathEntry tpe : locs) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   364
            loc = loc.append(tpe.tag.tag);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   365
            loc = loc.append(tpe.arg);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   366
        }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 7681
diff changeset
   367
        return loc.toList();
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   368
    }
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   369
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   370
    // 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
   371
    // TypeAnnotationPositions
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   372
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   373
    // 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
   374
    private TypeAnnotationPosition(final TargetType ttype,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   375
                                   final int pos,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   376
                                   final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   377
                                   final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   378
                                   final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   379
                                   final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   380
                                   final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   381
        Assert.checkNonNull(location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   382
        this.type = ttype;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   383
        this.pos = pos;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   384
        this.parameter_index = parameter_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   385
        this.onLambda = onLambda;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   386
        this.type_index = type_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   387
        this.bound_index = bound_index;
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   388
        this.location = location;
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
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
     * 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
   393
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   394
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   395
     * @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
   396
     * @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
   397
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   398
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   399
        methodReturn(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   400
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   401
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   402
        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
   403
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   404
                                          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
   405
                                          location);
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
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
     * 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
   410
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   411
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   412
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   413
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   414
        methodReturn(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   415
        return methodReturn(location, null, -1);
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
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
     * 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
   420
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   421
     * @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
   422
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   423
    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
   424
        return methodReturn(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   425
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   426
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   427
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   428
     * 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
   429
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   430
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   431
     * @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
   432
     * @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
   433
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   434
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   435
        methodReceiver(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   436
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   437
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   438
        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
   439
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   440
                                          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
   441
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   442
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   443
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   444
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   445
     * 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
   446
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   447
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   448
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   449
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   450
        methodReceiver(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   451
        return methodReceiver(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   452
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   453
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   454
    /**
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   455
     * 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
   456
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   457
     * @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
   458
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   459
    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
   460
        return methodReceiver(emptyPath, null, pos);
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
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
     * 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
   465
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   466
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   467
     * @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
   468
     * @param index The index of the parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   469
     * @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
   470
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   471
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   472
        methodParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   473
                        final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   474
                        final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   475
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   476
        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
   477
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   478
                                          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
   479
                                          location);
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
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
     * 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
   484
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   485
     * @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
   486
     * @param index The index of the parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   487
     * @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
   488
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   489
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   490
        methodParameter(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   491
                        final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   492
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   493
        return methodParameter(emptyPath, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   494
                               parameter_index, pos);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   497
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   498
     * 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
   499
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   500
     * @param index The index of the parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   501
     * @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
   502
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   503
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   504
        methodParameter(final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   505
                        final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   506
        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
   507
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   508
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
     * 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
   511
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   512
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   513
     * @param index The index of the parameter.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   514
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   515
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   516
        methodParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   517
                        final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   518
        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
   519
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   520
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
     * 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
   523
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   524
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   525
     * @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
   526
     * @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
   527
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   528
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   529
        methodRef(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   530
                  final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   531
                  final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   532
        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
   533
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   534
                                          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
   535
                                          location);
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
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
     * 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
   540
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   541
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   542
     * @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
   543
     * @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
   544
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   545
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   546
        methodRef(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   547
        return methodRef(location, null, -1);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   550
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   551
     * 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
   552
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   553
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   554
     * @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
   555
     * @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
   556
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   557
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   558
        constructorRef(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   559
                       final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   560
                       final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   561
        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
   562
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   563
                                          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
   564
                                          location);
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
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
     * 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
   569
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   570
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   571
     * @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
   572
     * @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
   573
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   574
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   575
        constructorRef(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   576
        return constructorRef(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   577
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   578
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
     * 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
   581
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   582
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   583
     * @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
   584
     * @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
   585
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   586
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   587
        field(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   588
              final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   589
              final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   590
        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
   591
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   592
                                          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
   593
                                          location);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   596
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   597
     * 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
   598
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   599
     * @param location The type path.
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
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   602
        field(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   603
        return field(location, null, -1);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   606
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   607
     * 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
   608
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   609
     * @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
   610
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   611
    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
   612
        return field(emptyPath, null, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   613
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   614
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
     * 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
   617
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   618
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   619
     * @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
   620
     * @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
   621
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   622
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   623
        localVariable(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   624
                      final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   625
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   626
        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
   627
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   628
                                          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
   629
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   630
    }
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   633
     * 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
   634
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   635
     * @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
   636
     * @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
   637
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   638
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   639
        localVariable(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   640
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   641
        return localVariable(emptyPath, onLambda, pos);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   644
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   645
     * 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
   646
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   647
     * @param location The type path.
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
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   650
        localVariable(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   651
        return localVariable(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   652
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   653
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
     * 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
   656
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   657
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   658
     * @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
   659
     * @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
   660
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   661
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   662
        exceptionParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   663
                           final JCLambda onLambda,
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   664
                           final int type_index,
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   665
                           final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   666
        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
   667
                                          Integer.MIN_VALUE, onLambda,
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   668
                                          type_index, Integer.MIN_VALUE,
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   669
                                          location);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   672
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   673
     * 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
   674
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   675
     * @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
   676
     * @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
   677
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   678
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   679
        exceptionParameter(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   680
                           final int pos) {
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   681
        return exceptionParameter(emptyPath, onLambda, Integer.MIN_VALUE, pos);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   682
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   683
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   684
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   685
     * 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
   686
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   687
     * @param location The type path.
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
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   690
        exceptionParameter(final List<TypePathEntry> location) {
24895
dd091d389fbf 8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents: 24396
diff changeset
   691
        return exceptionParameter(location, null, Integer.MIN_VALUE, -1);
22702
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   692
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   693
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   696
     * 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
   697
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   698
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   699
     * @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
   700
     * @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
   701
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   702
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   703
        resourceVariable(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   704
                         final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   705
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   706
        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
   707
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   708
                                          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
   709
                                          location);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   712
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   713
     * 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
   714
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   715
     * @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
   716
     * @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
   717
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   718
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   719
        resourceVariable(final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   720
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   721
        return resourceVariable(emptyPath, onLambda, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   722
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   723
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   724
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   725
     * 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
   726
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   727
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   728
     * @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
   729
     * @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
   730
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   731
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   732
        resourceVariable(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   733
        return resourceVariable(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   734
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   735
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   736
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   737
     * 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
   738
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   739
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   740
     * @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
   741
     * @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
   742
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   743
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   744
        newObj(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   745
               final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   746
               final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   747
        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
   748
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   749
                                          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
   750
                                          location);
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
     * @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
   758
     * @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
   759
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   760
    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
   761
        return newObj(emptyPath, null, pos);
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   765
     * 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
   766
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   767
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   768
     * @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
   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
        newObj(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   773
        return newObj(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   774
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   775
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   776
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   777
     * 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
   778
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   779
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   780
     * @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
   781
     * @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
   782
     * @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
   783
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   784
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   785
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   786
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   787
                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   788
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   789
        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
   790
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   791
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   792
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   793
    }
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
     * 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
   797
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   798
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   799
     * @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
   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
     * @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
   802
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   803
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   804
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   805
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   806
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   807
        return classExtends(location, onLambda, -1, pos);
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
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
     * 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
   812
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   813
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   814
     * @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
   815
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   816
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   817
        classExtends(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   818
                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   819
        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
   820
    }
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   823
     * 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
   824
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   825
     * @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
   826
     * @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
   827
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   828
    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
   829
                                                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   830
        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
   831
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   832
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   833
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   834
     * 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
   835
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   836
     * @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
   837
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   838
    public static TypeAnnotationPosition classExtends(final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   839
        return classExtends(-1, pos);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   840
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   841
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   842
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   843
     * 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
   844
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   845
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   846
     * @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
   847
     * @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
   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
                   final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   852
                   final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   853
        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
   854
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   855
                                          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
   856
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   857
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   858
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   859
     * 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
   860
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   861
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   862
     * @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
   863
     * @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
   864
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   865
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   866
        instanceOf(final List<TypePathEntry> location) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   867
        return instanceOf(location, null, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   868
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   869
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   870
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   871
     * 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
   872
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   873
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   874
     * @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
   875
     * @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
   876
     * @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
   877
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   878
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   879
        typeCast(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   880
                 final JCLambda onLambda,
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
                 final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   883
        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
   884
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   885
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   886
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   887
    }
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   890
     * 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
   891
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   892
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   893
     * @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
   894
     * @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
   895
     * @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
   896
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   897
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   898
        typeCast(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   899
                 final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   900
        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
   901
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   902
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
     * 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
   905
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   906
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   907
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   908
     * @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
   909
     * @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
   910
     * @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
   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 JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   915
                                final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   916
                                final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   917
        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
   918
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   919
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   920
                                          location);
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
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   923
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   924
     * 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
   925
     * invocation type argument.
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
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   928
     * @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
   929
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   930
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   931
        methodInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   932
                                final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   933
        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
   934
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   935
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
     * 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
   938
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   939
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   940
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   941
     * @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
   942
     * @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
   943
     * @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
   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 JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   948
                                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   949
                                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   950
        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
   951
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   952
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   953
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   954
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   955
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   956
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   957
     * 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
   958
     * invocation type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   959
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   960
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   961
     * @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
   962
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   963
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   964
        constructorInvocationTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   965
                                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   966
        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
   967
    }
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
     * 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
   971
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   972
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   973
     * @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
   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
     * @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
   976
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   977
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   978
        typeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   979
                      final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   980
                      final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   981
                      final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   982
        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
   983
                                          parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   984
                                          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
   985
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   986
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   987
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   988
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   989
     * 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
   990
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   991
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   992
     * @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
   993
     * @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
   994
     * @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
   995
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   996
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   997
        typeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   998
                      final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
   999
        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
  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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1003
     * 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
  1004
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1005
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1006
     * @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
  1007
     * @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
  1008
     * @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
  1009
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1010
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1011
        methodTypeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1012
                            final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1013
                            final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1014
                            final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1015
        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
  1016
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1017
                                          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
  1018
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1019
    }
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1022
     * 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
  1023
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1024
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1025
     * @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
  1026
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1027
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1028
        methodTypeParameter(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1029
                            final int parameter_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1030
        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
  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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1034
     * 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
  1035
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1036
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1037
     * @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
  1038
     * @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
  1039
     * @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
  1040
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1041
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1042
        methodThrows(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1043
                     final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1044
                     final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1045
                     final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1046
        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
  1047
                                          Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1048
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1049
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1050
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1051
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
     * 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
  1054
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1055
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1056
     * @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
  1057
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1058
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1059
        methodThrows(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1060
                     final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1061
        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
  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.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1069
     * @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
  1070
     * @param parameter_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
  1071
     * @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
  1072
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1073
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1074
        methodRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1075
                         final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1076
                         final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1077
                         final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1078
        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
  1079
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1080
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1081
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1082
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1083
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1084
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1085
     * 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
  1086
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1087
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1088
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1089
     * @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
  1090
     * @param parameter_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
  1091
     * @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
  1092
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1093
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1094
        methodRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1095
                         final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1096
        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
  1097
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1098
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1099
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1100
     * 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
  1101
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1102
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1103
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1104
     * @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
  1105
     * @param parameter_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
  1106
     * @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
  1107
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1108
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1109
        constructorRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1110
                              final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1111
                              final int type_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1112
                              final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1113
        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
  1114
                                          pos, Integer.MIN_VALUE, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1115
                                          type_index, Integer.MIN_VALUE,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1116
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1117
    }
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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1120
     * 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
  1121
     * type argument.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1122
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1123
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1124
     * @param parameter_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
  1125
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1126
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1127
        constructorRefTypeArg(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1128
                              final int type_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1129
        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
  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
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1133
     * 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
  1134
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1135
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1136
     * @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
  1137
     * @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
  1138
     * @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
  1139
     * @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
  1140
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1141
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1142
        typeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1143
                           final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1144
                           final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1145
                           final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1146
                           final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1147
        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
  1148
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1149
                                          Integer.MIN_VALUE, bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1150
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1151
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1152
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1153
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1154
     * 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
  1155
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1156
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1157
     * @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
  1158
     * @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
  1159
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1160
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1161
        typeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1162
                           final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1163
                           final int bound_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1164
        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
  1165
                                  bound_index, -1);
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 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
  1174
     * @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
  1175
     * @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
  1176
     * @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
  1177
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1178
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1179
        methodTypeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1180
                                 final JCLambda onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1181
                                 final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1182
                                 final int bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1183
                                 final int pos) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1184
        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
  1185
                                          pos, parameter_index, onLambda,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1186
                                          Integer.MIN_VALUE, bound_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1187
                                          location);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1188
    }
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1189
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1190
    /**
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1191
     * 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
  1192
     * parameter bound.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1193
     *
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1194
     * @param location The type path.
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1195
     * @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
  1196
     * @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
  1197
     */
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1198
    public static TypeAnnotationPosition
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1199
        methodTypeParameterBound(final List<TypePathEntry> location,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1200
                                 final int parameter_index,
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1201
                                 final int bound_index) {
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1202
        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
  1203
                                        bound_index, -1);
1297fbaf34fa 8033004: Make base TypeAnnotationPosition data immutable, create better methods for creating base TypeAnnotationPositions
emc
parents: 20249
diff changeset
  1204
    }
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
  1205
}