Skip to content

Commit

Permalink
In case of JDK 9, java.logging loading sun.util.logging.resources.log…
Browse files Browse the repository at this point in the history
…ging resource bundle and java.logging module is used as the cache key with null class loader.So we are adding a null check

git-svn-id: https://svn.java.net/svn/glassfish~svn/trunk/main@64167 6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
  • Loading branch information
aribandy authored and Pandrex247 committed Oct 8, 2015
1 parent 0dcdf6b commit fe015d0
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2671,17 +2671,22 @@ private void clearReferencesResourceBundles() {
}
WeakReference<?> loaderRef =
(WeakReference<?>) loaderRefField.get(key);
//In case of JDK 9, java.logging loading sun.util.logging.resources.logging resource bundle and
// java.logging module is used as the cache key with null class loader.So we are adding a null check
if (loaderRef!=null){
ClassLoader loader = (ClassLoader) loaderRef.get();

ClassLoader loader = (ClassLoader) loaderRef.get();

while (loader != null && loader != this) {
while (loader != null && loader != this) {
loader = loader.getParent();
}
}

if (loader != null) {
if (loader != null) {
keysIter.remove();
countRemoved++;
}

}

}

if (countRemoved > 0 && logger.isLoggable(Level.FINE)) {
Expand Down

0 comments on commit fe015d0

Please sign in to comment.