General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
(cherry picked from commit 59cef3c)
This commit is contained in:
@@ -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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -98,7 +98,7 @@ public class StandardTypeLocator implements TypeLocator {
|
||||
public Class<?> findType(String typeName) throws EvaluationException {
|
||||
String nameToLookup = typeName;
|
||||
try {
|
||||
return this.classLoader.loadClass(nameToLookup);
|
||||
return ClassUtils.forName(nameToLookup, this.classLoader);
|
||||
}
|
||||
catch (ClassNotFoundException ey) {
|
||||
// try any registered prefixes before giving up
|
||||
@@ -106,7 +106,7 @@ public class StandardTypeLocator implements TypeLocator {
|
||||
for (String prefix : this.knownPackagePrefixes) {
|
||||
try {
|
||||
nameToLookup = prefix + "." + typeName;
|
||||
return this.classLoader.loadClass(nameToLookup);
|
||||
return ClassUtils.forName(nameToLookup, this.classLoader);
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
// might be a different prefix
|
||||
|
||||
Reference in New Issue
Block a user