Author: markt
Date: Thu Apr 6 20:05:07 2017
New Revision: 1790448
URL: http://svn.apache.org/viewvc?rev=1790448&view=rev
Log:
Move null check outside privileged block to reduce duplication
Modified:
tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1790448&r1=1790447&r2=1790448&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Thu Apr 6
20:05:07 2017
@@ -427,25 +427,20 @@ public class PageContextImpl extends Pag
@Override
public Object findAttribute(final String name) {
+ if (name == null) {
+ throw new NullPointerException(Localizer
+ .getMessage("jsp.error.attribute.null_name"));
+ }
+
if (SecurityUtil.isPackageProtectionEnabled()) {
return AccessController.doPrivileged(
new PrivilegedAction<Object>() {
@Override
public Object run() {
- if (name == null) {
- throw new NullPointerException(Localizer
- .getMessage("jsp.error.attribute.null_name"));
- }
-
return doFindAttribute(name);
}
});
} else {
- if (name == null) {
- throw new NullPointerException(Localizer
- .getMessage("jsp.error.attribute.null_name"));
- }
-
return doFindAttribute(name);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]