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

PrinterJob.getUserName() throws a security exception when user.name permission is not given

XMLWordPrintable

    • 2d
    • b117
    • generic
    • generic

      PrinterJob.getUserName() is supposed to return the current user name of the system. This method does not document any exception. But when SecurityManager is installed, this method throws a security exception when PropertyPermission - user.name is not given in the policy file. But this is not documented anywhere and hence the user will not know until he gets the exception. This must be documented.

      This is reproducible on all platforms since 1.3.

      Make sure you have a policy file with a 'QueuePrintJob' permission. Run the attached test. If you see an AccessControlException on the console asking for user.name permission, the bug is reproduced.
      ###@###.### 2004-11-18 11:52:09 GMT

            psadhukhan Prasanta Sadhukhan
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: