88
89 /* Flag that marks a symbol synthetic, added in classfile v49.0. */
90 public static final int SYNTHETIC = 1<<12;
91
92 /** Flag that marks attribute interfaces, added in classfile v49.0. */
93 public static final int ANNOTATION = 1<<13;
94
95 /** An enumeration type or an enumeration constant, added in
96 * classfile v49.0. */
97 public static final int ENUM = 1<<14;
98
99 /** Added in SE8, represents constructs implicitly declared in source. */
100 public static final int MANDATED = 1<<15;
101
102 public static final int StandardFlags = 0x0fff;
103
104 // Because the following access flags are overloaded with other
105 // bit positions, we translate them when reading and writing class
106 // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
107 // for example.
108 public static final int ACC_SUPER = 0x0020;
109 public static final int ACC_BRIDGE = 0x0040;
110 public static final int ACC_VARARGS = 0x0080;
111 public static final int ACC_MODULE = 0x8000;
112
113 /* ***************************************
114 * Internal compiler flags (no bits in the lower 16).
115 *****************************************/
116
117 /** Flag is set if symbol is deprecated. See also DEPRECATED_REMOVAL.
118 */
119 public static final int DEPRECATED = 1<<17;
120
121 /** Flag is set for a variable symbol if the variable's definition
122 * has an initializer part.
123 */
124 public static final int HASINIT = 1<<18;
125
126 /** Class is an implicitly declared top level class.
127 */
128 public static final int IMPLICIT_CLASS = 1<<19;
129
130 /** Flag is set for compiler-generated anonymous method symbols
131 * that `own' an initializer block.
132 */
133 public static final int BLOCK = 1<<20;
134
135 /** Flag is set for ClassSymbols that are being compiled from source.
136 */
137 public static final int FROM_SOURCE = 1<<21; //ClassSymbols
138
139 /** Flag is set for nested classes that do not access instance members
140 * or `this' of an outer class and therefore don't need to be passed
141 * a this$n reference. This value is currently set only for anonymous
142 * classes in superclass constructor calls.
143 * todo: use this value for optimizing away this$n parameters in
144 * other cases.
145 */
146 public static final int NOOUTERTHIS = 1<<22;
147
148 /** Flag is set for package symbols if a package has a member or
149 * directory and therefore exists.
150 */
151 public static final int EXISTS = 1<<23;
152
153 /** Flag is set for compiler-generated compound classes
154 * representing multiple variable bounds
305 /**
306 * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
307 */
308 public static final long HAS_RESOURCE = 1L<<52; //PackageSymbols only
309
310 /**
311 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
312 */
313 public static final long NAME_FILLED = 1L<<52; //ParamSymbols only
314
315 /**
316 * Flag to indicate the given ModuleSymbol is a system module.
317 */
318 public static final long SYSTEM_MODULE = 1L<<53; //ModuleSymbols only
319
320 /**
321 * Flag to indicate the given ClassSymbol is a value based.
322 */
323 public static final long VALUE_BASED = 1L<<53; //ClassSymbols only
324
325 /**
326 * Flag to indicate the given symbol has a @Deprecated annotation.
327 */
328 public static final long DEPRECATED_ANNOTATION = 1L<<54;
329
330 /**
331 * Flag to indicate the given symbol has been deprecated and marked for removal.
332 */
333 public static final long DEPRECATED_REMOVAL = 1L<<55;
334
335 /**
336 * Flag to indicate the API element in question is for a preview API.
337 */
338 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
339
340 /**
341 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
342 */
343 public static final long ANONCONSTR_BASED = 1L<<57;
344
382 /** Flag is set for compiler-generated record members, it could be applied to
383 * accessors and fields
384 */
385 public static final int GENERATED_MEMBER = 1<<24; // MethodSymbols and VarSymbols
386
387 /**
388 * Flag to indicate sealed class/interface declaration.
389 */
390 public static final long SEALED = 1L<<62; // ClassSymbols
391
392 /**
393 * Flag to indicate restricted method declaration.
394 */
395 public static final long RESTRICTED = 1L<<62; // MethodSymbols
396
397 /**
398 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
399 */
400 public static final long NON_SEALED = 1L<<63; // ClassSymbols
401
402 /**
403 * Describe modifier flags as they might appear in source code, i.e.,
404 * separated by spaces and in the order suggested by JLS 8.1.1.
405 */
406 public static String toSource(long flags) {
407 return asModifierSet(flags).stream()
408 .map(Modifier::toString)
409 .collect(Collectors.joining(" "));
410 }
411
412 /** Modifier masks.
413 */
414 public static final int
415 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
416 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
417 StaticLocalFlags = LocalClassFlags | STATIC | INTERFACE,
418 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
419 MemberStaticClassFlags = MemberClassFlags | STATIC,
420 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
421 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
422 VarFlags = AccessFlags | FINAL | STATIC |
423 VOLATILE | TRANSIENT | ENUM,
424 ConstructorFlags = AccessFlags,
425 InterfaceMethodFlags = ABSTRACT | PUBLIC,
426 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
427 SYNCHRONIZED | FINAL | STRICTFP,
428 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
429 SYNCHRONIZED | FINAL | STRICTFP;
430 public static final long
431 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED,
432 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED,
433 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED,
434 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED,
435 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED,
436 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
437 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
438 LocalVarFlags = FINAL | PARAMETER,
439 ReceiverParamFlags = PARAMETER;
440
441 public static Set<Modifier> asModifierSet(long flags) {
442 Set<Modifier> modifiers = modifierSets.get(flags);
443 if (modifiers == null) {
444 modifiers = java.util.EnumSet.noneOf(Modifier.class);
445 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
446 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
447 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
448 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
449 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
450 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
451 if (0 != (flags & NON_SEALED))
452 modifiers.add(Modifier.NON_SEALED);
453 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
454 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
455 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
456 if (0 != (flags & SYNCHRONIZED))
457 modifiers.add(Modifier.SYNCHRONIZED);
458 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
459 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
460 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
461 modifiers = Collections.unmodifiableSet(modifiers);
462 modifierSets.put(flags, modifiers);
463 }
464 return modifiers;
465 }
466
467 // Cache of modifier sets.
468 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
469
470 public static boolean isStatic(Symbol symbol) {
471 return (symbol.flags() & STATIC) != 0;
472 }
473
474 public static boolean isEnum(Symbol symbol) {
475 return (symbol.flags() & ENUM) != 0;
476 }
477
478 public static boolean isConstant(Symbol.VarSymbol symbol) {
479 return symbol.getConstValue() != null;
480 }
481
482
483 public enum Flag {
484 PUBLIC(Flags.PUBLIC),
485 PRIVATE(Flags.PRIVATE),
486 PROTECTED(Flags.PROTECTED),
487 STATIC(Flags.STATIC),
488 FINAL(Flags.FINAL),
489 SYNCHRONIZED(Flags.SYNCHRONIZED),
490 VOLATILE(Flags.VOLATILE),
491 TRANSIENT(Flags.TRANSIENT),
492 NATIVE(Flags.NATIVE),
493 INTERFACE(Flags.INTERFACE),
494 ABSTRACT(Flags.ABSTRACT),
495 DEFAULT(Flags.DEFAULT),
496 STRICTFP(Flags.STRICTFP),
497 BRIDGE(Flags.BRIDGE),
498 SYNTHETIC(Flags.SYNTHETIC),
499 ANNOTATION(Flags.ANNOTATION),
500 DEPRECATED(Flags.DEPRECATED),
501 HASINIT(Flags.HASINIT),
502 IMPLICIT_CLASS(Flags.IMPLICIT_CLASS),
503 BLOCK(Flags.BLOCK),
504 FROM_SOURCE(Flags.FROM_SOURCE),
505 ENUM(Flags.ENUM),
506 MANDATED(Flags.MANDATED),
507 NOOUTERTHIS(Flags.NOOUTERTHIS),
508 EXISTS(Flags.EXISTS),
509 COMPOUND(Flags.COMPOUND),
510 CLASS_SEEN(Flags.CLASS_SEEN),
511 SOURCE_SEEN(Flags.SOURCE_SEEN),
512 LOCKED(Flags.LOCKED),
513 UNATTRIBUTED(Flags.UNATTRIBUTED),
514 ANONCONSTR(Flags.ANONCONSTR),
515 ACYCLIC(Flags.ACYCLIC),
516 PARAMETER(Flags.PARAMETER),
517 VARARGS(Flags.VARARGS),
518 ACYCLIC_ANN(Flags.ACYCLIC_ANN),
519 GENERATEDCONSTR(Flags.GENERATEDCONSTR),
520 HYPOTHETICAL(Flags.HYPOTHETICAL),
521 PROPRIETARY(Flags.PROPRIETARY),
533 AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
534 SYSTEM_MODULE(Flags.SYSTEM_MODULE),
535 DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
536 DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
537 HAS_RESOURCE(Flags.HAS_RESOURCE),
538 // Bit 48 is currently available
539 ANONCONSTR_BASED(Flags.ANONCONSTR_BASED),
540 NAME_FILLED(Flags.NAME_FILLED),
541 PREVIEW_API(Flags.PREVIEW_API),
542 PREVIEW_REFLECTIVE(Flags.PREVIEW_REFLECTIVE),
543 MATCH_BINDING(Flags.MATCH_BINDING),
544 MATCH_BINDING_TO_OUTER(Flags.MATCH_BINDING_TO_OUTER),
545 RECORD(Flags.RECORD),
546 RECOVERABLE(Flags.RECOVERABLE),
547 SEALED(Flags.SEALED),
548 NON_SEALED(Flags.NON_SEALED) {
549 @Override
550 public String toString() {
551 return "non-sealed";
552 }
553 };
554
555 Flag(long flag) {
556 this.value = flag;
557 this.lowercaseName = StringUtils.toLowerCase(name());
558 }
559
560 @Override
561 public String toString() {
562 return lowercaseName;
563 }
564
565 final long value;
566 final String lowercaseName;
567 }
568
569 }
|
88
89 /* Flag that marks a symbol synthetic, added in classfile v49.0. */
90 public static final int SYNTHETIC = 1<<12;
91
92 /** Flag that marks attribute interfaces, added in classfile v49.0. */
93 public static final int ANNOTATION = 1<<13;
94
95 /** An enumeration type or an enumeration constant, added in
96 * classfile v49.0. */
97 public static final int ENUM = 1<<14;
98
99 /** Added in SE8, represents constructs implicitly declared in source. */
100 public static final int MANDATED = 1<<15;
101
102 public static final int StandardFlags = 0x0fff;
103
104 // Because the following access flags are overloaded with other
105 // bit positions, we translate them when reading and writing class
106 // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
107 // for example.
108 public static final int ACC_IDENTITY = 0x0020;
109 public static final int ACC_BRIDGE = 0x0040;
110 public static final int ACC_VARARGS = 0x0080;
111 public static final int ACC_STRICT = 0x0800;
112 public static final int ACC_MODULE = 0x8000;
113
114 /* ***************************************
115 * Internal compiler flags (no bits in the lower 16).
116 *****************************************/
117
118 /** Flag is set if symbol is deprecated. See also DEPRECATED_REMOVAL.
119 */
120 public static final int DEPRECATED = 1<<17;
121
122 /** Flag is set for a variable symbol if the variable's definition
123 * has an initializer part.
124 */
125 public static final int HASINIT = 1<<18;
126
127 /** Flag is set for a class or interface whose instances have identity
128 * i.e. any concrete class not declared with the modifier `value'
129 * (a) abstract class not declared `value'
130 * (b) older class files with ACC_SUPER bit set
131 */
132 public static final int IDENTITY_TYPE = 1<<19;
133
134 /** Class is an implicitly declared top level class.
135 */
136 public static final int IMPLICIT_CLASS = 1<<23;
137
138 /** Flag is set for compiler-generated anonymous method symbols
139 * that `own' an initializer block.
140 */
141 public static final int BLOCK = 1<<20;
142
143 /** Marks a type as a value class */
144 public static final int VALUE_CLASS = 1<<20;
145
146 /** Flag is set for ClassSymbols that are being compiled from source.
147 */
148 public static final int FROM_SOURCE = 1<<21; //ClassSymbols
149
150 /** Flag is set for nested classes that do not access instance members
151 * or `this' of an outer class and therefore don't need to be passed
152 * a this$n reference. This value is currently set only for anonymous
153 * classes in superclass constructor calls.
154 * todo: use this value for optimizing away this$n parameters in
155 * other cases.
156 */
157 public static final int NOOUTERTHIS = 1<<22;
158
159 /** Flag is set for package symbols if a package has a member or
160 * directory and therefore exists.
161 */
162 public static final int EXISTS = 1<<23;
163
164 /** Flag is set for compiler-generated compound classes
165 * representing multiple variable bounds
316 /**
317 * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
318 */
319 public static final long HAS_RESOURCE = 1L<<52; //PackageSymbols only
320
321 /**
322 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
323 */
324 public static final long NAME_FILLED = 1L<<52; //ParamSymbols only
325
326 /**
327 * Flag to indicate the given ModuleSymbol is a system module.
328 */
329 public static final long SYSTEM_MODULE = 1L<<53; //ModuleSymbols only
330
331 /**
332 * Flag to indicate the given ClassSymbol is a value based.
333 */
334 public static final long VALUE_BASED = 1L<<53; //ClassSymbols only
335
336 /**
337 * Flag to indicate the given ClassSymbol is a value based.
338 */
339 public static final long MIGRATED_VALUE_CLASS = 1L<<57; //ClassSymbols only
340
341 /**
342 * Flag to indicate the given symbol has a @Deprecated annotation.
343 */
344 public static final long DEPRECATED_ANNOTATION = 1L<<54;
345
346 /**
347 * Flag to indicate the given symbol has been deprecated and marked for removal.
348 */
349 public static final long DEPRECATED_REMOVAL = 1L<<55;
350
351 /**
352 * Flag to indicate the API element in question is for a preview API.
353 */
354 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
355
356 /**
357 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
358 */
359 public static final long ANONCONSTR_BASED = 1L<<57;
360
398 /** Flag is set for compiler-generated record members, it could be applied to
399 * accessors and fields
400 */
401 public static final int GENERATED_MEMBER = 1<<24; // MethodSymbols and VarSymbols
402
403 /**
404 * Flag to indicate sealed class/interface declaration.
405 */
406 public static final long SEALED = 1L<<62; // ClassSymbols
407
408 /**
409 * Flag to indicate restricted method declaration.
410 */
411 public static final long RESTRICTED = 1L<<62; // MethodSymbols
412
413 /**
414 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
415 */
416 public static final long NON_SEALED = 1L<<63; // ClassSymbols
417
418 /**
419 * Flag to indicate that a field is strict
420 */
421 public static final long STRICT = 1L<<53; // VarSymbols
422
423 /**
424 * Describe modifier flags as they might appear in source code, i.e.,
425 * separated by spaces and in the order suggested by JLS 8.1.1.
426 */
427 public static String toSource(long flags) {
428 return asModifierSet(flags).stream()
429 .map(Modifier::toString)
430 .collect(Collectors.joining(" "));
431 }
432
433 /** Modifier masks.
434 */
435 public static final int
436 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
437 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC | IDENTITY_TYPE,
438 StaticLocalClassFlags = LocalClassFlags | STATIC | INTERFACE,
439 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
440 MemberStaticClassFlags = MemberClassFlags | STATIC,
441 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
442 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
443 VarFlags = AccessFlags | FINAL | STATIC |
444 VOLATILE | TRANSIENT | ENUM,
445 ConstructorFlags = AccessFlags,
446 InterfaceMethodFlags = ABSTRACT | PUBLIC,
447 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
448 SYNCHRONIZED | FINAL | STRICTFP,
449 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
450 SYNCHRONIZED | FINAL | STRICTFP;
451 public static final long
452 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
453 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
454 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
455 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
456 ExtendedLocalClassFlags = (long) LocalClassFlags | VALUE_CLASS,
457 ExtendedStaticLocalClassFlags = (long) StaticLocalClassFlags | VALUE_CLASS,
458 ExtendedVarFlags = (long) VarFlags | STRICT,
459 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
460 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
461 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
462 LocalVarFlags = FINAL | PARAMETER,
463 ReceiverParamFlags = PARAMETER;
464
465 public static Set<Modifier> asModifierSet(long flags) {
466 Set<Modifier> modifiers = modifierSets.get(flags);
467 if (modifiers == null) {
468 modifiers = java.util.EnumSet.noneOf(Modifier.class);
469 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
470 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
471 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
472 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
473 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
474 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
475 if (0 != (flags & NON_SEALED))
476 modifiers.add(Modifier.NON_SEALED);
477 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
478 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
479 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
480 if (0 != (flags & SYNCHRONIZED))
481 modifiers.add(Modifier.SYNCHRONIZED);
482 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
483 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
484 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
485 if (0 != (flags & VALUE_CLASS)) modifiers.add(Modifier.VALUE);
486 modifiers = Collections.unmodifiableSet(modifiers);
487 modifierSets.put(flags, modifiers);
488 }
489 return modifiers;
490 }
491
492 // Cache of modifier sets.
493 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
494
495 public static boolean isStatic(Symbol symbol) {
496 return (symbol.flags() & STATIC) != 0;
497 }
498
499 public static boolean isEnum(Symbol symbol) {
500 return (symbol.flags() & ENUM) != 0;
501 }
502
503 public static boolean isConstant(Symbol.VarSymbol symbol) {
504 return symbol.getConstValue() != null;
505 }
506
507 public enum Flag {
508 PUBLIC(Flags.PUBLIC),
509 PRIVATE(Flags.PRIVATE),
510 PROTECTED(Flags.PROTECTED),
511 STATIC(Flags.STATIC),
512 FINAL(Flags.FINAL),
513 SYNCHRONIZED(Flags.SYNCHRONIZED),
514 VOLATILE(Flags.VOLATILE),
515 TRANSIENT(Flags.TRANSIENT),
516 NATIVE(Flags.NATIVE),
517 INTERFACE(Flags.INTERFACE),
518 ABSTRACT(Flags.ABSTRACT),
519 DEFAULT(Flags.DEFAULT),
520 STRICTFP(Flags.STRICTFP),
521 BRIDGE(Flags.BRIDGE),
522 SYNTHETIC(Flags.SYNTHETIC),
523 ANNOTATION(Flags.ANNOTATION),
524 DEPRECATED(Flags.DEPRECATED),
525 HASINIT(Flags.HASINIT),
526 IDENTITY_TYPE(Flags.IDENTITY_TYPE) {
527 @Override
528 public String toString() {
529 return "identity";
530 }
531 },
532 VALUE(Flags.VALUE_CLASS),
533 IMPLICIT_CLASS(Flags.IMPLICIT_CLASS),
534 BLOCK(Flags.BLOCK),
535 FROM_SOURCE(Flags.FROM_SOURCE),
536 ENUM(Flags.ENUM),
537 MANDATED(Flags.MANDATED),
538 NOOUTERTHIS(Flags.NOOUTERTHIS),
539 EXISTS(Flags.EXISTS),
540 COMPOUND(Flags.COMPOUND),
541 CLASS_SEEN(Flags.CLASS_SEEN),
542 SOURCE_SEEN(Flags.SOURCE_SEEN),
543 LOCKED(Flags.LOCKED),
544 UNATTRIBUTED(Flags.UNATTRIBUTED),
545 ANONCONSTR(Flags.ANONCONSTR),
546 ACYCLIC(Flags.ACYCLIC),
547 PARAMETER(Flags.PARAMETER),
548 VARARGS(Flags.VARARGS),
549 ACYCLIC_ANN(Flags.ACYCLIC_ANN),
550 GENERATEDCONSTR(Flags.GENERATEDCONSTR),
551 HYPOTHETICAL(Flags.HYPOTHETICAL),
552 PROPRIETARY(Flags.PROPRIETARY),
564 AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
565 SYSTEM_MODULE(Flags.SYSTEM_MODULE),
566 DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
567 DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
568 HAS_RESOURCE(Flags.HAS_RESOURCE),
569 // Bit 48 is currently available
570 ANONCONSTR_BASED(Flags.ANONCONSTR_BASED),
571 NAME_FILLED(Flags.NAME_FILLED),
572 PREVIEW_API(Flags.PREVIEW_API),
573 PREVIEW_REFLECTIVE(Flags.PREVIEW_REFLECTIVE),
574 MATCH_BINDING(Flags.MATCH_BINDING),
575 MATCH_BINDING_TO_OUTER(Flags.MATCH_BINDING_TO_OUTER),
576 RECORD(Flags.RECORD),
577 RECOVERABLE(Flags.RECOVERABLE),
578 SEALED(Flags.SEALED),
579 NON_SEALED(Flags.NON_SEALED) {
580 @Override
581 public String toString() {
582 return "non-sealed";
583 }
584 },
585 STRICT(Flags.STRICT);
586
587 Flag(long flag) {
588 this.value = flag;
589 this.lowercaseName = StringUtils.toLowerCase(name());
590 }
591
592 @Override
593 public String toString() {
594 return lowercaseName;
595 }
596
597 final long value;
598 final String lowercaseName;
599 }
600
601 }
|