JDK-8042748 : Clarify exception thrown by ParameterizedTypeImpl.validateConstructorArguments()
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-05-02
  • Updated: 2019-06-14
  • Resolved: 2019-06-09
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 13 JDK 14
13 b25Fixed 14Fixed
Related Reports
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments() throws MalformedParameterizedTypeException.

Currently the exception message is empty.

JUSTIFICATION :
MalformedParameterizedTypeException with an empty description is vague, and could be caused by many different factors.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Methods throwing MalformedParameterizedTypeException, such as ParameterizedTypeImpl.validateConstructorArguments() should always a detailed message that explains what went wrong.

The detail message should include:

- The class being invoked.
- The formal class type parameters.
- The actual type parameters passed in.


Comments
Review thread: https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-June/060769.html
07-06-2019

String constructor added in JDK-8183175.
11-10-2018

If the MalformedParameterizedTypeException took a string parameter or some other information, than having ParameterizedTypeImpl pass along that information would be reasonable. The MalformedParameterizedTypeException currently only has a no-arg constructor.
08-05-2014