Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread Joe Darcy
On Tue, 15 Feb 2022 22:32:29 GMT, David Holmes  wrote:

> Technically a constructor is not a Member either, but the reflection API can 
> get away with lumping constructors in with methods.
> 
> The JLS definition of Member comes from 8.1.6 and 8.2 - the key definition 
> being in 8.1.6:
> 
> "A class body may contain declarations of members of the class, that is, 
> fields (§8.3), methods (§8.4), classes (§8.5), and interfaces (§8.5)."

Hmmm. Okay; I'll concede to the consensus here and withdraw the PR, CSR, etc.

Parameter does mostly pass the "duck test" for me to be a Member, but I don't 
think it is essential for it to implement the interface (and also not essential 
to create one or more new interfaces separate from JLS terminology to 
characterize parameters and members/constructors as a more precise unified type 
than AnnotatedElement).

Thanks.

-

PR: https://git.openjdk.java.net/jdk/pull/7468


Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread David Holmes
On Tue, 15 Feb 2022 01:13:43 GMT, Joe Darcy  wrote:

> Retrofitting of Parameter to implement Member, an interface already 
> implemented by similar reflective modeling classes.
> 
> Since Parameter is final, there is little compatibility impact from adding a 
> new method.
> 
> Please also review the corresponding CSR:
> 
> https://bugs.openjdk.java.net/browse/JDK-8281767
> 
> I'll update the copyright year before pushing; I judged this as trivial 
> enough to not require a regression test.

Technically a constructor is not a Member either, but the reflection API can 
get away with lumping constructors in with methods.

The JLS definition of Member comes from 8.1.6 and 8.2 - the key definition 
being in 8.1.6:

"A class body may contain declarations of members of the class, that is, fields 
(§8.3),
methods (§8.4), classes (§8.5), and interfaces (§8.5)."

-

PR: https://git.openjdk.java.net/jdk/pull/7468


Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread Rémi Forax
On Tue, 15 Feb 2022 01:13:43 GMT, Joe Darcy  wrote:

> Retrofitting of Parameter to implement Member, an interface already 
> implemented by similar reflective modeling classes.
> 
> Since Parameter is final, there is little compatibility impact from adding a 
> new method.
> 
> Please also review the corresponding CSR:
> 
> https://bugs.openjdk.java.net/browse/JDK-8281767
> 
> I'll update the copyright year before pushing; I judged this as trivial 
> enough to not require a regression test.

I agree with Mandy and David, a Member is the thingy inside a class, so a 
parameter is no a member, it has no declaring class.

-

PR: https://git.openjdk.java.net/jdk/pull/7468


Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread Mandy Chung
On Tue, 15 Feb 2022 01:13:43 GMT, Joe Darcy  wrote:

> Retrofitting of Parameter to implement Member, an interface already 
> implemented by similar reflective modeling classes.
> 
> Since Parameter is final, there is little compatibility impact from adding a 
> new method.
> 
> Please also review the corresponding CSR:
> 
> https://bugs.openjdk.java.net/browse/JDK-8281767
> 
> I'll update the copyright year before pushing; I judged this as trivial 
> enough to not require a regression test.

I also consider that Parameter is not a Member.  A member is a field, method, 
constructor.

-

PR: https://git.openjdk.java.net/jdk/pull/7468


Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread ExE Boss
On Tue, 15 Feb 2022 01:13:43 GMT, Joe Darcy  wrote:

> Retrofitting of Parameter to implement Member, an interface already 
> implemented by similar reflective modeling classes.
> 
> Since Parameter is final, there is little compatibility impact from adding a 
> new method.
> 
> Please also review the corresponding CSR:
> 
> https://bugs.openjdk.java.net/browse/JDK-8281767
> 
> I'll update the copyright year before pushing; I judged this as trivial 
> enough to not require a regression test.

src/java.base/share/classes/java/lang/reflect/Parameter.java line 30:

> 28: import java.util.HashMap;
> 29: import java.util.Map;
> 30: import java.util.Set;

`java.util.Set` doesn’t seem to be referenced from anywhere else in this class.

-

PR: https://git.openjdk.java.net/jdk/pull/7468


Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-14 Thread David Holmes

Hi Joe,

On 15/02/2022 11:22 am, Joe Darcy wrote:

Retrofitting of Parameter to implement Member, an interface already implemented 
by similar reflective modeling classes.


But a parameter is not a Member!

David


Since Parameter is final, there is little compatibility impact from adding a 
new method.

Please also review the corresponding CSR:

https://bugs.openjdk.java.net/browse/JDK-8281767

I'll update the copyright year before pushing; I judged this as trivial enough 
to not require a regression test.

-

Commit messages:
  - JDK-8281767: Update java.lang.reflect.Parameter to implement Member

Changes: https://git.openjdk.java.net/jdk/pull/7468/files
  Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7468=00
   Issue: https://bugs.openjdk.java.net/browse/JDK-8281766
   Stats: 15 lines in 1 file changed: 14 ins; 0 del; 1 mod
   Patch: https://git.openjdk.java.net/jdk/pull/7468.diff
   Fetch: git fetch https://git.openjdk.java.net/jdk pull/7468/head:pull/7468

PR: https://git.openjdk.java.net/jdk/pull/7468


RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-14 Thread Joe Darcy
Retrofitting of Parameter to implement Member, an interface already implemented 
by similar reflective modeling classes.

Since Parameter is final, there is little compatibility impact from adding a 
new method.

Please also review the corresponding CSR:

https://bugs.openjdk.java.net/browse/JDK-8281767

I'll update the copyright year before pushing; I judged this as trivial enough 
to not require a regression test.

-

Commit messages:
 - JDK-8281767: Update java.lang.reflect.Parameter to implement Member

Changes: https://git.openjdk.java.net/jdk/pull/7468/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=7468=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281766
  Stats: 15 lines in 1 file changed: 14 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7468.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7468/head:pull/7468

PR: https://git.openjdk.java.net/jdk/pull/7468