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

URL class allows to perform IO without security checks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7
    • core-libs
    • x86
    • linux

      This CR is follow up on CR 6420327.

      Let's take a look at following use case:

      (new URL(urlString)).openConnection().getInputStream()

      SecurityException is not mentioned neither in URL.openConnection() nor in URLCOnnection.getInputStream() javadoc.

      I see that in general it is responsibility of protocol handler to make security checks.
      However accordingly with URL class spec support for some protocols is mandatory. It means that protocol handlers for these protocols are part of Java implementation.

      So it would be correct and quite nice to say add SecurityException clause under "Throws" subtitle and specify condition when it is thrown by protocol handlers provided by Java implementation (http, https, ftp, file, and jar).

            Unassigned Unassigned
            sreznick Sergey Reznick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: