src/share/classes/com/sun/tools/javac/code/TargetType.java

Print this page

        

*** 105,118 **** /** For annotations on a type argument of a constructor reference. */ CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(0x4A, true), /** For annotations on a type argument of a method reference. */ ! METHOD_REFERENCE_TYPE_ARGUMENT(0x4B, true), ! ! /** For annotations with an unknown target. */ ! UNKNOWN(0xFF); private static final int MAXIMUM_TARGET_TYPE_VALUE = 0x4B; private final int targetTypeValue; private final boolean isLocal; --- 105,115 ---- /** For annotations on a type argument of a constructor reference. */ CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(0x4A, true), /** For annotations on a type argument of a method reference. */ ! METHOD_REFERENCE_TYPE_ARGUMENT(0x4B, true); private static final int MAXIMUM_TARGET_TYPE_VALUE = 0x4B; private final int targetTypeValue; private final boolean isLocal;
*** 148,177 **** static { targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1]; TargetType[] alltargets = values(); for (TargetType target : alltargets) { - if (target.targetTypeValue != UNKNOWN.targetTypeValue) targets[target.targetTypeValue] = target; } - for (int i = 0; i <= MAXIMUM_TARGET_TYPE_VALUE; ++i) { - if (targets[i] == null) - targets[i] = UNKNOWN; - } } public static boolean isValidTargetTypeValue(int tag) { - if (tag == UNKNOWN.targetTypeValue) - return true; - return (tag >= 0 && tag < targets.length); } public static TargetType fromTargetTypeValue(int tag) { - if (tag == UNKNOWN.targetTypeValue) - return UNKNOWN; - if (tag < 0 || tag >= targets.length) Assert.error("Unknown TargetType: " + tag); return targets[tag]; } } --- 145,163 ----