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
310 /**
311 * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
312 */
313 public static final long HAS_RESOURCE = 1L<<52; //PackageSymbols only
314
315 /**
316 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
317 */
318 public static final long NAME_FILLED = 1L<<52; //ParamSymbols only
319
320 /**
321 * Flag to indicate the given ModuleSymbol is a system module.
322 */
323 public static final long SYSTEM_MODULE = 1L<<53; //ModuleSymbols only
324
325 /**
326 * Flag to indicate the given ClassSymbol is a value based.
327 */
328 public static final long VALUE_BASED = 1L<<53; //ClassSymbols only
329
330 /**
331 * Flag to indicate the given symbol has a @Deprecated annotation.
332 */
333 public static final long DEPRECATED_ANNOTATION = 1L<<54;
334
335 /**
336 * Flag to indicate the given symbol has been deprecated and marked for removal.
337 */
338 public static final long DEPRECATED_REMOVAL = 1L<<55;
339
340 /**
341 * Flag to indicate the API element in question is for a preview API.
342 */
343 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
344
345 /**
346 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
347 */
348 public static final long ANONCONSTR_BASED = 1L<<57;
349
397 /**
398 * Flag to indicate restricted method declaration.
399 */
400 public static final long RESTRICTED = 1L<<62; // MethodSymbols
401
402 /**
403 * Flag to indicate parameters that require identity.
404 */
405 public static final long REQUIRES_IDENTITY = 1L<<62; // VarSymbols (parameters)
406
407 /**
408 * Flag to indicate type annotations have been queued for field initializers.
409 */
410 public static final long FIELD_INIT_TYPE_ANNOTATIONS_QUEUED = 1L<<53; // VarSymbols
411
412 /**
413 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
414 */
415 public static final long NON_SEALED = 1L<<63; // ClassSymbols
416
417 /**
418 * Describe modifier flags as they might appear in source code, i.e.,
419 * separated by spaces and in the order suggested by JLS 8.1.1.
420 */
421 public static String toSource(long flags) {
422 return asModifierSet(flags).stream()
423 .map(Modifier::toString)
424 .collect(Collectors.joining(" "));
425 }
426
427 /** Modifier masks.
428 */
429 public static final int
430 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
431 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
432 StaticLocalFlags = LocalClassFlags | STATIC | INTERFACE,
433 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
434 MemberStaticClassFlags = MemberClassFlags | STATIC,
435 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
436 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
437 VarFlags = AccessFlags | FINAL | STATIC |
438 VOLATILE | TRANSIENT | ENUM,
439 ConstructorFlags = AccessFlags,
440 InterfaceMethodFlags = ABSTRACT | PUBLIC,
441 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
442 SYNCHRONIZED | FINAL | STRICTFP,
443 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
444 SYNCHRONIZED | FINAL | STRICTFP;
445 public static final long
446 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED,
447 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED,
448 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED,
449 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED,
450 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED,
451 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
452 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
453 LocalVarFlags = FINAL | PARAMETER,
454 ReceiverParamFlags = PARAMETER;
455
456 public static Set<Modifier> asModifierSet(long flags) {
457 Set<Modifier> modifiers = modifierSets.get(flags);
458 if (modifiers == null) {
459 modifiers = java.util.EnumSet.noneOf(Modifier.class);
460 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
461 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
462 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
463 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
464 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
465 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
466 if (0 != (flags & NON_SEALED))
467 modifiers.add(Modifier.NON_SEALED);
468 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
469 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
470 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
471 if (0 != (flags & SYNCHRONIZED))
472 modifiers.add(Modifier.SYNCHRONIZED);
473 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
474 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
475 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
476 modifiers = Collections.unmodifiableSet(modifiers);
477 modifierSets.put(flags, modifiers);
478 }
479 return modifiers;
480 }
481
482 // Cache of modifier sets.
483 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
484
485 public static boolean isStatic(Symbol symbol) {
486 return (symbol.flags() & STATIC) != 0;
487 }
488
489 public static boolean isEnum(Symbol symbol) {
490 return (symbol.flags() & ENUM) != 0;
491 }
492
493 public static boolean isConstant(Symbol.VarSymbol symbol) {
494 return symbol.getConstValue() != null;
495 }
496
497
498 public enum Flag {
499 PUBLIC(Flags.PUBLIC),
500 PRIVATE(Flags.PRIVATE),
501 PROTECTED(Flags.PROTECTED),
502 STATIC(Flags.STATIC),
503 FINAL(Flags.FINAL),
504 SYNCHRONIZED(Flags.SYNCHRONIZED),
505 VOLATILE(Flags.VOLATILE),
506 TRANSIENT(Flags.TRANSIENT),
507 NATIVE(Flags.NATIVE),
508 INTERFACE(Flags.INTERFACE),
509 ABSTRACT(Flags.ABSTRACT),
510 DEFAULT(Flags.DEFAULT),
511 STRICTFP(Flags.STRICTFP),
512 BRIDGE(Flags.BRIDGE),
513 SYNTHETIC(Flags.SYNTHETIC),
514 ANNOTATION(Flags.ANNOTATION),
515 DEPRECATED(Flags.DEPRECATED),
516 HASINIT(Flags.HASINIT),
517 IMPLICIT_CLASS(Flags.IMPLICIT_CLASS),
518 BLOCK(Flags.BLOCK),
519 FROM_SOURCE(Flags.FROM_SOURCE),
520 ENUM(Flags.ENUM),
521 MANDATED(Flags.MANDATED),
522 NOOUTERTHIS(Flags.NOOUTERTHIS),
523 EXISTS(Flags.EXISTS),
524 COMPOUND(Flags.COMPOUND),
525 CLASS_SEEN(Flags.CLASS_SEEN),
526 SOURCE_SEEN(Flags.SOURCE_SEEN),
527 LOCKED(Flags.LOCKED),
528 UNATTRIBUTED(Flags.UNATTRIBUTED),
529 ANONCONSTR(Flags.ANONCONSTR),
530 ACYCLIC(Flags.ACYCLIC),
531 PARAMETER(Flags.PARAMETER),
532 VARARGS(Flags.VARARGS),
533 ACYCLIC_ANN(Flags.ACYCLIC_ANN),
534 GENERATEDCONSTR(Flags.GENERATEDCONSTR),
535 HYPOTHETICAL(Flags.HYPOTHETICAL),
536 PROPRIETARY(Flags.PROPRIETARY),
548 AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
549 SYSTEM_MODULE(Flags.SYSTEM_MODULE),
550 DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
551 DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
552 HAS_RESOURCE(Flags.HAS_RESOURCE),
553 // Bit 48 is currently available
554 ANONCONSTR_BASED(Flags.ANONCONSTR_BASED),
555 NAME_FILLED(Flags.NAME_FILLED),
556 PREVIEW_API(Flags.PREVIEW_API),
557 PREVIEW_REFLECTIVE(Flags.PREVIEW_REFLECTIVE),
558 MATCH_BINDING(Flags.MATCH_BINDING),
559 MATCH_BINDING_TO_OUTER(Flags.MATCH_BINDING_TO_OUTER),
560 RECORD(Flags.RECORD),
561 RECOVERABLE(Flags.RECOVERABLE),
562 SEALED(Flags.SEALED),
563 NON_SEALED(Flags.NON_SEALED) {
564 @Override
565 public String toString() {
566 return "non-sealed";
567 }
568 };
569
570 Flag(long flag) {
571 this.value = flag;
572 this.lowercaseName = StringUtils.toLowerCase(name());
573 }
574
575 @Override
576 public String toString() {
577 return lowercaseName;
578 }
579
580 final long value;
581 final String lowercaseName;
582 }
583
584 }
|
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
321 /**
322 * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
323 */
324 public static final long HAS_RESOURCE = 1L<<52; //PackageSymbols only
325
326 /**
327 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
328 */
329 public static final long NAME_FILLED = 1L<<52; //ParamSymbols only
330
331 /**
332 * Flag to indicate the given ModuleSymbol is a system module.
333 */
334 public static final long SYSTEM_MODULE = 1L<<53; //ModuleSymbols only
335
336 /**
337 * Flag to indicate the given ClassSymbol is a value based.
338 */
339 public static final long VALUE_BASED = 1L<<53; //ClassSymbols only
340
341 /**
342 * Flag to indicate the given ClassSymbol is a value based.
343 */
344 public static final long MIGRATED_VALUE_CLASS = 1L<<57; //ClassSymbols only
345
346 /**
347 * Flag to indicate the given symbol has a @Deprecated annotation.
348 */
349 public static final long DEPRECATED_ANNOTATION = 1L<<54;
350
351 /**
352 * Flag to indicate the given symbol has been deprecated and marked for removal.
353 */
354 public static final long DEPRECATED_REMOVAL = 1L<<55;
355
356 /**
357 * Flag to indicate the API element in question is for a preview API.
358 */
359 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
360
361 /**
362 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
363 */
364 public static final long ANONCONSTR_BASED = 1L<<57;
365
413 /**
414 * Flag to indicate restricted method declaration.
415 */
416 public static final long RESTRICTED = 1L<<62; // MethodSymbols
417
418 /**
419 * Flag to indicate parameters that require identity.
420 */
421 public static final long REQUIRES_IDENTITY = 1L<<62; // VarSymbols (parameters)
422
423 /**
424 * Flag to indicate type annotations have been queued for field initializers.
425 */
426 public static final long FIELD_INIT_TYPE_ANNOTATIONS_QUEUED = 1L<<53; // VarSymbols
427
428 /**
429 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
430 */
431 public static final long NON_SEALED = 1L<<63; // ClassSymbols
432
433 /**
434 * Flag to indicate that a class has at least one strict field
435 */
436 public static final long HAS_STRICT = 1L<<52; // ClassSymbols, temporary hack
437
438 /**
439 * Flag to indicate that a field is strict
440 */
441 public static final long STRICT = 1L<<53; // VarSymbols
442
443 /**
444 * Describe modifier flags as they might appear in source code, i.e.,
445 * separated by spaces and in the order suggested by JLS 8.1.1.
446 */
447 public static String toSource(long flags) {
448 return asModifierSet(flags).stream()
449 .map(Modifier::toString)
450 .collect(Collectors.joining(" "));
451 }
452
453 /** Modifier masks.
454 */
455 public static final int
456 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
457 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC | IDENTITY_TYPE,
458 StaticLocalClassFlags = LocalClassFlags | STATIC | INTERFACE,
459 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
460 MemberStaticClassFlags = MemberClassFlags | STATIC,
461 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
462 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
463 VarFlags = AccessFlags | FINAL | STATIC |
464 VOLATILE | TRANSIENT | ENUM,
465 ConstructorFlags = AccessFlags,
466 InterfaceMethodFlags = ABSTRACT | PUBLIC,
467 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
468 SYNCHRONIZED | FINAL | STRICTFP,
469 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
470 SYNCHRONIZED | FINAL | STRICTFP;
471 public static final long
472 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
473 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
474 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
475 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
476 ExtendedLocalClassFlags = (long) LocalClassFlags | VALUE_CLASS,
477 ExtendedStaticLocalClassFlags = (long) StaticLocalClassFlags | VALUE_CLASS,
478 ValueFieldFlags = (long) VarFlags | STRICT | FINAL,
479 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
480 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
481 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
482 LocalVarFlags = FINAL | PARAMETER,
483 ReceiverParamFlags = PARAMETER;
484
485 public static Set<Modifier> asModifierSet(long flags) {
486 Set<Modifier> modifiers = modifierSets.get(flags);
487 if (modifiers == null) {
488 modifiers = java.util.EnumSet.noneOf(Modifier.class);
489 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
490 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
491 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
492 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
493 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
494 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
495 if (0 != (flags & NON_SEALED))
496 modifiers.add(Modifier.NON_SEALED);
497 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
498 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
499 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
500 if (0 != (flags & SYNCHRONIZED))
501 modifiers.add(Modifier.SYNCHRONIZED);
502 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
503 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
504 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
505 if (0 != (flags & VALUE_CLASS)) modifiers.add(Modifier.VALUE);
506 modifiers = Collections.unmodifiableSet(modifiers);
507 modifierSets.put(flags, modifiers);
508 }
509 return modifiers;
510 }
511
512 // Cache of modifier sets.
513 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
514
515 public static boolean isStatic(Symbol symbol) {
516 return (symbol.flags() & STATIC) != 0;
517 }
518
519 public static boolean isEnum(Symbol symbol) {
520 return (symbol.flags() & ENUM) != 0;
521 }
522
523 public static boolean isConstant(Symbol.VarSymbol symbol) {
524 return symbol.getConstValue() != null;
525 }
526
527 public enum Flag {
528 PUBLIC(Flags.PUBLIC),
529 PRIVATE(Flags.PRIVATE),
530 PROTECTED(Flags.PROTECTED),
531 STATIC(Flags.STATIC),
532 FINAL(Flags.FINAL),
533 SYNCHRONIZED(Flags.SYNCHRONIZED),
534 VOLATILE(Flags.VOLATILE),
535 TRANSIENT(Flags.TRANSIENT),
536 NATIVE(Flags.NATIVE),
537 INTERFACE(Flags.INTERFACE),
538 ABSTRACT(Flags.ABSTRACT),
539 DEFAULT(Flags.DEFAULT),
540 STRICTFP(Flags.STRICTFP),
541 BRIDGE(Flags.BRIDGE),
542 SYNTHETIC(Flags.SYNTHETIC),
543 ANNOTATION(Flags.ANNOTATION),
544 DEPRECATED(Flags.DEPRECATED),
545 HASINIT(Flags.HASINIT),
546 IDENTITY_TYPE(Flags.IDENTITY_TYPE) {
547 @Override
548 public String toString() {
549 return "identity";
550 }
551 },
552 VALUE(Flags.VALUE_CLASS),
553 IMPLICIT_CLASS(Flags.IMPLICIT_CLASS),
554 BLOCK(Flags.BLOCK),
555 FROM_SOURCE(Flags.FROM_SOURCE),
556 ENUM(Flags.ENUM),
557 MANDATED(Flags.MANDATED),
558 NOOUTERTHIS(Flags.NOOUTERTHIS),
559 EXISTS(Flags.EXISTS),
560 COMPOUND(Flags.COMPOUND),
561 CLASS_SEEN(Flags.CLASS_SEEN),
562 SOURCE_SEEN(Flags.SOURCE_SEEN),
563 LOCKED(Flags.LOCKED),
564 UNATTRIBUTED(Flags.UNATTRIBUTED),
565 ANONCONSTR(Flags.ANONCONSTR),
566 ACYCLIC(Flags.ACYCLIC),
567 PARAMETER(Flags.PARAMETER),
568 VARARGS(Flags.VARARGS),
569 ACYCLIC_ANN(Flags.ACYCLIC_ANN),
570 GENERATEDCONSTR(Flags.GENERATEDCONSTR),
571 HYPOTHETICAL(Flags.HYPOTHETICAL),
572 PROPRIETARY(Flags.PROPRIETARY),
584 AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
585 SYSTEM_MODULE(Flags.SYSTEM_MODULE),
586 DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
587 DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
588 HAS_RESOURCE(Flags.HAS_RESOURCE),
589 // Bit 48 is currently available
590 ANONCONSTR_BASED(Flags.ANONCONSTR_BASED),
591 NAME_FILLED(Flags.NAME_FILLED),
592 PREVIEW_API(Flags.PREVIEW_API),
593 PREVIEW_REFLECTIVE(Flags.PREVIEW_REFLECTIVE),
594 MATCH_BINDING(Flags.MATCH_BINDING),
595 MATCH_BINDING_TO_OUTER(Flags.MATCH_BINDING_TO_OUTER),
596 RECORD(Flags.RECORD),
597 RECOVERABLE(Flags.RECOVERABLE),
598 SEALED(Flags.SEALED),
599 NON_SEALED(Flags.NON_SEALED) {
600 @Override
601 public String toString() {
602 return "non-sealed";
603 }
604 },
605 STRICT(Flags.STRICT);
606
607 Flag(long flag) {
608 this.value = flag;
609 this.lowercaseName = StringUtils.toLowerCase(name());
610 }
611
612 @Override
613 public String toString() {
614 return lowercaseName;
615 }
616
617 final long value;
618 final String lowercaseName;
619 }
620
621 }
|