Consider a null ClassLoader (typically the bootstrap CL) as cache-safe

Issue: SPR-11606
This commit is contained in:
Juergen Hoeller 2014-03-26 23:48:29 +01:00
parent e8c06c6d99
commit a4a2e80f23
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -388,7 +388,7 @@ public abstract class ClassUtils {
Assert.notNull(clazz, "Class must not be null"); Assert.notNull(clazz, "Class must not be null");
ClassLoader target = clazz.getClassLoader(); ClassLoader target = clazz.getClassLoader();
if (target == null) { if (target == null) {
return false; return true;
} }
ClassLoader cur = classLoader; ClassLoader cur = classLoader;
if (cur == target) { if (cur == target) {