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

javax.activation.DataSource: specify "appropriate exception"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 8u45
    • Fix Version/s: None
    • Component/s: other-libs
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      The specification of both "getInputStream()" and "getOutputStream()" of the class javax.activation.DataSource contains the sentence "[...] and throws the appropriate exception if it can not do so."

      Since the specification says "the appropriate exception", this implies only certain exception types should be thrown by compliant implementations of the interface. However, it's unclear to me what is meant with "appropriate" here. For example, I would find it logical to throw java.lang.UnsupportedOperationException in this case, but that exception isn't mentioned in the @throws clause, so I guess it's not appropriate? Also, should it throw a specific subtype of IOException, or is any IOException allowed?

      I would much prefer if either "appropriate" is clearly specified, or simply replaced by something like "[...] and throws an IOException if it can not do so."


      URL OF FAULTY DOCUMENTATION :
      http://docs.oracle.com/javase/8/docs/api/javax/activation/DataSource.html

        Attachments

          Activity

            People

            Assignee:
            aefimov Aleksej Efimov
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: