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

java.net.URL constructors throw MalformedURLException in undocumented way

XMLWordPrintable

    • b100
    • Verified



      Name: rmT116609 Date: 08/14/2003


      A DESCRIPTION OF THE PROBLEM :
      A MalformedURLException will be thrown not only when, as documented, any URL Constructor is called with a String holding no or an unknown protocol. It is also thrown, when that String specifies a port address that can not be converted to a positive int. The latter condition is not documented.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Throws:
      MalformedURLException - if no protocol is specified, or an unknown protocol is found, or if a port address is specified, that can not be converted to a positive int.
      ACTUAL -
      Throws:
      MalformedURLException - if no protocol is specified, or an unknown protocol is found.


      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.4.2/docs/api/
      (Incident Review ID: 194240)
      ======================================================================

            dbuck David Buck
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: