JDK-8250660 : Clarify that WildcardType and AnnotatedWildcardType bounds methods return one
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 14
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • Submitted: 2020-07-25
  • Updated: 2020-08-27
  • Resolved: 2020-08-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b10Fixed
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
The java.lang.reflect.WildcardType methods getLowerBounds() and getUpperBounds() as well as the java.lang.reflect.AnnotatedWildcardType methods getAnnotatedLowerBounds() and getAnnotatedUpperBounds() return arrays and their documentation as well as the interface documentation is talking about "bound(s)".
However, the JLS does not permit mulitple bounds (not sure if the JVMS does, though based on sun.reflect.generics.parser.SignatureParser.parseTypeArgument() it does not look like it). It would therefore be good to clarify the documentation stating that currently at most 1 bound is returned. In their current state these methods are rather irritating.



Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/7a3522ab48b3 User: darcy Date: 2020-08-06 06:02:32 +0000
06-08-2020

Review thread: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-July/067994.html
31-07-2020

Request for clarification in the documentation of java.lang.reflect.WildcardType.getLowerBounds() and java.lang.reflect.WildcardType.getUpperBounds() and java.lang.reflect.AnnotatedWildcardType.getAnnotatedLowerBounds() and java.lang.reflect.AnnotatedWildcardType.getAnnotatedUpperBounds() that they return at most 1 bound
28-07-2020