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

LOGGING APIs: some constructors throw undocumented SecurityException

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      beta
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: szR10032 Date: 09/18/2000



      The logging APIs specification (v. 049) defines all methods which throw
      SecurityException (RuntimeException's subclass). However,
      SocketHandler.SocketHandler(Formatter) is not defined as throwing SecurityException.
      The nsk/logging/SocketHandler/SocketHandler_f/sckth_f002 test shows that SecurityException
      is thrown by SocketHandler(Formatter) if logging permission is denied.
      And it's clear because SocketHandler(Formatter) invokes Handler.setFormatter method
      which, according to the spec, must throw SecurityException if logging
      permission is denied. Therefore, the spec should define SocketHandler.SocketHandler(Formatter)
      as throwing SecurityException and this method source should have corresponding
      throws clause.

      The same problem occurs also for
      ConsoleHandler.ConsoleHandler(Formatter) constructor.

      ======================================================================

      Name: elR10090 Date: 10/04/2000



      Moreover, the same problem occurs also for the following constructors:

          (1) ConsoleHandler()
          (2) SocketHandler()
          (3) SocketHandler(String, int)
          (4) StreamHandler(Formatter)
          (5) StreamHandler(OutputStream, Formatter)

      (1), (2), (3) invoke Handler.setLevel(Level) method that according
      to the spec throws SecurityException if logging permission is denied.
      (4), (5) invoke Handler.setFormatter method like the constructors
      mentioned above.



      ======================================================================

      Name: elR10090 Date: 02/01/2001


      This bug affects the following testbase_nsk test:
          nsk/logging/ConsoleHandler/ConsoleHandler/cnslhndl002
          nsk/logging/SocketHandler/SocketHandler/sckthndl002
          nsk/logging/SocketHandler/SocketHandler_si/sckth_si002
          nsk/logging/StreamHandler/StreamHandler/strmhnd002
          nsk/logging/StreamHandler/StreamHandler_of/strmhndof002

      See also Justification.


      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mduigou Michael Duigou
                Reporter:
                zsssunw Zss Zss (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: