• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • 7
    • core-libs
    • None

      ClassLoader::registerAsParallelCapable should only exceed if the caller is a subclass of ClassLoader.

      If the caller is null, the method could simply return false. We could also consider to throw IllegalCallerException but it should probably throw IllegalCallerException for all other invalid cases such as a non-null caller is not a subclass of ClassLoader. It seems that returning false is a reasonable solution for simplicity

      The existing implementation throws NPE since this method was added.

          [JDK-8281000] ClassLoader::registerAsParallelCapable throws NPE if caller is null

          Robo Duke added a comment -
          Changeset: a6f8a386
          Author: Tim Prinzing <tim.prinzing@oracle.com>
          Committer: Mandy Chung <mchung@openjdk.org>
          Date: 2022-02-17 17:34:39 +0000
          URL: https://git.openjdk.java.net/jdk/commit/a6f8a386efa7af162f4b815951287f0a9bc1f396

          Robo Duke added a comment - Changeset: a6f8a386 Author: Tim Prinzing < tim.prinzing@oracle.com > Committer: Mandy Chung < mchung@openjdk.org > Date: 2022-02-17 17:34:39 +0000 URL: https://git.openjdk.java.net/jdk/commit/a6f8a386efa7af162f4b815951287f0a9bc1f396

          Robo Duke added a comment -
          A pull request was submitted for review.
          URL: https://git.openjdk.java.net/jdk/pull/7448
          Date: 2022-02-11 20:36:26 +0000

          Robo Duke added a comment - A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7448 Date: 2022-02-11 20:36:26 +0000

          Changed the implementation to return false. Tested on Linux. Staged at https://github.com/tprinzing/jdk-1/tree/JDK-8281000. Need to test on Mac and windows before doing a pull request.

          Tim Prinzing (Inactive) added a comment - Changed the implementation to return false. Tested on Linux. Staged at https://github.com/tprinzing/jdk-1/tree/JDK-8281000 . Need to test on Mac and windows before doing a pull request.

            tprinzing Tim Prinzing (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: