prevent findEditorByConvention AccessControlException on Google App Engine (SEC-1434)
This commit is contained in:
parent
2c2cf32b8a
commit
cbca6e1acb
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2009 the original author or authors.
|
* Copyright 2002-2010 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.
|
||||||
|
|
@ -389,8 +389,17 @@ public abstract class BeanUtils {
|
||||||
}
|
}
|
||||||
ClassLoader cl = targetType.getClassLoader();
|
ClassLoader cl = targetType.getClassLoader();
|
||||||
if (cl == null) {
|
if (cl == null) {
|
||||||
cl = ClassLoader.getSystemClassLoader();
|
try {
|
||||||
if (cl == null) {
|
cl = ClassLoader.getSystemClassLoader();
|
||||||
|
if (cl == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Throwable ex) {
|
||||||
|
// e.g. AccessControlException on Google App Engine
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug("Could not access system ClassLoader: " + ex);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -398,8 +407,10 @@ public abstract class BeanUtils {
|
||||||
try {
|
try {
|
||||||
Class<?> editorClass = cl.loadClass(editorName);
|
Class<?> editorClass = cl.loadClass(editorName);
|
||||||
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
|
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
|
||||||
logger.warn("Editor class [" + editorName +
|
if (logger.isWarnEnabled()) {
|
||||||
"] does not implement [java.beans.PropertyEditor] interface");
|
logger.warn("Editor class [" + editorName +
|
||||||
|
"] does not implement [java.beans.PropertyEditor] interface");
|
||||||
|
}
|
||||||
unknownEditorTypes.put(targetType, Boolean.TRUE);
|
unknownEditorTypes.put(targetType, Boolean.TRUE);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue