8266670: Better modeling of access flags in core reflection

Reviewed-by: mchung, rriggs, asotona
This commit is contained in:
Joe Darcy 2022-06-25 19:09:43 +00:00
parent a5c25d8837
commit de7467146f
14 changed files with 1480 additions and 16 deletions

View file

@ -25,6 +25,8 @@
package java.lang.reflect;
import java.util.Set;
/**
* Member is an interface that reflects identifying information about
* a single member (a field or a method) or a constructor.
@ -76,9 +78,25 @@ public interface Member {
*
* @return the Java language modifiers for the underlying member
* @see Modifier
* @see #accessFlags()
*/
public int getModifiers();
/**
* {@return an unmodifiable set of the {@linkplain AccessFlag
* access flags} for this member, possibly empty}
*
* @implSpec
* The default implementation throws {@link
* UnsupportedOperationException}.
* @see #getModifiers()
* @since 20
*/
public default Set<AccessFlag> accessFlags() {
throw new UnsupportedOperationException();
}
/**
* Returns {@code true} if this member was introduced by
* the compiler; returns {@code false} otherwise.