Module java.base
Package java.lang.reflect

# Class Modifier

≠
public final class Modifier
extends java.lang.Object
Comparing jdk-master and valhalla-csr-open

public final class Modifier extends Object
The Modifier class provides `static` methods and constants to decode class and member access modifiers. The `AccessFlag` class should be used instead of this class. The sets of modifiers are represented as integers with non-distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from the tables in sections §4.1, §4.4, §4.5, and §4.7 of The Java Virtual Machine Specification .

API Note:
  Not all modifiers that are syntactic Java language modifiers are represented in this class, only those modifiers that also have a corresponding JVM access flag are included. In particular, the `default` method modifier (JLS §9.4.3) and the `value` , `sealed` and `non-sealed` class (JLS §8.1.1.2) and interface (JLS §9.1.1.4) modifiers are not represented in this class.
Since:
  1.1
See Also:
  - `Class.getModifiers()`
  - `Member.getModifiers()`

## Fields

- =
  public static final int ABSTRACT = 1024
- =
  public static final int FINAL = 16
- =
  public static final int INTERFACE = 512
- =
  public static final int NATIVE = 256
- =
  public static final int PRIVATE = 2
- =
  public static final int PROTECTED = 4
- =
  public static final int PUBLIC = 1
- =
  public static final int STATIC = 8
- =
  public static final int STRICT = 2048
- =
  public static final int SYNCHRONIZED = 32
- =
  public static final int TRANSIENT = 128
- =
  public static final int VOLATILE = 64

## Methods

- =
  public static int classModifiers()
- =
  public static int constructorModifiers()
- =
  public static int fieldModifiers()
- =
  public static int interfaceModifiers()
- =
  public static boolean isAbstract(int arg0)
- =
  public static boolean isFinal(int arg0)
- =
  public static boolean isInterface(int arg0)
- =
  public static boolean isNative(int arg0)
- =
  public static boolean isPrivate(int arg0)
- =
  public static boolean isProtected(int arg0)
- =
  public static boolean isPublic(int arg0)
- =
  public static boolean isStatic(int arg0)
- =
  public static boolean isStrict(int arg0)
- ≠
  public static boolean isSynchronized(int arg0)
  Comparing jdk-master and valhalla-csr-open

  ### isSynchronized

  public static boolean isSynchronized (int mod)
  Return `true` if the integer argument includes the `synchronized` modifier, `false` otherwise.
  API Note:
    `isSynchronized` should only be called with the modifiers of a method.
  Parameters:
    `mod` - a set of modifiers
  Returns:
    `true` if `mod` includes the `synchronized` modifier; `false` otherwise.
- =
  public static boolean isTransient(int arg0)
- =
  public static boolean isVolatile(int arg0)
- =
  public static int methodModifiers()
- =
  public static int parameterModifiers()
- ≠
  public static java.lang.String toString(int arg0)
  Comparing jdk-master and valhalla-csr-open

  ### toString

  public static String toString (int mod)
  Return a string describing the access modifier flags in the specified modifier. For example:

  >        public final synchronized
  >     strictfp

  The modifier names are returned in an order consistent with the suggested modifier orderings given in sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1 of The Java Language Specification . The full modifier ordering used by this method is:

  > `public protected private abstract static final transient volatile synchronized native strictfp interface`

  The `interface` modifier discussed in this class is not a true modifier in the Java language and it appears after all other modifiers listed by this method. This method may return a string of modifiers that are not valid modifiers of a Java entity; in other words, no checking is done on the possible validity of the combination of modifiers represented by the input. Note that to perform such checking for a known kind of entity, such as a constructor or method, first AND the argument of `toString` with the appropriate mask from a method like `constructorModifiers()` or `methodModifiers()` .
  API Note:
    To make a high-fidelity representation of the Java source modifiers of a class or member, source-level modifiers that do not have a constant in this class should be included and appear in an order consistent with the full recommended ordering for that kind of declaration as given in The Java Language Specification . For example, for a method the "`default` " modifier is ordered immediately before "`static` " (JLS §9.4). For a class object, the "`sealed` " or `"non-sealed"` modifier is ordered immediately after "`final` " for a class (JLS §8.1.1) and immediately after "`static` " for an interface (JLS §9.1.1).
  Parameters:
    `mod` - a set of modifiers
  Returns:
    a string representation of the set of modifiers represented by `mod`

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
Modifier |  |  |  |  |  |  | 6 |  |  | 6
isSynchronized(int) |  |  |  |  |  |  | 1 |  |  | 1
toString(int) |  |  |  |  |  |  |  |  | 1 | 1
Total |  |  |  |  |  |  | 7 |  | 1 | 8