8265174: Update Class.getDeclaredMethods to discuss synthetic and bridge methods

Reviewed-by: jfranck
This commit is contained in:
Joe Darcy 2021-04-14 16:15:54 +00:00
parent ffb3771816
commit 80026d81a4
5 changed files with 27 additions and 2 deletions

View file

@ -515,6 +515,9 @@ public final class Constructor<T> extends Executable {
* @jls 13.1 The Form of a Binary
* @jvms 4.6 Methods
* @since 1.5
* @see <a
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
* programming language and JVM modeling in core reflection</a>
*/
@Override
public boolean isSynthetic() {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -226,6 +226,9 @@ class Field extends AccessibleObject implements Member {
* @return true if and only if this field is a synthetic
* field as defined by the Java Language Specification.
* @since 1.5
* @see <a
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
* programming language and JVM modeling in core reflection</a>
*/
public boolean isSynthetic() {
return Modifier.isSynthetic(getModifiers());

View file

@ -607,6 +607,9 @@ public final class Method extends Executable {
* @jls 8.4.8.3 Requirements in Overriding and Hiding
* @jls 15.12.4.5 Create Frame, Synchronize, Transfer Control
* @jvms 4.6 Methods
* @see <a
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
* programming language and JVM modeling in core reflection</a>
*/
public boolean isBridge() {
return (getModifiers() & Modifier.BRIDGE) != 0;
@ -626,6 +629,9 @@ public final class Method extends Executable {
* {@inheritDoc}
* @jls 13.1 The Form of a Binary
* @jvms 4.6 Methods
* @see <a
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
* programming language and JVM modeling in core reflection</a>
* @since 1.5
*/
@Override

View file

@ -257,10 +257,13 @@ public final class Parameter implements AnnotatedElement {
* nor explicitly declared in source code; returns {@code false}
* otherwise.
*
* @jls 13.1 The Form of a Binary
* @return true if and only if this parameter is a synthetic
* construct as defined by
* <cite>The Java Language Specification</cite>.
* @jls 13.1 The Form of a Binary
* @see <a
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
* programming language and JVM modeling in core reflection</a>
*/
public boolean isSynthetic() {
return Modifier.isSynthetic(getModifiers());