From: rjung Date: Mon, 11 Jul 2011 17:13:06 +0000 (+0000) Subject: - Remove unused code: X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f40f99b5fa00ced2ab64aecfca13a3af4ef84646;p=tomcat7.0 - Remove unused code: Cookie dates are formatted elsewhere. This class used a very strange format: " EEEE, dd-MMM-yy kk:mm:ss zz" - Add log.isDebugEnabled() git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1145246 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/util/RequestUtil.java b/java/org/apache/catalina/util/RequestUtil.java index 0ebebd5cc..a63f789a1 100644 --- a/java/org/apache/catalina/util/RequestUtil.java +++ b/java/org/apache/catalina/util/RequestUtil.java @@ -20,7 +20,6 @@ package org.apache.catalina.util; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; -import java.text.SimpleDateFormat; import java.util.Map; import java.util.TimeZone; @@ -48,16 +47,6 @@ public final class RequestUtil { */ private static final StringManager sm = StringManager.getManager("org.apache.catalina.util"); - - /** - * The DateFormat to use for generating readable dates in cookies. - */ - private static SimpleDateFormat format = - new SimpleDateFormat(" EEEE, dd-MMM-yy kk:mm:ss zz"); - - static { - format.setTimeZone(TimeZone.getTimeZone("GMT")); - } /** @@ -207,8 +196,10 @@ public final class RequestUtil { } parseParameters(map, bytes, encoding); } catch (UnsupportedEncodingException uee) { - log.debug(sm.getString("requestUtil.parseParameters.uee", - encoding), uee); + if (log.isDebugEnabled()) { + log.debug(sm.getString("requestUtil.parseParameters.uee", + encoding), uee); + } } } @@ -271,7 +262,9 @@ public final class RequestUtil { bytes = str.getBytes(B2CConverter.getCharset(enc)); } } catch (UnsupportedEncodingException uee) { - log.debug(sm.getString("requestUtil.urlDecode.uee", enc), uee); + if (log.isDebugEnabled()) { + log.debug(sm.getString("requestUtil.urlDecode.uee", enc), uee); + } } return URLDecode(bytes, enc, isQuery); @@ -341,7 +334,9 @@ public final class RequestUtil { try { return new String(bytes, 0, ox, B2CConverter.getCharset(enc)); } catch (UnsupportedEncodingException uee) { - log.debug(sm.getString("requestUtil.urlDecode.uee", enc), uee); + if (log.isDebugEnabled()) { + log.debug(sm.getString("requestUtil.urlDecode.uee", enc), uee); + } return null; } } @@ -458,7 +453,4 @@ public final class RequestUtil { } } - - - }