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

javax.activation.DataSource: specify "appropriate exception"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 8u45
    • other-libs

      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

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

              Created:
              Updated:
              Resolved: