langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java
author mcimadamore
Fri, 15 Feb 2013 16:28:07 +0000
changeset 16292 3be2cdacb3b3
parent 15718 8e54c8e43d38
child 24895 dd091d389fbf
permissions -rw-r--r--
8006749: compiler does not allow Object protected methods to be used in lambda Summary: Check.checkFunctionalInterface should take into account 'fake' override Reviewed-by: jjg
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: 14801
diff changeset
     2
 * Copyright (c) 2008, 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: 3151
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: 3151
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: 3151
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3151
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3151
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: 14801
diff changeset
    28
import com.sun.tools.javac.util.Assert;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5847
diff changeset
    29
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    30
/**
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    31
 * Describes the type of program element an extended annotation (or extended
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    32
 * compound attribute) targets.
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    33
 *
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    34
 * By comparison, a Tree.Kind has enum values for all elements in the AST, and
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    35
 * it does not provide enough resolution for type arguments (i.e., whether an
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    36
 * annotation targets a type argument in a local variable, method return type,
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    37
 * or a typecast).
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    38
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    39
 *  <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
    40
 *  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
    41
 *  This code and its internal interfaces are subject to change or
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    42
 *  deletion without notice.</b>
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    43
 */
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    44
// Code duplicated in com.sun.tools.classfile.TypeAnnotation.TargetType
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    45
public enum TargetType {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    46
    /** For annotations on a class type parameter declaration. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    47
    CLASS_TYPE_PARAMETER(0x00),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    48
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    49
    /** For annotations on a method type parameter declaration. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    50
    METHOD_TYPE_PARAMETER(0x01),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    51
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    52
    /** For annotations on the type of an "extends" or "implements" clause. */
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    53
    CLASS_EXTENDS(0x10),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    54
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    55
    /** For annotations on a bound of a type parameter of a class. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    56
    CLASS_TYPE_PARAMETER_BOUND(0x11),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    57
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    58
    /** For annotations on a bound of a type parameter of a method. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    59
    METHOD_TYPE_PARAMETER_BOUND(0x12),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    60
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    61
    /** For annotations on a field. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    62
    FIELD(0x13),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    63
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    64
    /** For annotations on a method return type. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    65
    METHOD_RETURN(0x14),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    66
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    67
    /** For annotations on the method receiver. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    68
    METHOD_RECEIVER(0x15),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    69
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    70
    /** For annotations on a method parameter. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    71
    METHOD_FORMAL_PARAMETER(0x16),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    72
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    73
    /** For annotations on a throws clause in a method declaration. */
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    74
    THROWS(0x17),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    75
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    76
    /** For annotations on a local variable. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    77
    LOCAL_VARIABLE(0x40, true),
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    78
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    79
    /** For annotations on a resource variable. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    80
    RESOURCE_VARIABLE(0x41, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    81
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    82
    /** For annotations on an exception parameter. */
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    83
    EXCEPTION_PARAMETER(0x42, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    84
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    85
    /** For annotations on a type test. */
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    86
    INSTANCEOF(0x43, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    87
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
    88
    /** For annotations on an object creation expression. */
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    89
    NEW(0x44, true),
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    90
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    91
    /** For annotations on a constructor reference receiver. */
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    92
    CONSTRUCTOR_REFERENCE(0x45, true),
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    93
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    94
    /** For annotations on a method reference receiver. */
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    95
    METHOD_REFERENCE(0x46, true),
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    96
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    97
    /** For annotations on a typecast. */
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
    98
    CAST(0x47, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
    99
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   100
    /** For annotations on a type argument of an object creation expression. */
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   101
    CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT(0x48, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   102
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   103
    /** For annotations on a type argument of a method call. */
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   104
    METHOD_INVOCATION_TYPE_ARGUMENT(0x49, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   105
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   106
    /** For annotations on a type argument of a constructor reference. */
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   107
    CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(0x4A, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   108
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   109
    /** For annotations on a type argument of a method reference. */
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   110
    METHOD_REFERENCE_TYPE_ARGUMENT(0x4B, true),
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   111
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   112
    /** For annotations with an unknown target. */
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   113
    UNKNOWN(0xFF);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   114
15718
8e54c8e43d38 8008077: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   115
    private static final int MAXIMUM_TARGET_TYPE_VALUE = 0x4B;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   116
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   117
    private final int targetTypeValue;
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   118
    private final boolean isLocal;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   119
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   120
    private TargetType(int targetTypeValue) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   121
        this(targetTypeValue, false);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   122
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   123
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   124
    private TargetType(int targetTypeValue, boolean isLocal) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   125
        if (targetTypeValue < 0
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   126
                || targetTypeValue > 255)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   127
                Assert.error("Attribute type value needs to be an unsigned byte: " + String.format("0x%02X", targetTypeValue));
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   128
        this.targetTypeValue = targetTypeValue;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   129
        this.isLocal = isLocal;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   130
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   131
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   132
    /**
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   133
     * Returns whether or not this TargetType represents an annotation whose
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   134
     * target is exclusively a tree in a method body
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   135
     *
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   136
     * Note: wildcard bound targets could target a local tree and a class
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   137
     * member declaration signature tree
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   138
     */
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   139
    public boolean isLocal() {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   140
        return isLocal;
3151
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   141
    }
41800a86aad3 6854796: update JSR308 impl with latest code from type-annotations repo
jjg
parents: 3150
diff changeset
   142
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   143
    public int targetTypeValue() {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   144
        return this.targetTypeValue;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   145
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   146
14801
d66cab4ef397 8003967: detect and remove all mutable implicit static enum fields in langtools
vromero
parents: 14258
diff changeset
   147
    private static final TargetType[] targets;
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   148
14801
d66cab4ef397 8003967: detect and remove all mutable implicit static enum fields in langtools
vromero
parents: 14258
diff changeset
   149
    static {
d66cab4ef397 8003967: detect and remove all mutable implicit static enum fields in langtools
vromero
parents: 14258
diff changeset
   150
        targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   151
        TargetType[] alltargets = values();
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   152
        for (TargetType target : alltargets) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   153
            if (target.targetTypeValue != UNKNOWN.targetTypeValue)
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   154
                targets[target.targetTypeValue] = target;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   155
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   156
        for (int i = 0; i <= MAXIMUM_TARGET_TYPE_VALUE; ++i) {
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   157
            if (targets[i] == null)
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   158
                targets[i] = UNKNOWN;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   159
        }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   160
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   161
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   162
    public static boolean isValidTargetTypeValue(int tag) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   163
        if (tag == UNKNOWN.targetTypeValue)
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   164
            return true;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   165
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   166
        return (tag >= 0 && tag < targets.length);
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   167
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   168
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   169
    public static TargetType fromTargetTypeValue(int tag) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   170
        if (tag == UNKNOWN.targetTypeValue)
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   171
            return UNKNOWN;
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   172
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   173
        if (tag < 0 || tag >= targets.length)
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14801
diff changeset
   174
            Assert.error("Unknown TargetType: " + tag);
3150
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   175
        return targets[tag];
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   176
    }
a783d225c3e1 6855544: add missing files
jjg
parents:
diff changeset
   177
}