Author: markt Date: Thu Apr 6 20:55:06 2017 New Revision: 1790464 URL: http://svn.apache.org/viewvc?rev=1790464&view=rev Log: Remove unnecessary privileged block from removeAttribute. I can't see anything in doRemoveAttribute that would trigger a security check.
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=1790464&r1=1790463&r2=1790464&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:55:06 2017 @@ -298,23 +298,9 @@ public class PageContextImpl extends Pag public void removeAttribute(final String name, final int scope) { if (name == null) { - throw new NullPointerException(Localizer - .getMessage("jsp.error.attribute.null_name")); + throw new NullPointerException(Localizer.getMessage("jsp.error.attribute.null_name")); } - if (SecurityUtil.isPackageProtectionEnabled()) { - AccessController.doPrivileged(new PrivilegedAction<Void>() { - @Override - public Void run() { - doRemoveAttribute(name, scope); - return null; - } - }); - } else { - doRemoveAttribute(name, scope); - } - } - private void doRemoveAttribute(String name, int scope) { switch (scope) { case PAGE_SCOPE: attributes.remove(name); @@ -326,8 +312,7 @@ public class PageContextImpl extends Pag case SESSION_SCOPE: if (session == null) { - throw new IllegalStateException(Localizer - .getMessage("jsp.error.page.noSession")); + throw new IllegalStateException(Localizer.getMessage("jsp.error.page.noSession")); } session.removeAttribute(name); break; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org