langtools/src/share/classes/com/sun/tools/javac/code/Flags.java
author vromero
Mon, 02 Sep 2013 22:38:36 +0100
changeset 19914 d86271bd430a
parent 18909 8f9fc5d876e4
child 19930 b6181c0049f3
permissions -rw-r--r--
8016177: structural most specific and stuckness Reviewed-by: jjg, vromero Contributed-by: maurizio.cimadamore@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.javac.code;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 12335
diff changeset
    28
import java.util.Collections;
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    29
import java.util.EnumSet;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.Map;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import java.util.Set;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 12335
diff changeset
    32
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import javax.lang.model.element.Modifier;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    35
import com.sun.tools.javac.util.Assert;
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    36
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
/** Access flags and other modifiers for Java classes and members.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    39
 *  <p><b>This is NOT part of any supported API.
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    40
 *  If you write code that depends on this, you do so at your own risk.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *  This code and its internal interfaces are subject to change or
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *  deletion without notice.</b>
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
public class Flags {
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
    private Flags() {} // uninstantiable
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    public static String toString(long flags) {
8625
6b51ef804d49 6639645: Modeling type implementing missing interfaces
jjg
parents: 8241
diff changeset
    49
        StringBuilder buf = new StringBuilder();
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    50
        String sep = "";
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    51
        for (Flag flag : asFlagSet(flags)) {
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    52
            buf.append(sep);
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    53
            buf.append(flag);
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    54
            sep = " ";
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    55
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        return buf.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    59
    public static EnumSet<Flag> asFlagSet(long flags) {
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    60
        EnumSet<Flag> flagSet = EnumSet.noneOf(Flag.class);
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    61
        for (Flag flag : Flag.values()) {
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    62
            if ((flags & flag.value) != 0) {
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    63
                flagSet.add(flag);
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    64
                flags &= ~flag.value;
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    65
            }
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    66
        }
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    67
        Assert.check(flags == 0, "Flags parameter contains unknown flags " + flags);
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    68
        return flagSet;
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    69
    }
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
    70
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    /* Standard Java flags.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
    73
    public static final int PUBLIC       = 1;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    public static final int PRIVATE      = 1<<1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    public static final int PROTECTED    = 1<<2;
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    public static final int STATIC       = 1<<3;
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    public static final int FINAL        = 1<<4;
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    public static final int SYNCHRONIZED = 1<<5;
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    public static final int VOLATILE     = 1<<6;
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    public static final int TRANSIENT    = 1<<7;
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    public static final int NATIVE       = 1<<8;
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    public static final int INTERFACE    = 1<<9;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    public static final int ABSTRACT     = 1<<10;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    public static final int STRICTFP     = 1<<11;
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    /* Flag that marks a symbol synthetic, added in classfile v49.0. */
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    public static final int SYNTHETIC    = 1<<12;
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    /** Flag that marks attribute interfaces, added in classfile v49.0. */
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    public static final int ANNOTATION   = 1<<13;
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    /** An enumeration type or an enumeration constant, added in
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     *  classfile v49.0. */
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    public static final int ENUM         = 1<<14;
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
15720
e61b2f7a5148 8006345: Report Synthesized Parameters in java.lang.reflect.Parameter API
mcimadamore
parents: 15385
diff changeset
    96
    /** Added in SE8, represents constructs implicitly declared in source. */
e61b2f7a5148 8006345: Report Synthesized Parameters in java.lang.reflect.Parameter API
mcimadamore
parents: 15385
diff changeset
    97
    public static final int MANDATED     = 1<<15;
e61b2f7a5148 8006345: Report Synthesized Parameters in java.lang.reflect.Parameter API
mcimadamore
parents: 15385
diff changeset
    98
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    public static final int StandardFlags = 0x0fff;
4870
a132763160d7 6919889: assorted position errors in compiler syntax trees
jjg
parents: 1264
diff changeset
   100
    public static final int ModifierFlags = StandardFlags & ~INTERFACE;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    // Because the following access flags are overloaded with other
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    // bit positions, we translate them when reading and writing class
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    // for example.
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    public static final int ACC_SUPER    = 0x0020;
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    public static final int ACC_BRIDGE   = 0x0040;
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    public static final int ACC_VARARGS  = 0x0080;
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
    /*****************************************
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     * Internal compiler flags (no bits in the lower 16).
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     *****************************************/
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    /** Flag is set if symbol is deprecated.
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
    public static final int DEPRECATED   = 1<<17;
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    /** Flag is set for a variable symbol if the variable's definition
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
     *  has an initializer part.
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
    public static final int HASINIT          = 1<<18;
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    /** Flag is set for compiler-generated anonymous method symbols
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     *  that `own' an initializer block.
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
    public static final int BLOCK            = 1<<20;
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    /** Flag is set for compiler-generated abstract methods that implement
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     *  an interface method (Miranda methods).
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    public static final int IPROXY           = 1<<21;
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    /** Flag is set for nested classes that do not access instance members
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     *  or `this' of an outer class and therefore don't need to be passed
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   135
     *  a this$n reference.  This value is currently set only for anonymous
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     *  classes in superclass constructor calls and only for pre 1.4 targets.
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   137
     *  todo: use this value for optimizing away this$n parameters in
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     *  other cases.
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
    public static final int NOOUTERTHIS  = 1<<22;
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    /** Flag is set for package symbols if a package has a member or
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     *  directory and therefore exists.
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    public static final int EXISTS           = 1<<23;
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    /** Flag is set for compiler-generated compound classes
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     *  representing multiple variable bounds
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    public static final int COMPOUND     = 1<<24;
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    /** Flag is set for class symbols if a class file was found for this class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
    public static final int CLASS_SEEN   = 1<<25;
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    /** Flag is set for class symbols if a source file was found for this
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     *  class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    public static final int SOURCE_SEEN  = 1<<26;
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    /* State flags (are reset during compilation).
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    /** Flag for class symbols is set and later re-set as a lock in
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     *  Enter to detect cycles in the superclass/superinterface
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     *  relations.  Similarly for constructor call cycle detection in
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
     *  Attr.
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    public static final int LOCKED           = 1<<27;
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    /** Flag for class symbols is set and later re-set to indicate that a class
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     *  has been entered but has not yet been attributed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    public static final int UNATTRIBUTED = 1<<28;
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    /** Flag for synthesized default constructors of anonymous classes.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    public static final int ANONCONSTR   = 1<<29;
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
    /** Flag for class symbols to indicate it has been checked and found
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     *  acyclic.
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    public static final int ACYCLIC          = 1<<30;
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    /** Flag that marks bridge methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
    public static final long BRIDGE          = 1L<<31;
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    /** Flag that marks formal parameters.
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
    public static final long PARAMETER   = 1L<<33;
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    /** Flag that marks varargs methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    public static final long VARARGS   = 1L<<34;
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
    /** Flag for annotation type symbols to indicate it has been
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     *  checked and found acyclic.
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    public static final long ACYCLIC_ANN      = 1L<<35;
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
    /** Flag that marks a generated default constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
    public static final long GENERATEDCONSTR   = 1L<<36;
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
    /** Flag that marks a hypothetical method that need not really be
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     *  generated in the binary, but is present in the symbol table to
12335
4725d88691dd 7133185: Update 292 overload resolution logic to match JLS
mcimadamore
parents: 9300
diff changeset
   208
     *  simplify checking for erasure clashes - also used for 292 poly sig methods.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    public static final long HYPOTHETICAL   = 1L<<37;
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
    /**
5848
c5a4ce47e780 6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5847
diff changeset
   213
     * Flag that marks an internal proprietary class.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    public static final long PROPRIETARY = 1L<<38;
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4870
diff changeset
   217
    /**
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
   218
     * Flag that marks a multi-catch parameter.
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4870
diff changeset
   219
     */
9300
c2de4dd9853b 7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents: 8625
diff changeset
   220
    public static final long UNION = 1L<<39;
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 4870
diff changeset
   221
5738
jrose
parents: 5520 5736
diff changeset
   222
    /**
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
   223
     * Flag that marks a special kind of bridge method (the ones that
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
   224
     * come from restricted supertype bounds).
6591
a953c8c6b85e 6337171: javac should create bridge methods when type variable bounds restricted
mcimadamore
parents: 5857
diff changeset
   225
     */
12335
4725d88691dd 7133185: Update 292 overload resolution logic to match JLS
mcimadamore
parents: 9300
diff changeset
   226
    public static final long OVERRIDE_BRIDGE = 1L<<40;
6591
a953c8c6b85e 6337171: javac should create bridge methods when type variable bounds restricted
mcimadamore
parents: 5857
diff changeset
   227
7203
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents: 7074
diff changeset
   228
    /**
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
   229
     * Flag that marks an 'effectively final' local variable.
7203
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents: 7074
diff changeset
   230
     */
12335
4725d88691dd 7133185: Update 292 overload resolution logic to match JLS
mcimadamore
parents: 9300
diff changeset
   231
    public static final long EFFECTIVELY_FINAL = 1L<<41;
7203
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents: 7074
diff changeset
   232
8228
4e6ee38974b2 6910550: javac 1.5.0_17 fails with incorrect error message
mcimadamore
parents: 7681
diff changeset
   233
    /**
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 15377
diff changeset
   234
     * Flag that marks non-override equivalent methods with the same signature.
8228
4e6ee38974b2 6910550: javac 1.5.0_17 fails with incorrect error message
mcimadamore
parents: 7681
diff changeset
   235
     */
12335
4725d88691dd 7133185: Update 292 overload resolution logic to match JLS
mcimadamore
parents: 9300
diff changeset
   236
    public static final long CLASH = 1L<<42;
8228
4e6ee38974b2 6910550: javac 1.5.0_17 fails with incorrect error message
mcimadamore
parents: 7681
diff changeset
   237
14267
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   238
    /**
16301
b6fd735ea78e 6563143: javac should issue a warning for overriding equals without hashCode
vromero
parents: 15720
diff changeset
   239
     * Flag that marks either a default method or an interface containing default methods.
14267
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   240
     */
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   241
    public static final long DEFAULT = 1L<<43;
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   242
14369
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 14267
diff changeset
   243
    /**
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 14267
diff changeset
   244
     * Flag that marks class as auxiliary, ie a non-public class following
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 14267
diff changeset
   245
     * the public class in a source file, that could block implicit compilation.
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 14267
diff changeset
   246
     */
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents: 14443
diff changeset
   247
    public static final long AUXILIARY = 1L<<44;
14369
3d660d08d1f7 7153951: Add new lint option -Xlint:auxiliaryclass
ohrstrom
parents: 14267
diff changeset
   248
15724
3063fb01c8a1 8004182: Add support for profiles in javac
jjg
parents: 14801
diff changeset
   249
    /**
3063fb01c8a1 8004182: Add support for profiles in javac
jjg
parents: 14801
diff changeset
   250
     * Flag that marks that a symbol is not available in the current profile
3063fb01c8a1 8004182: Add support for profiles in javac
jjg
parents: 14801
diff changeset
   251
     */
3063fb01c8a1 8004182: Add support for profiles in javac
jjg
parents: 14801
diff changeset
   252
    public static final long NOT_IN_PROFILE = 1L<<45;
3063fb01c8a1 8004182: Add support for profiles in javac
jjg
parents: 14801
diff changeset
   253
16316
lana
parents: 16301 15726
diff changeset
   254
    /**
16301
b6fd735ea78e 6563143: javac should issue a warning for overriding equals without hashCode
vromero
parents: 15720
diff changeset
   255
     * Flag that indicates that an override error has been detected by Check.
b6fd735ea78e 6563143: javac should issue a warning for overriding equals without hashCode
vromero
parents: 15720
diff changeset
   256
     */
b6fd735ea78e 6563143: javac should issue a warning for overriding equals without hashCode
vromero
parents: 15720
diff changeset
   257
    public static final long BAD_OVERRIDE = 1L<<45;
b6fd735ea78e 6563143: javac should issue a warning for overriding equals without hashCode
vromero
parents: 15720
diff changeset
   258
18389
a425d0819f36 8016569: javac, add new flag for polymorphic method signatures
vromero
parents: 16803
diff changeset
   259
    /**
a425d0819f36 8016569: javac, add new flag for polymorphic method signatures
vromero
parents: 16803
diff changeset
   260
     * Flag that indicates a signature polymorphic method (292).
a425d0819f36 8016569: javac, add new flag for polymorphic method signatures
vromero
parents: 16803
diff changeset
   261
     */
a425d0819f36 8016569: javac, add new flag for polymorphic method signatures
vromero
parents: 16803
diff changeset
   262
    public static final long SIGNATURE_POLYMORPHIC = 1L<<46;
a425d0819f36 8016569: javac, add new flag for polymorphic method signatures
vromero
parents: 16803
diff changeset
   263
18909
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   264
    /**
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   265
     * Flag that marks inference variables used in a 'throws' clause
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   266
     */
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   267
    public static final long THROWS = 1L<<47;
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   268
19914
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18909
diff changeset
   269
    /**
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18909
diff changeset
   270
     * Flag that marks potentially ambiguous overloads
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18909
diff changeset
   271
     */
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18909
diff changeset
   272
    public static final long POTENTIALLY_AMBIGUOUS = 1L<<48;
d86271bd430a 8016177: structural most specific and stuckness
vromero
parents: 18909
diff changeset
   273
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    /** Modifier masks.
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
    public static final int
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
        AccessFlags           = PUBLIC | PROTECTED | PRIVATE,
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
        LocalClassFlags       = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        MemberClassFlags      = LocalClassFlags | INTERFACE | AccessFlags,
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        ClassFlags            = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
        InterfaceVarFlags     = FINAL | STATIC | PUBLIC,
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
        VarFlags              = AccessFlags | FINAL | STATIC |
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
                                VOLATILE | TRANSIENT | ENUM,
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
        ConstructorFlags      = AccessFlags,
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        InterfaceMethodFlags  = ABSTRACT | PUBLIC,
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        MethodFlags           = AccessFlags | ABSTRACT | STATIC | NATIVE |
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
                                SYNCHRONIZED | FINAL | STRICTFP;
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    public static final long
14267
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   289
        ExtendedStandardFlags       = (long)StandardFlags | DEFAULT,
15377
515846bb6637 8005166: Add support for static interface methods
mcimadamore
parents: 15376
diff changeset
   290
        InterfaceMethodMask         = ABSTRACT | STATIC | PUBLIC | STRICTFP | DEFAULT,
14267
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   291
        LocalVarFlags               = FINAL | PARAMETER;
6321fbe0cf50 7192245: Add parser support for default methods
mcimadamore
parents: 14258
diff changeset
   292
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    public static Set<Modifier> asModifierSet(long flags) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
        Set<Modifier> modifiers = modifierSets.get(flags);
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
        if (modifiers == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
            modifiers = java.util.EnumSet.noneOf(Modifier.class);
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            if (0 != (flags & PUBLIC))    modifiers.add(Modifier.PUBLIC);
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
            if (0 != (flags & PROTECTED)) modifiers.add(Modifier.PROTECTED);
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            if (0 != (flags & PRIVATE))   modifiers.add(Modifier.PRIVATE);
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
            if (0 != (flags & ABSTRACT))  modifiers.add(Modifier.ABSTRACT);
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
            if (0 != (flags & STATIC))    modifiers.add(Modifier.STATIC);
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
            if (0 != (flags & FINAL))     modifiers.add(Modifier.FINAL);
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
            if (0 != (flags & TRANSIENT)) modifiers.add(Modifier.TRANSIENT);
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
            if (0 != (flags & VOLATILE))  modifiers.add(Modifier.VOLATILE);
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
            if (0 != (flags & SYNCHRONIZED))
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
                                          modifiers.add(Modifier.SYNCHRONIZED);
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
            if (0 != (flags & NATIVE))    modifiers.add(Modifier.NATIVE);
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
            if (0 != (flags & STRICTFP))  modifiers.add(Modifier.STRICTFP);
16803
3bdc22a32b0e 8011052: Add DEFAULT to javax.lang.model.Modifier
darcy
parents: 16316
diff changeset
   310
            if (0 != (flags & DEFAULT))   modifiers.add(Modifier.DEFAULT);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
            modifiers = Collections.unmodifiableSet(modifiers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
            modifierSets.put(flags, modifiers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
        return modifiers;
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
    // Cache of modifier sets.
14801
d66cab4ef397 8003967: detect and remove all mutable implicit static enum fields in langtools
vromero
parents: 14547
diff changeset
   318
    private static final Map<Long, Set<Modifier>> modifierSets =
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
        new java.util.concurrent.ConcurrentHashMap<Long, Set<Modifier>>(64);
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    public static boolean isStatic(Symbol symbol) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
        return (symbol.flags() & STATIC) != 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
    public static boolean isEnum(Symbol symbol) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
        return (symbol.flags() & ENUM) != 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
    public static boolean isConstant(Symbol.VarSymbol symbol) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        return symbol.getConstValue() != null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
    }
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   332
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   333
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   334
    public enum Flag {
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   335
        PUBLIC(Flags.PUBLIC),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   336
        PRIVATE(Flags.PRIVATE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   337
        PROTECTED(Flags.PROTECTED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   338
        STATIC(Flags.STATIC),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   339
        FINAL(Flags.FINAL),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   340
        SYNCHRONIZED(Flags.SYNCHRONIZED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   341
        VOLATILE(Flags.VOLATILE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   342
        TRANSIENT(Flags.TRANSIENT),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   343
        NATIVE(Flags.NATIVE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   344
        INTERFACE(Flags.INTERFACE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   345
        ABSTRACT(Flags.ABSTRACT),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   346
        DEFAULT(Flags.DEFAULT),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   347
        STRICTFP(Flags.STRICTFP),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   348
        BRIDGE(Flags.BRIDGE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   349
        SYNTHETIC(Flags.SYNTHETIC),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   350
        ANNOTATION(Flags.ANNOTATION),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   351
        DEPRECATED(Flags.DEPRECATED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   352
        HASINIT(Flags.HASINIT),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   353
        BLOCK(Flags.BLOCK),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   354
        ENUM(Flags.ENUM),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   355
        MANDATED(Flags.MANDATED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   356
        IPROXY(Flags.IPROXY),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   357
        NOOUTERTHIS(Flags.NOOUTERTHIS),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   358
        EXISTS(Flags.EXISTS),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   359
        COMPOUND(Flags.COMPOUND),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   360
        CLASS_SEEN(Flags.CLASS_SEEN),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   361
        SOURCE_SEEN(Flags.SOURCE_SEEN),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   362
        LOCKED(Flags.LOCKED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   363
        UNATTRIBUTED(Flags.UNATTRIBUTED),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   364
        ANONCONSTR(Flags.ANONCONSTR),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   365
        ACYCLIC(Flags.ACYCLIC),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   366
        PARAMETER(Flags.PARAMETER),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   367
        VARARGS(Flags.VARARGS),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   368
        ACYCLIC_ANN(Flags.ACYCLIC_ANN),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   369
        GENERATEDCONSTR(Flags.GENERATEDCONSTR),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   370
        HYPOTHETICAL(Flags.HYPOTHETICAL),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   371
        PROPRIETARY(Flags.PROPRIETARY),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   372
        UNION(Flags.UNION),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   373
        OVERRIDE_BRIDGE(Flags.OVERRIDE_BRIDGE),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   374
        EFFECTIVELY_FINAL(Flags.EFFECTIVELY_FINAL),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   375
        CLASH(Flags.CLASH),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   376
        AUXILIARY(Flags.AUXILIARY),
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   377
        NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
18909
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   378
        BAD_OVERRIDE(Flags.BAD_OVERRIDE),
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   379
        SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
8f9fc5d876e4 8012242: Lambda compatibility and checked exceptions
mcimadamore
parents: 18411
diff changeset
   380
        THROWS(Flags.THROWS);
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   381
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   382
        Flag(long flag) {
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   383
            this.value = flag;
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   384
            this.lowercaseName = name().toLowerCase();
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   385
        }
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   386
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   387
        @Override
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   388
        public String toString() {
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   389
            return lowercaseName;
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   390
        }
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   391
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   392
        final long value;
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   393
        final String lowercaseName;
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents: 10
diff changeset
   394
    }
18411
58e11c41d705 8006981: javac, method toString() of class ...javac.code.Flags doesn't print all the flag bits
vromero
parents: 18389
diff changeset
   395
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
}