Thu, 05 Jan 2017 18:58:06 +0000
8168774: Polymorhic signature method check crashes javac
Summary: Check for polysig method assumes arity is greater than zero
Reviewed-by: vromero
duke@1 | 1 | /* |
vromero@2409 | 2 | * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package com.sun.tools.javac.code; |
duke@1 | 27 | |
jjg@1357 | 28 | import java.util.Collections; |
mcimadamore@80 | 29 | import java.util.EnumSet; |
duke@1 | 30 | import java.util.Map; |
duke@1 | 31 | import java.util.Set; |
jjg@1357 | 32 | |
duke@1 | 33 | import javax.lang.model.element.Modifier; |
duke@1 | 34 | |
vromero@1842 | 35 | import com.sun.tools.javac.util.Assert; |
jlahoda@2413 | 36 | import com.sun.tools.javac.util.StringUtils; |
vromero@1842 | 37 | |
duke@1 | 38 | /** Access flags and other modifiers for Java classes and members. |
duke@1 | 39 | * |
jjg@581 | 40 | * <p><b>This is NOT part of any supported API. |
jjg@581 | 41 | * If you write code that depends on this, you do so at your own risk. |
duke@1 | 42 | * This code and its internal interfaces are subject to change or |
duke@1 | 43 | * deletion without notice.</b> |
duke@1 | 44 | */ |
duke@1 | 45 | public class Flags { |
duke@1 | 46 | |
duke@1 | 47 | private Flags() {} // uninstantiable |
duke@1 | 48 | |
duke@1 | 49 | public static String toString(long flags) { |
jjg@904 | 50 | StringBuilder buf = new StringBuilder(); |
mcimadamore@80 | 51 | String sep = ""; |
vromero@1842 | 52 | for (Flag flag : asFlagSet(flags)) { |
mcimadamore@80 | 53 | buf.append(sep); |
vromero@1842 | 54 | buf.append(flag); |
mcimadamore@80 | 55 | sep = " "; |
mcimadamore@80 | 56 | } |
duke@1 | 57 | return buf.toString(); |
duke@1 | 58 | } |
duke@1 | 59 | |
vromero@1842 | 60 | public static EnumSet<Flag> asFlagSet(long flags) { |
vromero@1842 | 61 | EnumSet<Flag> flagSet = EnumSet.noneOf(Flag.class); |
vromero@1842 | 62 | for (Flag flag : Flag.values()) { |
vromero@1842 | 63 | if ((flags & flag.value) != 0) { |
vromero@1842 | 64 | flagSet.add(flag); |
vromero@1842 | 65 | flags &= ~flag.value; |
vromero@1842 | 66 | } |
vromero@1842 | 67 | } |
vromero@1842 | 68 | Assert.check(flags == 0, "Flags parameter contains unknown flags " + flags); |
vromero@1842 | 69 | return flagSet; |
mcimadamore@80 | 70 | } |
mcimadamore@80 | 71 | |
duke@1 | 72 | /* Standard Java flags. |
duke@1 | 73 | */ |
vromero@1842 | 74 | public static final int PUBLIC = 1; |
duke@1 | 75 | public static final int PRIVATE = 1<<1; |
duke@1 | 76 | public static final int PROTECTED = 1<<2; |
duke@1 | 77 | public static final int STATIC = 1<<3; |
duke@1 | 78 | public static final int FINAL = 1<<4; |
duke@1 | 79 | public static final int SYNCHRONIZED = 1<<5; |
duke@1 | 80 | public static final int VOLATILE = 1<<6; |
duke@1 | 81 | public static final int TRANSIENT = 1<<7; |
duke@1 | 82 | public static final int NATIVE = 1<<8; |
duke@1 | 83 | public static final int INTERFACE = 1<<9; |
duke@1 | 84 | public static final int ABSTRACT = 1<<10; |
duke@1 | 85 | public static final int STRICTFP = 1<<11; |
duke@1 | 86 | |
duke@1 | 87 | /* Flag that marks a symbol synthetic, added in classfile v49.0. */ |
duke@1 | 88 | public static final int SYNTHETIC = 1<<12; |
duke@1 | 89 | |
duke@1 | 90 | /** Flag that marks attribute interfaces, added in classfile v49.0. */ |
duke@1 | 91 | public static final int ANNOTATION = 1<<13; |
duke@1 | 92 | |
duke@1 | 93 | /** An enumeration type or an enumeration constant, added in |
duke@1 | 94 | * classfile v49.0. */ |
duke@1 | 95 | public static final int ENUM = 1<<14; |
duke@1 | 96 | |
mcimadamore@1565 | 97 | /** Added in SE8, represents constructs implicitly declared in source. */ |
mcimadamore@1565 | 98 | public static final int MANDATED = 1<<15; |
mcimadamore@1565 | 99 | |
duke@1 | 100 | public static final int StandardFlags = 0x0fff; |
duke@1 | 101 | |
duke@1 | 102 | // Because the following access flags are overloaded with other |
duke@1 | 103 | // bit positions, we translate them when reading and writing class |
duke@1 | 104 | // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC, |
duke@1 | 105 | // for example. |
duke@1 | 106 | public static final int ACC_SUPER = 0x0020; |
duke@1 | 107 | public static final int ACC_BRIDGE = 0x0040; |
duke@1 | 108 | public static final int ACC_VARARGS = 0x0080; |
duke@1 | 109 | |
duke@1 | 110 | /***************************************** |
duke@1 | 111 | * Internal compiler flags (no bits in the lower 16). |
duke@1 | 112 | *****************************************/ |
duke@1 | 113 | |
duke@1 | 114 | /** Flag is set if symbol is deprecated. |
duke@1 | 115 | */ |
duke@1 | 116 | public static final int DEPRECATED = 1<<17; |
duke@1 | 117 | |
duke@1 | 118 | /** Flag is set for a variable symbol if the variable's definition |
duke@1 | 119 | * has an initializer part. |
duke@1 | 120 | */ |
duke@1 | 121 | public static final int HASINIT = 1<<18; |
duke@1 | 122 | |
duke@1 | 123 | /** Flag is set for compiler-generated anonymous method symbols |
duke@1 | 124 | * that `own' an initializer block. |
duke@1 | 125 | */ |
duke@1 | 126 | public static final int BLOCK = 1<<20; |
duke@1 | 127 | |
duke@1 | 128 | /** Flag is set for compiler-generated abstract methods that implement |
duke@1 | 129 | * an interface method (Miranda methods). |
duke@1 | 130 | */ |
duke@1 | 131 | public static final int IPROXY = 1<<21; |
duke@1 | 132 | |
duke@1 | 133 | /** Flag is set for nested classes that do not access instance members |
duke@1 | 134 | * or `this' of an outer class and therefore don't need to be passed |
vromero@1842 | 135 | * a this$n reference. This value is currently set only for anonymous |
duke@1 | 136 | * classes in superclass constructor calls and only for pre 1.4 targets. |
vromero@1842 | 137 | * todo: use this value for optimizing away this$n parameters in |
duke@1 | 138 | * other cases. |
duke@1 | 139 | */ |
duke@1 | 140 | public static final int NOOUTERTHIS = 1<<22; |
duke@1 | 141 | |
duke@1 | 142 | /** Flag is set for package symbols if a package has a member or |
duke@1 | 143 | * directory and therefore exists. |
duke@1 | 144 | */ |
duke@1 | 145 | public static final int EXISTS = 1<<23; |
duke@1 | 146 | |
duke@1 | 147 | /** Flag is set for compiler-generated compound classes |
duke@1 | 148 | * representing multiple variable bounds |
duke@1 | 149 | */ |
duke@1 | 150 | public static final int COMPOUND = 1<<24; |
duke@1 | 151 | |
duke@1 | 152 | /** Flag is set for class symbols if a class file was found for this class. |
duke@1 | 153 | */ |
duke@1 | 154 | public static final int CLASS_SEEN = 1<<25; |
duke@1 | 155 | |
duke@1 | 156 | /** Flag is set for class symbols if a source file was found for this |
duke@1 | 157 | * class. |
duke@1 | 158 | */ |
duke@1 | 159 | public static final int SOURCE_SEEN = 1<<26; |
duke@1 | 160 | |
duke@1 | 161 | /* State flags (are reset during compilation). |
duke@1 | 162 | */ |
duke@1 | 163 | |
duke@1 | 164 | /** Flag for class symbols is set and later re-set as a lock in |
duke@1 | 165 | * Enter to detect cycles in the superclass/superinterface |
duke@1 | 166 | * relations. Similarly for constructor call cycle detection in |
duke@1 | 167 | * Attr. |
duke@1 | 168 | */ |
duke@1 | 169 | public static final int LOCKED = 1<<27; |
duke@1 | 170 | |
duke@1 | 171 | /** Flag for class symbols is set and later re-set to indicate that a class |
duke@1 | 172 | * has been entered but has not yet been attributed. |
duke@1 | 173 | */ |
duke@1 | 174 | public static final int UNATTRIBUTED = 1<<28; |
duke@1 | 175 | |
duke@1 | 176 | /** Flag for synthesized default constructors of anonymous classes. |
duke@1 | 177 | */ |
duke@1 | 178 | public static final int ANONCONSTR = 1<<29; |
duke@1 | 179 | |
duke@1 | 180 | /** Flag for class symbols to indicate it has been checked and found |
duke@1 | 181 | * acyclic. |
duke@1 | 182 | */ |
duke@1 | 183 | public static final int ACYCLIC = 1<<30; |
duke@1 | 184 | |
duke@1 | 185 | /** Flag that marks bridge methods. |
duke@1 | 186 | */ |
duke@1 | 187 | public static final long BRIDGE = 1L<<31; |
duke@1 | 188 | |
duke@1 | 189 | /** Flag that marks formal parameters. |
duke@1 | 190 | */ |
duke@1 | 191 | public static final long PARAMETER = 1L<<33; |
duke@1 | 192 | |
duke@1 | 193 | /** Flag that marks varargs methods. |
duke@1 | 194 | */ |
duke@1 | 195 | public static final long VARARGS = 1L<<34; |
duke@1 | 196 | |
duke@1 | 197 | /** Flag for annotation type symbols to indicate it has been |
duke@1 | 198 | * checked and found acyclic. |
duke@1 | 199 | */ |
duke@1 | 200 | public static final long ACYCLIC_ANN = 1L<<35; |
duke@1 | 201 | |
duke@1 | 202 | /** Flag that marks a generated default constructor. |
duke@1 | 203 | */ |
duke@1 | 204 | public static final long GENERATEDCONSTR = 1L<<36; |
duke@1 | 205 | |
duke@1 | 206 | /** Flag that marks a hypothetical method that need not really be |
duke@1 | 207 | * generated in the binary, but is present in the symbol table to |
mcimadamore@1239 | 208 | * simplify checking for erasure clashes - also used for 292 poly sig methods. |
duke@1 | 209 | */ |
duke@1 | 210 | public static final long HYPOTHETICAL = 1L<<37; |
duke@1 | 211 | |
duke@1 | 212 | /** |
jjg@582 | 213 | * Flag that marks an internal proprietary class. |
duke@1 | 214 | */ |
duke@1 | 215 | public static final long PROPRIETARY = 1L<<38; |
duke@1 | 216 | |
mcimadamore@550 | 217 | /** |
jjg@1521 | 218 | * Flag that marks a multi-catch parameter. |
mcimadamore@550 | 219 | */ |
darcy@969 | 220 | public static final long UNION = 1L<<39; |
mcimadamore@550 | 221 | |
jrose@573 | 222 | /** |
jjg@1521 | 223 | * Flag that marks a special kind of bridge method (the ones that |
jjg@1521 | 224 | * come from restricted supertype bounds). |
mcimadamore@673 | 225 | */ |
mcimadamore@1239 | 226 | public static final long OVERRIDE_BRIDGE = 1L<<40; |
mcimadamore@673 | 227 | |
mcimadamore@735 | 228 | /** |
jjg@1521 | 229 | * Flag that marks an 'effectively final' local variable. |
mcimadamore@735 | 230 | */ |
mcimadamore@1239 | 231 | public static final long EFFECTIVELY_FINAL = 1L<<41; |
mcimadamore@735 | 232 | |
mcimadamore@844 | 233 | /** |
jjg@1521 | 234 | * Flag that marks non-override equivalent methods with the same signature. |
mcimadamore@844 | 235 | */ |
mcimadamore@1239 | 236 | public static final long CLASH = 1L<<42; |
mcimadamore@844 | 237 | |
mcimadamore@1366 | 238 | /** |
vromero@1588 | 239 | * Flag that marks either a default method or an interface containing default methods. |
mcimadamore@1366 | 240 | */ |
mcimadamore@1366 | 241 | public static final long DEFAULT = 1L<<43; |
mcimadamore@1366 | 242 | |
ohrstrom@1384 | 243 | /** |
ohrstrom@1384 | 244 | * Flag that marks class as auxiliary, ie a non-public class following |
ohrstrom@1384 | 245 | * the public class in a source file, that could block implicit compilation. |
ohrstrom@1384 | 246 | */ |
mcimadamore@1415 | 247 | public static final long AUXILIARY = 1L<<44; |
ohrstrom@1384 | 248 | |
jjg@1569 | 249 | /** |
jjg@1569 | 250 | * Flag that marks that a symbol is not available in the current profile |
jjg@1569 | 251 | */ |
jjg@1569 | 252 | public static final long NOT_IN_PROFILE = 1L<<45; |
jjg@1569 | 253 | |
lana@1603 | 254 | /** |
vromero@1588 | 255 | * Flag that indicates that an override error has been detected by Check. |
vromero@1588 | 256 | */ |
vromero@1588 | 257 | public static final long BAD_OVERRIDE = 1L<<45; |
vromero@1588 | 258 | |
vromero@1820 | 259 | /** |
vromero@1820 | 260 | * Flag that indicates a signature polymorphic method (292). |
vromero@1820 | 261 | */ |
vromero@1820 | 262 | public static final long SIGNATURE_POLYMORPHIC = 1L<<46; |
vromero@1820 | 263 | |
mcimadamore@1896 | 264 | /** |
vromero@2040 | 265 | * Flag that indicates that an inference variable is used in a 'throws' clause. |
mcimadamore@1896 | 266 | */ |
mcimadamore@1896 | 267 | public static final long THROWS = 1L<<47; |
mcimadamore@1896 | 268 | |
vromero@2000 | 269 | /** |
vromero@2000 | 270 | * Flag that marks potentially ambiguous overloads |
vromero@2000 | 271 | */ |
vromero@2000 | 272 | public static final long POTENTIALLY_AMBIGUOUS = 1L<<48; |
vromero@2000 | 273 | |
jjg@2146 | 274 | /** |
jjg@2146 | 275 | * Flag that marks a synthetic method body for a lambda expression |
jjg@2146 | 276 | */ |
jjg@2146 | 277 | public static final long LAMBDA_METHOD = 1L<<49; |
jjg@2146 | 278 | |
pgovereau@2425 | 279 | /** |
pgovereau@2425 | 280 | * Flag to control recursion in TransTypes |
pgovereau@2425 | 281 | */ |
pgovereau@2425 | 282 | public static final long TYPE_TRANSLATED = 1L<<50; |
pgovereau@2425 | 283 | |
duke@1 | 284 | /** Modifier masks. |
duke@1 | 285 | */ |
duke@1 | 286 | public static final int |
duke@1 | 287 | AccessFlags = PUBLIC | PROTECTED | PRIVATE, |
duke@1 | 288 | LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC, |
duke@1 | 289 | MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags, |
duke@1 | 290 | ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION, |
duke@1 | 291 | InterfaceVarFlags = FINAL | STATIC | PUBLIC, |
duke@1 | 292 | VarFlags = AccessFlags | FINAL | STATIC | |
duke@1 | 293 | VOLATILE | TRANSIENT | ENUM, |
duke@1 | 294 | ConstructorFlags = AccessFlags, |
duke@1 | 295 | InterfaceMethodFlags = ABSTRACT | PUBLIC, |
duke@1 | 296 | MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE | |
duke@1 | 297 | SYNCHRONIZED | FINAL | STRICTFP; |
duke@1 | 298 | public static final long |
mcimadamore@1366 | 299 | ExtendedStandardFlags = (long)StandardFlags | DEFAULT, |
emc@2016 | 300 | ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT, |
mcimadamore@1513 | 301 | InterfaceMethodMask = ABSTRACT | STATIC | PUBLIC | STRICTFP | DEFAULT, |
jfranck@2205 | 302 | AnnotationTypeElementMask = ABSTRACT | PUBLIC, |
pgovereau@2424 | 303 | LocalVarFlags = FINAL | PARAMETER, |
pgovereau@2424 | 304 | ReceiverParamFlags = PARAMETER; |
vromero@2411 | 305 | |
duke@1 | 306 | |
duke@1 | 307 | public static Set<Modifier> asModifierSet(long flags) { |
duke@1 | 308 | Set<Modifier> modifiers = modifierSets.get(flags); |
duke@1 | 309 | if (modifiers == null) { |
duke@1 | 310 | modifiers = java.util.EnumSet.noneOf(Modifier.class); |
duke@1 | 311 | if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC); |
duke@1 | 312 | if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED); |
duke@1 | 313 | if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE); |
duke@1 | 314 | if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT); |
duke@1 | 315 | if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC); |
duke@1 | 316 | if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL); |
duke@1 | 317 | if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT); |
duke@1 | 318 | if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE); |
duke@1 | 319 | if (0 != (flags & SYNCHRONIZED)) |
duke@1 | 320 | modifiers.add(Modifier.SYNCHRONIZED); |
duke@1 | 321 | if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE); |
duke@1 | 322 | if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP); |
darcy@1672 | 323 | if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT); |
duke@1 | 324 | modifiers = Collections.unmodifiableSet(modifiers); |
duke@1 | 325 | modifierSets.put(flags, modifiers); |
duke@1 | 326 | } |
duke@1 | 327 | return modifiers; |
duke@1 | 328 | } |
duke@1 | 329 | |
duke@1 | 330 | // Cache of modifier sets. |
vromero@1442 | 331 | private static final Map<Long, Set<Modifier>> modifierSets = |
duke@1 | 332 | new java.util.concurrent.ConcurrentHashMap<Long, Set<Modifier>>(64); |
duke@1 | 333 | |
duke@1 | 334 | public static boolean isStatic(Symbol symbol) { |
duke@1 | 335 | return (symbol.flags() & STATIC) != 0; |
duke@1 | 336 | } |
duke@1 | 337 | |
duke@1 | 338 | public static boolean isEnum(Symbol symbol) { |
duke@1 | 339 | return (symbol.flags() & ENUM) != 0; |
duke@1 | 340 | } |
duke@1 | 341 | |
duke@1 | 342 | public static boolean isConstant(Symbol.VarSymbol symbol) { |
duke@1 | 343 | return symbol.getConstValue() != null; |
duke@1 | 344 | } |
mcimadamore@80 | 345 | |
vromero@1842 | 346 | |
mcimadamore@80 | 347 | public enum Flag { |
vromero@1842 | 348 | PUBLIC(Flags.PUBLIC), |
vromero@1842 | 349 | PRIVATE(Flags.PRIVATE), |
vromero@1842 | 350 | PROTECTED(Flags.PROTECTED), |
vromero@1842 | 351 | STATIC(Flags.STATIC), |
vromero@1842 | 352 | FINAL(Flags.FINAL), |
vromero@1842 | 353 | SYNCHRONIZED(Flags.SYNCHRONIZED), |
vromero@1842 | 354 | VOLATILE(Flags.VOLATILE), |
vromero@1842 | 355 | TRANSIENT(Flags.TRANSIENT), |
vromero@1842 | 356 | NATIVE(Flags.NATIVE), |
vromero@1842 | 357 | INTERFACE(Flags.INTERFACE), |
vromero@1842 | 358 | ABSTRACT(Flags.ABSTRACT), |
vromero@1842 | 359 | DEFAULT(Flags.DEFAULT), |
vromero@1842 | 360 | STRICTFP(Flags.STRICTFP), |
vromero@1842 | 361 | BRIDGE(Flags.BRIDGE), |
vromero@1842 | 362 | SYNTHETIC(Flags.SYNTHETIC), |
vromero@1842 | 363 | ANNOTATION(Flags.ANNOTATION), |
vromero@1842 | 364 | DEPRECATED(Flags.DEPRECATED), |
vromero@1842 | 365 | HASINIT(Flags.HASINIT), |
vromero@1842 | 366 | BLOCK(Flags.BLOCK), |
vromero@1842 | 367 | ENUM(Flags.ENUM), |
vromero@1842 | 368 | MANDATED(Flags.MANDATED), |
vromero@1842 | 369 | IPROXY(Flags.IPROXY), |
vromero@1842 | 370 | NOOUTERTHIS(Flags.NOOUTERTHIS), |
vromero@1842 | 371 | EXISTS(Flags.EXISTS), |
vromero@1842 | 372 | COMPOUND(Flags.COMPOUND), |
vromero@1842 | 373 | CLASS_SEEN(Flags.CLASS_SEEN), |
vromero@1842 | 374 | SOURCE_SEEN(Flags.SOURCE_SEEN), |
vromero@1842 | 375 | LOCKED(Flags.LOCKED), |
vromero@1842 | 376 | UNATTRIBUTED(Flags.UNATTRIBUTED), |
vromero@1842 | 377 | ANONCONSTR(Flags.ANONCONSTR), |
vromero@1842 | 378 | ACYCLIC(Flags.ACYCLIC), |
vromero@1842 | 379 | PARAMETER(Flags.PARAMETER), |
vromero@1842 | 380 | VARARGS(Flags.VARARGS), |
vromero@1842 | 381 | ACYCLIC_ANN(Flags.ACYCLIC_ANN), |
vromero@1842 | 382 | GENERATEDCONSTR(Flags.GENERATEDCONSTR), |
vromero@1842 | 383 | HYPOTHETICAL(Flags.HYPOTHETICAL), |
vromero@1842 | 384 | PROPRIETARY(Flags.PROPRIETARY), |
vromero@1842 | 385 | UNION(Flags.UNION), |
vromero@1842 | 386 | OVERRIDE_BRIDGE(Flags.OVERRIDE_BRIDGE), |
vromero@1842 | 387 | EFFECTIVELY_FINAL(Flags.EFFECTIVELY_FINAL), |
vromero@1842 | 388 | CLASH(Flags.CLASH), |
vromero@1842 | 389 | AUXILIARY(Flags.AUXILIARY), |
vromero@1842 | 390 | NOT_IN_PROFILE(Flags.NOT_IN_PROFILE), |
mcimadamore@1896 | 391 | BAD_OVERRIDE(Flags.BAD_OVERRIDE), |
mcimadamore@1896 | 392 | SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC), |
jjg@2146 | 393 | THROWS(Flags.THROWS), |
pgovereau@2425 | 394 | LAMBDA_METHOD(Flags.LAMBDA_METHOD), |
pgovereau@2425 | 395 | TYPE_TRANSLATED(Flags.TYPE_TRANSLATED); |
mcimadamore@80 | 396 | |
vromero@1842 | 397 | Flag(long flag) { |
vromero@1842 | 398 | this.value = flag; |
jlahoda@2413 | 399 | this.lowercaseName = StringUtils.toLowerCase(name()); |
mcimadamore@80 | 400 | } |
mcimadamore@80 | 401 | |
vromero@1842 | 402 | @Override |
mcimadamore@80 | 403 | public String toString() { |
vromero@1842 | 404 | return lowercaseName; |
mcimadamore@80 | 405 | } |
vromero@1842 | 406 | |
vromero@1842 | 407 | final long value; |
vromero@1842 | 408 | final String lowercaseName; |
mcimadamore@80 | 409 | } |
vromero@1842 | 410 | |
duke@1 | 411 | } |