< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2019, 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


 302      * Flag to indicate the given symbol has been deprecated and marked for removal.
 303      */
 304     public static final long DEPRECATED_REMOVAL = 1L<<55;
 305 
 306     /**
 307      * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
 308      */
 309     public static final long HAS_RESOURCE = 1L<<56;
 310 
 311     /**
 312      * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
 313      */
 314     public static final long ANONCONSTR_BASED = 1L<<57;
 315 
 316     /**
 317      * Flag that marks finalize block as body-only, should not be copied into catch clauses.
 318      * Used to implement try-with-resources.
 319      */
 320     public static final long BODY_ONLY_FINALIZE = 1L<<17; //blocks only
 321 
 322     /**
 323      * Flag to indicate the given ParamSymbol has a user-friendly name filled.
 324      */
 325     public static final long NAME_FILLED = 1L<<58; //ParamSymbols only
 326 
 327     /** Modifier masks.
 328      */
 329     public static final int
 330         AccessFlags           = PUBLIC | PROTECTED | PRIVATE,
 331         LocalClassFlags       = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
 332         MemberClassFlags      = LocalClassFlags | INTERFACE | AccessFlags,
 333         ClassFlags            = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
 334         InterfaceVarFlags     = FINAL | STATIC | PUBLIC,
 335         VarFlags              = AccessFlags | FINAL | STATIC |
 336                                 VOLATILE | TRANSIENT | ENUM,
 337         ConstructorFlags      = AccessFlags,
 338         InterfaceMethodFlags  = ABSTRACT | PUBLIC,
 339         MethodFlags           = AccessFlags | ABSTRACT | STATIC | NATIVE |
 340                                 SYNCHRONIZED | FINAL | STRICTFP;
 341     public static final long
 342         ExtendedStandardFlags       = (long)StandardFlags | DEFAULT,
 343         ModifierFlags               = ((long)StandardFlags & ~INTERFACE) | DEFAULT,
 344         InterfaceMethodMask         = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
 345         AnnotationTypeElementMask   = ABSTRACT | PUBLIC,
 346         LocalVarFlags               = FINAL | PARAMETER,


 423         GENERATEDCONSTR(Flags.GENERATEDCONSTR),
 424         HYPOTHETICAL(Flags.HYPOTHETICAL),
 425         PROPRIETARY(Flags.PROPRIETARY),
 426         UNION(Flags.UNION),
 427         EFFECTIVELY_FINAL(Flags.EFFECTIVELY_FINAL),
 428         CLASH(Flags.CLASH),
 429         AUXILIARY(Flags.AUXILIARY),
 430         NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
 431         BAD_OVERRIDE(Flags.BAD_OVERRIDE),
 432         SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
 433         THROWS(Flags.THROWS),
 434         LAMBDA_METHOD(Flags.LAMBDA_METHOD),
 435         TYPE_TRANSLATED(Flags.TYPE_TRANSLATED),
 436         MODULE(Flags.MODULE),
 437         AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
 438         SYSTEM_MODULE(Flags.SYSTEM_MODULE),
 439         DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
 440         DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
 441         HAS_RESOURCE(Flags.HAS_RESOURCE),
 442         POTENTIALLY_AMBIGUOUS(Flags.POTENTIALLY_AMBIGUOUS),
 443         ANONCONSTR_BASED(Flags.ANONCONSTR_BASED),
 444         NAME_FILLED(Flags.NAME_FILLED);
 445 
 446         Flag(long flag) {
 447             this.value = flag;
 448             this.lowercaseName = StringUtils.toLowerCase(name());
 449         }
 450 
 451         @Override
 452         public String toString() {
 453             return lowercaseName;
 454         }
 455 
 456         final long value;
 457         final String lowercaseName;
 458     }
 459 
 460 }
   1 /*
   2  * Copyright (c) 1999, 2016, 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


 302      * Flag to indicate the given symbol has been deprecated and marked for removal.
 303      */
 304     public static final long DEPRECATED_REMOVAL = 1L<<55;
 305 
 306     /**
 307      * Flag to indicate the given PackageSymbol contains any non-.java and non-.class resources.
 308      */
 309     public static final long HAS_RESOURCE = 1L<<56;
 310 
 311     /**
 312      * Flag for synthesized default constructors of anonymous classes that have an enclosing expression.
 313      */
 314     public static final long ANONCONSTR_BASED = 1L<<57;
 315 
 316     /**
 317      * Flag that marks finalize block as body-only, should not be copied into catch clauses.
 318      * Used to implement try-with-resources.
 319      */
 320     public static final long BODY_ONLY_FINALIZE = 1L<<17; //blocks only
 321 





 322     /** Modifier masks.
 323      */
 324     public static final int
 325         AccessFlags           = PUBLIC | PROTECTED | PRIVATE,
 326         LocalClassFlags       = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
 327         MemberClassFlags      = LocalClassFlags | INTERFACE | AccessFlags,
 328         ClassFlags            = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
 329         InterfaceVarFlags     = FINAL | STATIC | PUBLIC,
 330         VarFlags              = AccessFlags | FINAL | STATIC |
 331                                 VOLATILE | TRANSIENT | ENUM,
 332         ConstructorFlags      = AccessFlags,
 333         InterfaceMethodFlags  = ABSTRACT | PUBLIC,
 334         MethodFlags           = AccessFlags | ABSTRACT | STATIC | NATIVE |
 335                                 SYNCHRONIZED | FINAL | STRICTFP;
 336     public static final long
 337         ExtendedStandardFlags       = (long)StandardFlags | DEFAULT,
 338         ModifierFlags               = ((long)StandardFlags & ~INTERFACE) | DEFAULT,
 339         InterfaceMethodMask         = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
 340         AnnotationTypeElementMask   = ABSTRACT | PUBLIC,
 341         LocalVarFlags               = FINAL | PARAMETER,


 418         GENERATEDCONSTR(Flags.GENERATEDCONSTR),
 419         HYPOTHETICAL(Flags.HYPOTHETICAL),
 420         PROPRIETARY(Flags.PROPRIETARY),
 421         UNION(Flags.UNION),
 422         EFFECTIVELY_FINAL(Flags.EFFECTIVELY_FINAL),
 423         CLASH(Flags.CLASH),
 424         AUXILIARY(Flags.AUXILIARY),
 425         NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
 426         BAD_OVERRIDE(Flags.BAD_OVERRIDE),
 427         SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
 428         THROWS(Flags.THROWS),
 429         LAMBDA_METHOD(Flags.LAMBDA_METHOD),
 430         TYPE_TRANSLATED(Flags.TYPE_TRANSLATED),
 431         MODULE(Flags.MODULE),
 432         AUTOMATIC_MODULE(Flags.AUTOMATIC_MODULE),
 433         SYSTEM_MODULE(Flags.SYSTEM_MODULE),
 434         DEPRECATED_ANNOTATION(Flags.DEPRECATED_ANNOTATION),
 435         DEPRECATED_REMOVAL(Flags.DEPRECATED_REMOVAL),
 436         HAS_RESOURCE(Flags.HAS_RESOURCE),
 437         POTENTIALLY_AMBIGUOUS(Flags.POTENTIALLY_AMBIGUOUS),
 438         ANONCONSTR_BASED(Flags.ANONCONSTR_BASED);

 439 
 440         Flag(long flag) {
 441             this.value = flag;
 442             this.lowercaseName = StringUtils.toLowerCase(name());
 443         }
 444 
 445         @Override
 446         public String toString() {
 447             return lowercaseName;
 448         }
 449 
 450         final long value;
 451         final String lowercaseName;
 452     }
 453 
 454 }
< prev index next >