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

AccessControlException in threads created from ForkJoinPool

    Details

      Description

      Submitter seeing permission context issues in threads derived from the new JDK 8 parallelStream() call.

      $ java ParallelStreamTest parallel
      [ThreadName:main] Attempting to access system resource for parallelTest2
      [ThreadName:ForkJoinPool.commonPool-worker-1] Attempting to access system
      resource for parallelTest1
      [ThreadName:main] Successully accessed System.getProperty("user.dir")
      Exception in thread "main" java.security.AccessControlException: access
      denied ("java.util.PropertyPermission" "user.dir" "read")
                     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:4 57)
                     at java.security.AccessController.checkPermission(AccessController.java:884)
                     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
                     at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294)
                     at java.lang.System.getProperty(System.java:717)
                     at ParallelStreamTest.retrieveSystemResource(ParallelStreamTest.java:69)
                     at ParallelStreamTest$$Lambda$1/791452441.accept(Unknown Source)
                     at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)

        Attachments

          Activity

            People

            • Assignee:
              coffeys Sean Coffey
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: