Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -784,6 +784,9 @@ public boolean isAnnotation() {
*
* @jls 13.1 The Form of a Binary
* @jvms 4.1 The {@code ClassFile} Structure
* @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
*/
public boolean isSynthetic() {
@@ -2402,6 +2405,10 @@ public Method getMethod(String name, Class<?>... parameterTypes)
* declared methods of the class or interface represented by this {@code
* Class} object, including public, protected, default (package)
* access, and private methods, but excluding inherited methods.
* The declared methods may include methods <em>not</em> in the
* source of the class or interface, including {@linkplain
* Method#isBridge bridge methods} and other {@linkplain
* Executable#isSynthetic synthetic} methods added by compilers.
*
* <p> If this {@code Class} object represents a class or interface that
* has multiple declared methods with the same name and parameter types,
@@ -2446,6 +2453,9 @@ public Method getMethod(String name, Class<?>... parameterTypes)
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @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.1
*/
@CallerSensitive
@@ -515,6 +515,9 @@ public boolean isVarArgs() {
* @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() {
@@ -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 @@ public boolean isEnumConstant() {
* @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());
@@ -607,6 +607,9 @@ public Object invoke(Object obj, Object... args)
* @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 boolean isVarArgs() {
* {@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
@@ -257,10 +257,13 @@ public boolean isImplicit() {
* 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());
ProTip! Use n and p to navigate between commits in a pull request.