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

Context.fromClass should catch exception from Class.getClassLoader call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • b97
    • generic
    • generic

      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.

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

              Created:
              Updated:
              Resolved: