< prev index next >

src/java.base/share/classes/java/lang/reflect/Executable.java

Print this page
*** 32,10 ***
--- 32,11 ---
  import java.util.Objects;
  import java.util.StringJoiner;
  import java.util.stream.Collectors;
  
  import jdk.internal.access.SharedSecrets;
+ import jdk.internal.reflect.AccessFlagSet;
  import jdk.internal.vm.annotation.Stable;
  import sun.reflect.annotation.AnnotationParser;
  import sun.reflect.annotation.AnnotationSupport;
  import sun.reflect.annotation.TypeAnnotationParser;
  import sun.reflect.annotation.TypeAnnotation;

*** 216,20 ***
  
      /**
       * {@return an unmodifiable set of the {@linkplain AccessFlag
       * access flags} for the executable represented by this object,
       * possibly empty}
       *
       * @see #getModifiers()
       * @jvms 4.6 Methods
       * @since 20
       */
      @Override
      public Set<AccessFlag> accessFlags() {
!         return reflectionFactory.parseAccessFlags(getModifiers(),
-                                                   AccessFlag.Location.METHOD,
-                                                   getDeclaringClass());
      }
  
      /**
       * Returns an array of {@code TypeVariable} objects that represent the
       * type variables declared by the generic declaration represented by this
--- 217,19 ---
  
      /**
       * {@return an unmodifiable set of the {@linkplain AccessFlag
       * access flags} for the executable represented by this object,
       * possibly empty}
+      * The {@code AccessFlags} may depend on the class file format version of the class.
       *
       * @see #getModifiers()
       * @jvms 4.6 Methods
       * @since 20
       */
      @Override
      public Set<AccessFlag> accessFlags() {
!         return AccessFlagSet.ofValidated(AccessFlagSet.METHOD_FLAGS, getModifiers());
      }
  
      /**
       * Returns an array of {@code TypeVariable} objects that represent the
       * type variables declared by the generic declaration represented by this
< prev index next >