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

IOException subclasses lacks some constructors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 5.0, 6
    • core-libs
    • x86
    • windows_2000, windows_xp

      A DESCRIPTION OF THE REQUEST :
      Since Java 1.4, java.lang.Exception have 2 new constructors:
      public Exception(Throwable cause)
      public Exception(String message, Throwable cause)

      java.io.IOException (and subclasses) lacks those new constructors, thus preventing "usefull" subclassing.

      JUSTIFICATION :
      Catching nested exceptions are a usefull way to convey information in case of error. All exception (and error) classes from the JRE should include all 4 constructors.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the following constructors to be available:
      public IOException()
      public IOException(String s)
      public IOException(Throwable cause)
      public IOException(String message, Throwable cause)
      ACTUAL -
      The only available constructors are:
      public IOException()
      public IOException(String s)

      CUSTOMER SUBMITTED WORKAROUND :
      no workaround

            alanb Alan Bateman
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: