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

Context.fromClass should catch exception from Class.getClassLoader call

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b97
    • CPU:
      generic
    • OS:
      generic

      Description

      As part of jake/nashorn fix JDK-8144568: ant clean test fails with jake/nashorn after recent sync with jdk9-dev, Context.fromClass has been changed to catch exception from Class.getClassLoader call. [ because there were test failures in jake/nashorn due to exception being not caught ]. Although this issue is not reproduced in jdk9-dev, we'd like to get the change in jdk9-dev/nashorn as well.

      This is because:

      1) future merge from jdk9-dev -> jake would be simpler (same code in that method)

      2) Class.getClassLoader to get current Context is just an optimization. Even if that fails (say when jake merges to jdk9-dev eventually), we still need to fallback to get current Context thread local storage -- and not throw exception from Context.fromClass method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sundar Sundararajan Athijegannathan
                Reporter:
                sundar Sundararajan Athijegannathan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: