Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8183177

Add explicit constructors to MalformedParameterizedTypeException

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 10
    • core-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      The type java.lang.reflect.MalformedParameterizedTypeException does not include any explicitly declared constructors. At least some of the usual set of exception constructors should be added.

      Problem

      Not having any explicitly declared constructors is a poor practice for a public type.

      Solution

      Add a no-arg and String constructor.

      Specification

      @@ -36,4 +36,21 @@
        */
       public class MalformedParameterizedTypeException extends RuntimeException {
           private static final long serialVersionUID = -5696557788586220964L;
      +
      +    /**
      +     * Constructs a {@code MalformedParameterizedTypeException} with
      +     * no detail message.
      +     */
      +    public MalformedParameterizedTypeException() {
      +        super();
      +    }
      +
      +    /**
      +     * Constructs a {@code MalformedParameterizedTypeException} with
      +     * the given detail message.
      +     * @param message the detail message; may be {@code null}
      +     */
      +    public MalformedParameterizedTypeException(String message) {
      +        super(message);
      +    }

            darcy Joe Darcy
            darcy Joe Darcy
            Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: