1 /*
2 * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
108 public static final int ANNOTATION = 1<<13;
109
110 /** An enumeration type or an enumeration constant, added in
111 * classfile v49.0. */
112 @Use({FlagTarget.CLASS, FlagTarget.VARIABLE})
113 public static final int ENUM = 1<<14;
114
115 /** Added in SE8, represents constructs implicitly declared in source. */
116 @Use({FlagTarget.MODULE, FlagTarget.VARIABLE})
117 public static final int MANDATED = 1<<15;
118
119 @NotFlag
120 public static final int StandardFlags = 0x0fff;
121
122 // Because the following access flags are overloaded with other
123 // bit positions, we translate them when reading and writing class
124 // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
125 // for example.
126 @Use({FlagTarget.CLASS})
127 @NoToStringValue
128 public static final int ACC_SUPER = 1<<5;
129 @Use({FlagTarget.METHOD})
130 @NoToStringValue
131 public static final int ACC_BRIDGE = 1<<6;
132 @Use({FlagTarget.METHOD})
133 @NoToStringValue
134 public static final int ACC_VARARGS = 1<<7;
135 @Use({FlagTarget.CLASS})
136 @NoToStringValue
137 public static final int ACC_MODULE = 1<<15;
138
139 /* ***************************************
140 * Internal compiler flags (no bits in the lower 16).
141 *****************************************/
142
143 /** Flag is set if symbol is deprecated. See also DEPRECATED_REMOVAL.
144 */
145 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
146 public static final int DEPRECATED = 1<<17;
147
148 /** Flag is set for a variable symbol if the variable's definition
149 * has an initializer part.
150 */
151 @Use({FlagTarget.VARIABLE})
152 public static final int HASINIT = 1<<18;
153
154 /** Class is an implicitly declared top level class.
155 */
156 @Use({FlagTarget.CLASS})
157 public static final int IMPLICIT_CLASS = 1<<19;
158
159 /** Flag is set for compiler-generated anonymous method symbols
160 * that `own' an initializer block.
161 */
162 @Use({FlagTarget.METHOD})
163 public static final int BLOCK = 1<<20;
164
165 /** Flag is set for ClassSymbols that are being compiled from source.
166 */
167 @Use({FlagTarget.CLASS})
168 public static final int FROM_SOURCE = 1<<21;
169
170 /** Flag is set for nested classes that do not access instance members
171 * or `this' of an outer class and therefore don't need to be passed
172 * a this$n reference. This value is currently set only for anonymous
173 * classes in superclass constructor calls.
174 * todo: use this value for optimizing away this$n parameters in
175 * other cases.
176 */
177 @Use({FlagTarget.CLASS, FlagTarget.VARIABLE})
178 public static final int NOOUTERTHIS = 1<<22;
179
180 /** Flag is set for package symbols if a package has a member or
181 * directory and therefore exists.
182 */
183 @Use({FlagTarget.CLASS, FlagTarget.PACKAGE})
379 public static final long HAS_RESOURCE = 1L<<52;
380
381 /**
382 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
383 */
384 @Use({FlagTarget.VARIABLE}) //ParamSymbols only
385 public static final long NAME_FILLED = 1L<<52;
386
387 /**
388 * Flag to indicate the given ModuleSymbol is a system module.
389 */
390 @Use({FlagTarget.MODULE})
391 public static final long SYSTEM_MODULE = 1L<<53;
392
393 /**
394 * Flag to indicate the given ClassSymbol is a value based.
395 */
396 @Use({FlagTarget.CLASS})
397 public static final long VALUE_BASED = 1L<<53;
398
399 /**
400 * Flag to indicate the given symbol has a @Deprecated annotation.
401 */
402 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
403 public static final long DEPRECATED_ANNOTATION = 1L<<54;
404
405 /**
406 * Flag to indicate the given symbol has been deprecated and marked for removal.
407 */
408 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
409 public static final long DEPRECATED_REMOVAL = 1L<<55;
410
411 /**
412 * Flag to indicate the API element in question is for a preview API.
413 */
414 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
415 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
416
417 /**
418 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
478
479 /**
480 * Flag to indicate parameters that require identity.
481 */
482 @Use({FlagTarget.VARIABLE}) //ParamSymbols only
483 public static final long REQUIRES_IDENTITY = 1L<<62;
484
485 /**
486 * Flag to indicate type annotations have been queued for field initializers.
487 */
488 @Use({FlagTarget.VARIABLE})
489 public static final long FIELD_INIT_TYPE_ANNOTATIONS_QUEUED = 1L<<53;
490
491 /**
492 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
493 */
494 @Use({FlagTarget.CLASS})
495 @CustomToStringValue("non-sealed")
496 public static final long NON_SEALED = 1L<<63; // part of ExtendedStandardFlags, cannot be reused
497
498 /**
499 * Describe modifier flags as they might appear in source code, i.e.,
500 * separated by spaces and in the order suggested by JLS 8.1.1.
501 */
502 public static String toSource(long flags) {
503 return asModifierSet(flags).stream()
504 .map(Modifier::toString)
505 .collect(Collectors.joining(" "));
506 }
507
508 /** Modifier masks.
509 */
510 @NotFlag
511 public static final int
512 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
513 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
514 StaticLocalFlags = LocalClassFlags | STATIC | INTERFACE,
515 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
516 MemberStaticClassFlags = MemberClassFlags | STATIC,
517 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
518 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
519 VarFlags = AccessFlags | FINAL | STATIC |
520 VOLATILE | TRANSIENT | ENUM,
521 ConstructorFlags = AccessFlags,
522 InterfaceMethodFlags = ABSTRACT | PUBLIC,
523 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
524 SYNCHRONIZED | FINAL | STRICTFP,
525 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
526 SYNCHRONIZED | FINAL | STRICTFP;
527 @NotFlag
528 public static final long
529 //NOTE: flags in ExtendedStandardFlags cannot be overlayed across Symbol kinds:
530 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED,
531 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED,
532 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED,
533 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED,
534 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED,
535 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
536 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
537 LocalVarFlags = FINAL | PARAMETER,
538 ReceiverParamFlags = PARAMETER;
539
540 public static Set<Modifier> asModifierSet(long flags) {
541 Set<Modifier> modifiers = modifierSets.get(flags);
542 if (modifiers == null) {
543 modifiers = java.util.EnumSet.noneOf(Modifier.class);
544 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
545 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
546 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
547 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
548 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
549 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
550 if (0 != (flags & NON_SEALED))
551 modifiers.add(Modifier.NON_SEALED);
552 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
553 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
554 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
555 if (0 != (flags & SYNCHRONIZED))
556 modifiers.add(Modifier.SYNCHRONIZED);
557 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
558 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
559 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
560 modifiers = Collections.unmodifiableSet(modifiers);
561 modifierSets.put(flags, modifiers);
562 }
563 return modifiers;
564 }
565
566 // Cache of modifier sets.
567 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
568
569 public static boolean isStatic(Symbol symbol) {
570 return (symbol.flags() & STATIC) != 0;
571 }
572
573 public static boolean isEnum(Symbol symbol) {
574 return (symbol.flags() & ENUM) != 0;
575 }
576
577 public static boolean isConstant(Symbol.VarSymbol symbol) {
578 return symbol.getConstValue() != null;
579 }
|
1 /*
2 * Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
108 public static final int ANNOTATION = 1<<13;
109
110 /** An enumeration type or an enumeration constant, added in
111 * classfile v49.0. */
112 @Use({FlagTarget.CLASS, FlagTarget.VARIABLE})
113 public static final int ENUM = 1<<14;
114
115 /** Added in SE8, represents constructs implicitly declared in source. */
116 @Use({FlagTarget.MODULE, FlagTarget.VARIABLE})
117 public static final int MANDATED = 1<<15;
118
119 @NotFlag
120 public static final int StandardFlags = 0x0fff;
121
122 // Because the following access flags are overloaded with other
123 // bit positions, we translate them when reading and writing class
124 // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
125 // for example.
126 @Use({FlagTarget.CLASS})
127 @NoToStringValue
128 public static final int ACC_IDENTITY = 1<<5;
129 @Use({FlagTarget.METHOD})
130 @NoToStringValue
131 public static final int ACC_BRIDGE = 1<<6;
132 @Use({FlagTarget.METHOD})
133 @NoToStringValue
134 public static final int ACC_VARARGS = 1<<7;
135 @Use({FlagTarget.VARIABLE})
136 @NoToStringValue
137 public static final int ACC_STRICT = 1<<11;
138 @Use({FlagTarget.CLASS})
139 @NoToStringValue
140 public static final int ACC_MODULE = 1<<15;
141
142 /* ***************************************
143 * Internal compiler flags (no bits in the lower 16).
144 *****************************************/
145
146 /** Flag is set if symbol is deprecated. See also DEPRECATED_REMOVAL.
147 */
148 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
149 public static final int DEPRECATED = 1<<17;
150
151 /** Flag is set for a variable symbol if the variable's definition
152 * has an initializer part.
153 */
154 @Use({FlagTarget.VARIABLE})
155 public static final int HASINIT = 1<<18;
156
157 /** Flag is set for a class or interface whose instances have identity
158 * i.e. any concrete class not declared with the modifier `value'
159 * (a) abstract class not declared `value'
160 * (b) older class files with ACC_SUPER bit set
161 */
162 @Use({FlagTarget.CLASS})
163 public static final int IDENTITY_TYPE = 1<<18;
164
165 /** Class is an implicitly declared top level class.
166 */
167 @Use({FlagTarget.CLASS})
168 public static final int IMPLICIT_CLASS = 1<<19;
169
170 /** Flag is set for compiler-generated anonymous method symbols
171 * that `own' an initializer block.
172 */
173 @Use({FlagTarget.METHOD})
174 public static final int BLOCK = 1<<21;
175
176 /** Marks a type as a value class */
177 @Use({FlagTarget.CLASS})
178 public static final int VALUE_CLASS = 1<<20;
179
180 /** Flag is set for ClassSymbols that are being compiled from source.
181 */
182 @Use({FlagTarget.CLASS})
183 public static final int FROM_SOURCE = 1<<21;
184
185 /** Flag is set for nested classes that do not access instance members
186 * or `this' of an outer class and therefore don't need to be passed
187 * a this$n reference. This value is currently set only for anonymous
188 * classes in superclass constructor calls.
189 * todo: use this value for optimizing away this$n parameters in
190 * other cases.
191 */
192 @Use({FlagTarget.CLASS, FlagTarget.VARIABLE})
193 public static final int NOOUTERTHIS = 1<<22;
194
195 /** Flag is set for package symbols if a package has a member or
196 * directory and therefore exists.
197 */
198 @Use({FlagTarget.CLASS, FlagTarget.PACKAGE})
394 public static final long HAS_RESOURCE = 1L<<52;
395
396 /**
397 * Flag to indicate the given ParamSymbol has a user-friendly name filled.
398 */
399 @Use({FlagTarget.VARIABLE}) //ParamSymbols only
400 public static final long NAME_FILLED = 1L<<52;
401
402 /**
403 * Flag to indicate the given ModuleSymbol is a system module.
404 */
405 @Use({FlagTarget.MODULE})
406 public static final long SYSTEM_MODULE = 1L<<53;
407
408 /**
409 * Flag to indicate the given ClassSymbol is a value based.
410 */
411 @Use({FlagTarget.CLASS})
412 public static final long VALUE_BASED = 1L<<53;
413
414 /**
415 * Flag to indicate the given ClassSymbol is a value based.
416 */
417 @Use({FlagTarget.CLASS})
418 public static final long MIGRATED_VALUE_CLASS = 1L<<57; //ClassSymbols only
419
420 /**
421 * Flag to indicate the given symbol has a @Deprecated annotation.
422 */
423 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
424 public static final long DEPRECATED_ANNOTATION = 1L<<54;
425
426 /**
427 * Flag to indicate the given symbol has been deprecated and marked for removal.
428 */
429 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
430 public static final long DEPRECATED_REMOVAL = 1L<<55;
431
432 /**
433 * Flag to indicate the API element in question is for a preview API.
434 */
435 @Use({FlagTarget.CLASS, FlagTarget.METHOD, FlagTarget.MODULE, FlagTarget.PACKAGE, FlagTarget.TYPE_VAR, FlagTarget.VARIABLE})
436 public static final long PREVIEW_API = 1L<<56; //any Symbol kind
437
438 /**
439 * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
499
500 /**
501 * Flag to indicate parameters that require identity.
502 */
503 @Use({FlagTarget.VARIABLE}) //ParamSymbols only
504 public static final long REQUIRES_IDENTITY = 1L<<62;
505
506 /**
507 * Flag to indicate type annotations have been queued for field initializers.
508 */
509 @Use({FlagTarget.VARIABLE})
510 public static final long FIELD_INIT_TYPE_ANNOTATIONS_QUEUED = 1L<<53;
511
512 /**
513 * Flag to indicate that the class/interface was declared with the non-sealed modifier.
514 */
515 @Use({FlagTarget.CLASS})
516 @CustomToStringValue("non-sealed")
517 public static final long NON_SEALED = 1L<<63; // part of ExtendedStandardFlags, cannot be reused
518
519 /**
520 * Flag to indicate that a field is strict
521 */
522 @Use({FlagTarget.VARIABLE})
523 public static final long STRICT = 1L<<19; // VarSymbols
524
525 /**
526 * Describe modifier flags as they might appear in source code, i.e.,
527 * separated by spaces and in the order suggested by JLS 8.1.1.
528 */
529 public static String toSource(long flags) {
530 return asModifierSet(flags).stream()
531 .map(Modifier::toString)
532 .collect(Collectors.joining(" "));
533 }
534
535 /** Modifier masks.
536 */
537 @NotFlag
538 public static final int
539 AccessFlags = PUBLIC | PROTECTED | PRIVATE,
540 LocalClassFlags = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC | IDENTITY_TYPE,
541 StaticLocalClassFlags = LocalClassFlags | STATIC | INTERFACE,
542 MemberClassFlags = LocalClassFlags | INTERFACE | AccessFlags,
543 MemberStaticClassFlags = MemberClassFlags | STATIC,
544 ClassFlags = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
545 InterfaceVarFlags = FINAL | STATIC | PUBLIC,
546 VarFlags = AccessFlags | FINAL | STATIC |
547 VOLATILE | TRANSIENT | ENUM,
548 ConstructorFlags = AccessFlags,
549 InterfaceMethodFlags = ABSTRACT | PUBLIC,
550 MethodFlags = AccessFlags | ABSTRACT | STATIC | NATIVE |
551 SYNCHRONIZED | FINAL | STRICTFP,
552 RecordMethodFlags = AccessFlags | ABSTRACT | STATIC |
553 SYNCHRONIZED | FINAL | STRICTFP;
554 @NotFlag
555 public static final long
556 //NOTE: flags in ExtendedStandardFlags cannot be overlayed across Symbol kinds:
557 ExtendedStandardFlags = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
558 ExtendedMemberClassFlags = (long)MemberClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
559 ExtendedMemberStaticClassFlags = (long) MemberStaticClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
560 ExtendedClassFlags = (long)ClassFlags | SEALED | NON_SEALED | VALUE_CLASS,
561 ExtendedLocalClassFlags = (long) LocalClassFlags | VALUE_CLASS,
562 ExtendedStaticLocalClassFlags = (long) StaticLocalClassFlags | VALUE_CLASS,
563 ValueFieldFlags = (long) VarFlags | STRICT | FINAL,
564 ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED | VALUE_CLASS,
565 InterfaceMethodMask = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
566 AnnotationTypeElementMask = ABSTRACT | PUBLIC,
567 LocalVarFlags = FINAL | PARAMETER,
568 ReceiverParamFlags = PARAMETER;
569
570 public static Set<Modifier> asModifierSet(long flags) {
571 Set<Modifier> modifiers = modifierSets.get(flags);
572 if (modifiers == null) {
573 modifiers = java.util.EnumSet.noneOf(Modifier.class);
574 if (0 != (flags & PUBLIC)) modifiers.add(Modifier.PUBLIC);
575 if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
576 if (0 != (flags & PRIVATE)) modifiers.add(Modifier.PRIVATE);
577 if (0 != (flags & ABSTRACT)) modifiers.add(Modifier.ABSTRACT);
578 if (0 != (flags & STATIC)) modifiers.add(Modifier.STATIC);
579 if (0 != (flags & SEALED)) modifiers.add(Modifier.SEALED);
580 if (0 != (flags & NON_SEALED))
581 modifiers.add(Modifier.NON_SEALED);
582 if (0 != (flags & FINAL)) modifiers.add(Modifier.FINAL);
583 if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
584 if (0 != (flags & VOLATILE)) modifiers.add(Modifier.VOLATILE);
585 if (0 != (flags & SYNCHRONIZED))
586 modifiers.add(Modifier.SYNCHRONIZED);
587 if (0 != (flags & NATIVE)) modifiers.add(Modifier.NATIVE);
588 if (0 != (flags & STRICTFP)) modifiers.add(Modifier.STRICTFP);
589 if (0 != (flags & DEFAULT)) modifiers.add(Modifier.DEFAULT);
590 if (0 != (flags & VALUE_CLASS)) modifiers.add(Modifier.VALUE);
591 modifiers = Collections.unmodifiableSet(modifiers);
592 modifierSets.put(flags, modifiers);
593 }
594 return modifiers;
595 }
596
597 // Cache of modifier sets.
598 private static final Map<Long, Set<Modifier>> modifierSets = new ConcurrentHashMap<>(64);
599
600 public static boolean isStatic(Symbol symbol) {
601 return (symbol.flags() & STATIC) != 0;
602 }
603
604 public static boolean isEnum(Symbol symbol) {
605 return (symbol.flags() & ENUM) != 0;
606 }
607
608 public static boolean isConstant(Symbol.VarSymbol symbol) {
609 return symbol.getConstValue() != null;
610 }
|