Skip to content

Commit 80026d8

Browse files
committed
8265174: Update Class.getDeclaredMethods to discuss synthetic and bridge methods
Reviewed-by: jfranck
1 parent ffb3771 commit 80026d8

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

src/java.base/share/classes/java/lang/Class.java

+10
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ public boolean isAnnotation() {
784784
*
785785
* @jls 13.1 The Form of a Binary
786786
* @jvms 4.1 The {@code ClassFile} Structure
787+
* @see <a
788+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
789+
* programming language and JVM modeling in core reflection</a>
787790
* @since 1.5
788791
*/
789792
public boolean isSynthetic() {
@@ -2402,6 +2405,10 @@ public RecordComponent[] getRecordComponents() {
24022405
* declared methods of the class or interface represented by this {@code
24032406
* Class} object, including public, protected, default (package)
24042407
* access, and private methods, but excluding inherited methods.
2408+
* The declared methods may include methods <em>not</em> in the
2409+
* source of the class or interface, including {@linkplain
2410+
* Method#isBridge bridge methods} and other {@linkplain
2411+
* Executable#isSynthetic synthetic} methods added by compilers.
24052412
*
24062413
* <p> If this {@code Class} object represents a class or interface that
24072414
* has multiple declared methods with the same name and parameter types,
@@ -2446,6 +2453,9 @@ public RecordComponent[] getRecordComponents() {
24462453
*
24472454
* @jls 8.2 Class Members
24482455
* @jls 8.4 Method Declarations
2456+
* @see <a
2457+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
2458+
* programming language and JVM modeling in core reflection</a>
24492459
* @since 1.1
24502460
*/
24512461
@CallerSensitive

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

+3
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ public boolean isVarArgs() {
515515
* @jls 13.1 The Form of a Binary
516516
* @jvms 4.6 Methods
517517
* @since 1.5
518+
* @see <a
519+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
520+
* programming language and JVM modeling in core reflection</a>
518521
*/
519522
@Override
520523
public boolean isSynthetic() {

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -226,6 +226,9 @@ public boolean isEnumConstant() {
226226
* @return true if and only if this field is a synthetic
227227
* field as defined by the Java Language Specification.
228228
* @since 1.5
229+
* @see <a
230+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
231+
* programming language and JVM modeling in core reflection</a>
229232
*/
230233
public boolean isSynthetic() {
231234
return Modifier.isSynthetic(getModifiers());

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

+6
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,9 @@ public Object invoke(Object obj, Object... args)
607607
* @jls 8.4.8.3 Requirements in Overriding and Hiding
608608
* @jls 15.12.4.5 Create Frame, Synchronize, Transfer Control
609609
* @jvms 4.6 Methods
610+
* @see <a
611+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
612+
* programming language and JVM modeling in core reflection</a>
610613
*/
611614
public boolean isBridge() {
612615
return (getModifiers() & Modifier.BRIDGE) != 0;
@@ -626,6 +629,9 @@ public boolean isVarArgs() {
626629
* {@inheritDoc}
627630
* @jls 13.1 The Form of a Binary
628631
* @jvms 4.6 Methods
632+
* @see <a
633+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
634+
* programming language and JVM modeling in core reflection</a>
629635
* @since 1.5
630636
*/
631637
@Override

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,13 @@ public boolean isImplicit() {
257257
* nor explicitly declared in source code; returns {@code false}
258258
* otherwise.
259259
*
260-
* @jls 13.1 The Form of a Binary
261260
* @return true if and only if this parameter is a synthetic
262261
* construct as defined by
263262
* <cite>The Java Language Specification</cite>.
263+
* @jls 13.1 The Form of a Binary
264+
* @see <a
265+
* href="{@docRoot}/java.base/java/lang/reflect/package-summary.html#LanguageJvmModel">Java
266+
* programming language and JVM modeling in core reflection</a>
264267
*/
265268
public boolean isSynthetic() {
266269
return Modifier.isSynthetic(getModifiers());

0 commit comments

Comments
 (0)