You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/07/30 13:08:31 UTC

[tomcat] branch 8.5.x updated (276450e -> bb5db77)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 276450e  Refactor to aid re-use
     new 56a1cae  Prep for additional backports. Align with master (excluding deprecation)
     new 2182c04  Align with master
     new 111f0d1  Align with master. Deprecate
     new 6025ef7  Align with master. Spacing, Javadoc, remove unnecessary (...)
     new 7e5f263  Deprecate FastDateFormat.RFC1123_DATE
     new dedb056  Deprecate FastHttpDateFormat.formatDate(long, DateFormat)
     new bb5db77  Deprecate FastHttpDateFormat.parseDate(String,DateFormat[])

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../catalina/authenticator/AuthenticatorBase.java  |   5 +-
 java/org/apache/catalina/connector/Request.java    |  13 ++-
 java/org/apache/catalina/connector/Response.java   |  45 +++-----
 .../apache/catalina/servlets/WebdavServlet.java    |  10 +-
 .../apache/catalina/util/ConcurrentDateFormat.java |   4 +
 .../catalina/webresources/AbstractResource.java    |   6 +-
 .../apache/catalina/webresources/FileResource.java |   2 +-
 .../catalina/webresources/JarWarResourceSet.java   |   2 +-
 .../catalina/webresources/LocalStrings.properties  |   3 +-
 .../webresources}/LocalStrings_es.properties       |  11 +-
 .../webresources/LocalStrings_fr.properties        |  59 ++++++++++
 .../webresources/LocalStrings_ja.properties        |  59 ++++++++++
 .../util/http}/ConcurrentDateFormat.java           |  29 +++--
 .../tomcat/util/http/FastHttpDateFormat.java       | 128 ++++++++++-----------
 14 files changed, 243 insertions(+), 133 deletions(-)
 copy java/{javax/servlet => org/apache/catalina/webresources}/LocalStrings_es.properties (55%)
 create mode 100644 java/org/apache/catalina/webresources/LocalStrings_fr.properties
 create mode 100644 java/org/apache/catalina/webresources/LocalStrings_ja.properties
 copy java/org/apache/{catalina/util => tomcat/util/http}/ConcurrentDateFormat.java (79%)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 06/07: Deprecate FastHttpDateFormat.formatDate(long, DateFormat)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit dedb056afbd9d76f6da8d4a0ed119b1d9e2196c1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 21:32:20 2019 +0100

    Deprecate FastHttpDateFormat.formatDate(long, DateFormat)
---
 java/org/apache/catalina/servlets/WebdavServlet.java     | 8 ++++----
 java/org/apache/tomcat/util/http/FastHttpDateFormat.java | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java
index 4c59ac2..ef5573d 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -2068,7 +2068,7 @@ public class WebdavServlet extends DefaultServlet {
             generatedXML.writeElement("D", "displayname", XMLWriter.CLOSING);
             if (isFile) {
                 generatedXML.writeProperty("D", "getlastmodified",
-                        FastHttpDateFormat.formatDate(lastModified, null));
+                        FastHttpDateFormat.formatDate(lastModified));
                 generatedXML.writeProperty("D", "getcontentlength", Long.toString(contentLength));
                 if (contentType != null) {
                     generatedXML.writeProperty("D", "getcontenttype", contentType);
@@ -2152,7 +2152,7 @@ public class WebdavServlet extends DefaultServlet {
                 String property = properties.nextElement();
 
                 if (property.equals("creationdate")) {
-                    generatedXML.writeProperty ("D", "creationdate", getISOCreationDate(created));
+                    generatedXML.writeProperty("D", "creationdate", getISOCreationDate(created));
                 } else if (property.equals("displayname")) {
                     generatedXML.writeElement("D", "displayname", XMLWriter.OPENING);
                     generatedXML.writeData(resourceName);
@@ -2186,7 +2186,7 @@ public class WebdavServlet extends DefaultServlet {
                 } else if (property.equals("getlastmodified")) {
                     if (isFile) {
                         generatedXML.writeProperty("D", "getlastmodified",
-                                FastHttpDateFormat.formatDate(lastModified, null));
+                                FastHttpDateFormat.formatDate(lastModified));
                     } else {
                         propertiesNotFound.addElement(property);
                     }
@@ -2405,7 +2405,7 @@ public class WebdavServlet extends DefaultServlet {
             result.append("\nOwner:");
             result.append(owner);
             result.append("\nExpiration:");
-            result.append(FastHttpDateFormat.formatDate(expiresAt, null));
+            result.append(FastHttpDateFormat.formatDate(expiresAt));
             Enumeration<String> tokensList = tokens.elements();
             while (tokensList.hasMoreElements()) {
                 result.append("\nToken:");
diff --git a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
index dd9bd2b..ee7f780 100644
--- a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
+++ b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
@@ -117,7 +117,10 @@ public final class FastHttpDateFormat {
      * @param threadLocalformat Ignored. The local ConcurrentDateFormat will
      *                          always be used.
      * @return the HTTP date
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10
      */
+    @Deprecated
     public static final String formatDate(long value, DateFormat threadLocalformat) {
         return formatDate(value);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/07: Prep for additional backports. Align with master (excluding deprecation)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 56a1caeb752806f51784a19ef470d7f73e855971
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 20:17:39 2019 +0100

    Prep for additional backports. Align with master (excluding deprecation)
---
 .../tomcat/util/http/ConcurrentDateFormat.java     |  72 +++++++++++++
 .../tomcat/util/http/FastHttpDateFormat.java       | 118 ++++++++++-----------
 2 files changed, 126 insertions(+), 64 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java b/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java
new file mode 100644
index 0000000..9ce953f
--- /dev/null
+++ b/java/org/apache/tomcat/util/http/ConcurrentDateFormat.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.util.http;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Queue;
+import java.util.TimeZone;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * A thread safe wrapper around {@link SimpleDateFormat} that does not make use
+ * of ThreadLocal and - broadly - only creates enough SimpleDateFormat objects
+ * to satisfy the concurrency requirements.
+ */
+public class ConcurrentDateFormat {
+
+    private final String format;
+    private final Locale locale;
+    private final TimeZone timezone;
+    private final Queue<SimpleDateFormat> queue = new ConcurrentLinkedQueue<>();
+
+    public ConcurrentDateFormat(String format, Locale locale, TimeZone timezone) {
+        this.format = format;
+        this.locale = locale;
+        this.timezone = timezone;
+        SimpleDateFormat initial = createInstance();
+        queue.add(initial);
+    }
+
+    public String format(Date date) {
+        SimpleDateFormat sdf = queue.poll();
+        if (sdf == null) {
+            sdf = createInstance();
+        }
+        String result = sdf.format(date);
+        queue.add(sdf);
+        return result;
+    }
+
+    public Date parse(String source) throws ParseException {
+        SimpleDateFormat sdf = queue.poll();
+        if (sdf == null) {
+            sdf = createInstance();
+        }
+        Date result = sdf.parse(source);
+        queue.add(sdf);
+        return result;
+    }
+
+    private SimpleDateFormat createInstance() {
+        SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
+        sdf.setTimeZone(timezone);
+        return sdf;
+    }
+}
diff --git a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
index f30c04b..86376d2 100644
--- a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
+++ b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
@@ -18,7 +18,6 @@ package org.apache.tomcat.util.http;
 
 import java.text.DateFormat;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Locale;
 import java.util.Map;
@@ -43,23 +42,30 @@ public final class FastHttpDateFormat {
     /**
      * The only date format permitted when generating HTTP headers.
      */
-    public static final String RFC1123_DATE =
-            "EEE, dd MMM yyyy HH:mm:ss zzz";
+    public static final String RFC1123_DATE = "EEE, dd MMM yyyy HH:mm:ss zzz";
 
-    private static final SimpleDateFormat format =
-            new SimpleDateFormat(RFC1123_DATE, Locale.US);
+    // HTTP date formats
+    private static final String DATE_RFC5322 = "EEE, dd MMM yyyy HH:mm:ss z";
+    private static final String DATE_OBSOLETE_RFC850 = "EEEEEE, dd-MMM-yy HH:mm:ss zzz";
+    private static final String DATE_OBSOLETE_ASCTIME = "EEE MMMM d HH:mm:ss yyyy";
 
+    private static final ConcurrentDateFormat FORMAT_RFC5322;
+    private static final ConcurrentDateFormat FORMAT_OBSOLETE_RFC850;
+    private static final ConcurrentDateFormat FORMAT_OBSOLETE_ASCTIME;
 
-    private static final TimeZone gmtZone = TimeZone.getTimeZone("GMT");
+    private static final ConcurrentDateFormat[] httpParseFormats;
 
-
-    /**
-     * GMT timezone - all HTTP dates are on GMT
-     */
     static {
-        format.setTimeZone(gmtZone);
-    }
+        // All the formats that use a timezone use GMT
+        TimeZone tz = TimeZone.getTimeZone("GMT");
 
+        FORMAT_RFC5322 = new ConcurrentDateFormat(DATE_RFC5322, Locale.US, tz);
+        FORMAT_OBSOLETE_RFC850 = new ConcurrentDateFormat(DATE_OBSOLETE_RFC850, Locale.US, tz);
+        FORMAT_OBSOLETE_ASCTIME = new ConcurrentDateFormat(DATE_OBSOLETE_ASCTIME, Locale.US, tz);
+
+        httpParseFormats = new ConcurrentDateFormat[] {
+                FORMAT_RFC5322, FORMAT_OBSOLETE_RFC850, FORMAT_OBSOLETE_ASCTIME };
+    }
 
     /**
      * Instant on which the currentDate object was generated.
@@ -93,47 +99,41 @@ public final class FastHttpDateFormat {
      * @return the HTTP date
      */
     public static final String getCurrentDate() {
-
         long now = System.currentTimeMillis();
         if ((now - currentDateGenerated) > 1000) {
-            synchronized (format) {
-                if ((now - currentDateGenerated) > 1000) {
-                    currentDate = format.format(new Date(now));
-                    currentDateGenerated = now;
-                }
-            }
+            currentDate = FORMAT_RFC5322.format(new Date(now));
+            currentDateGenerated = now;
         }
         return currentDate;
-
     }
 
 
     /**
      * Get the HTTP format of the specified date.
      * @param value The date
-     * @param threadLocalformat Local format to avoid synchronization
+     * @param threadLocalformat Ignored. The local ConcurrentDateFormat will
+     *                          always be used.
      * @return the HTTP date
      */
-    public static final String formatDate
-        (long value, DateFormat threadLocalformat) {
+    public static final String formatDate(long value, DateFormat threadLocalformat) {
+        return formatDate(value);
+    }
+
 
+    /**
+     * Get the HTTP format of the specified date.
+     * @param value The date
+     * @return the HTTP date
+     */
+    public static final String formatDate(long value) {
         Long longValue = Long.valueOf(value);
         String cachedDate = formatCache.get(longValue);
         if (cachedDate != null) {
             return cachedDate;
         }
 
-        String newDate = null;
-        Date dateValue = new Date(value);
-        if (threadLocalformat != null) {
-            newDate = threadLocalformat.format(dateValue);
-            updateFormatCache(longValue, newDate);
-        } else {
-            synchronized (format) {
-                newDate = format.format(dateValue);
-            }
-            updateFormatCache(longValue, newDate);
-        }
+        String newDate = FORMAT_RFC5322.format(new Date(value));
+        updateFormatCache(longValue, newDate);
         return newDate;
     }
 
@@ -141,49 +141,39 @@ public final class FastHttpDateFormat {
     /**
      * Try to parse the given date as a HTTP date.
      * @param value The HTTP date
-     * @param threadLocalformats Local format to avoid synchronization
+     * @param threadLocalformats Ignored. The local array of
+     *                           ConcurrentDateFormat will always be used.
      * @return the date as a long
      */
-    public static final long parseDate(String value,
-                                       DateFormat[] threadLocalformats) {
+    public static final long parseDate(String value, DateFormat[] threadLocalformats) {
+        return parseDate(value);
+    }
+
+
+    /**
+     * Try to parse the given date as a HTTP date.
+     * @param value The HTTP date
+     * @return the date as a long or <code>-1</code> if the value cannot be
+     *         parsed
+     */
+    public static final long parseDate(String value) {
 
         Long cachedDate = parseCache.get(value);
         if (cachedDate != null) {
             return cachedDate.longValue();
         }
 
-        Long date = null;
-        if (threadLocalformats != null) {
-            date = internalParseDate(value, threadLocalformats);
-            updateParseCache(value, date);
-        } else {
-            throw new IllegalArgumentException();
-        }
-        if (date == null) {
-            return (-1L);
-        }
-
-        return date.longValue();
-    }
-
-
-    /**
-     * Parse date with given formatters.
-     */
-    private static final Long internalParseDate
-        (String value, DateFormat[] formats) {
-        Date date = null;
-        for (int i = 0; (date == null) && (i < formats.length); i++) {
+        long date = -1;
+        for (int i = 0; (date == -1) && (i < httpParseFormats.length); i++) {
             try {
-                date = formats[i].parse(value);
+                date = httpParseFormats[i].parse(value).getTime();
+                updateParseCache(value, Long.valueOf(date));
             } catch (ParseException e) {
                 // Ignore
             }
         }
-        if (date == null) {
-            return null;
-        }
-        return Long.valueOf(date.getTime());
+
+        return date;
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 05/07: Deprecate FastDateFormat.RFC1123_DATE

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7e5f26343a26a4589b6910015eea987dccfb4be2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 21:05:15 2019 +0100

    Deprecate FastDateFormat.RFC1123_DATE
---
 java/org/apache/catalina/connector/Request.java     | 10 +++++++++-
 java/org/apache/catalina/connector/Response.java    | 21 +++++----------------
 .../apache/tomcat/util/http/FastHttpDateFormat.java |  3 +++
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java
index 1e95e74..c58cda1 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -167,6 +167,10 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
 
     // ----------------------------------------------------- Variables
 
+    /**
+     * @deprecated Unused. This will be removed in Tomcat 10.
+     */
+    @Deprecated
     protected static final TimeZone GMT_ZONE = TimeZone.getTimeZone("GMT");
 
 
@@ -187,9 +191,13 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
      *
      * Notice that because SimpleDateFormat is not thread-safe, we can't
      * declare formats[] as a static variable.
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10
      */
+    @Deprecated
     protected final SimpleDateFormat formats[];
 
+    @Deprecated
     private static final SimpleDateFormat formatsTemplate[] = {
         new SimpleDateFormat(FastHttpDateFormat.RFC1123_DATE, Locale.US),
         new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
@@ -2223,7 +2231,7 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
         }
 
         // Attempt to convert the date header in a variety of formats
-        long result = FastHttpDateFormat.parseDate(value, formats);
+        long result = FastHttpDateFormat.parseDate(value);
         if (result != (-1L)) {
             return result;
         }
diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java
index b3c4f13..7410d5a 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -32,7 +32,6 @@ import java.util.Collection;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Locale;
-import java.util.TimeZone;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletResponse;
@@ -91,7 +90,10 @@ public class Response implements HttpServletResponse {
 
     /**
      * The date format we will use for creating date headers.
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10
      */
+    @Deprecated
     protected SimpleDateFormat format = null;
 
 
@@ -1003,14 +1005,7 @@ public class Response implements HttpServletResponse {
             return;
         }
 
-        if (format == null) {
-            format = new SimpleDateFormat(FastHttpDateFormat.RFC1123_DATE,
-                                          Locale.US);
-            format.setTimeZone(TimeZone.getTimeZone("GMT"));
-        }
-
-        addHeader(name, FastHttpDateFormat.formatDate(value, format));
-
+        addHeader(name, FastHttpDateFormat.formatDate(value));
     }
 
 
@@ -1366,13 +1361,7 @@ public class Response implements HttpServletResponse {
             return;
         }
 
-        if (format == null) {
-            format = new SimpleDateFormat(FastHttpDateFormat.RFC1123_DATE,
-                                          Locale.US);
-            format.setTimeZone(TimeZone.getTimeZone("GMT"));
-        }
-
-        setHeader(name, FastHttpDateFormat.formatDate(value, format));
+        setHeader(name, FastHttpDateFormat.formatDate(value));
     }
 
 
diff --git a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
index 86376d2..dd9bd2b 100644
--- a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
+++ b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
@@ -41,7 +41,10 @@ public final class FastHttpDateFormat {
 
     /**
      * The only date format permitted when generating HTTP headers.
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10.
      */
+    @Deprecated
     public static final String RFC1123_DATE = "EEE, dd MMM yyyy HH:mm:ss zzz";
 
     // HTTP date formats


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 04/07: Align with master. Spacing, Javadoc, remove unnecessary (...)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6025ef74c90512ab242861cfdcd0ca5096417164
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 20:52:42 2019 +0100

    Align with master. Spacing, Javadoc, remove unnecessary (...)
---
 java/org/apache/catalina/connector/Request.java  |  3 +--
 java/org/apache/catalina/connector/Response.java | 24 +++++++++---------------
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java
index 0fdfc63..1e95e74 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -129,7 +129,6 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
 
     // ----------------------------------------------------------- Constructors
 
-
     public Request() {
         formats = new SimpleDateFormat[formatsTemplate.length];
         for(int i = 0; i < formats.length; i++) {
@@ -168,7 +167,6 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
 
     // ----------------------------------------------------- Variables
 
-
     protected static final TimeZone GMT_ZONE = TimeZone.getTimeZone("GMT");
 
 
@@ -579,6 +577,7 @@ public class Request implements org.apache.catalina.servlet4preview.http.HttpSer
         return mappingData.context;
     }
 
+
     /**
      * @param context The newly associated Context
      * @deprecated Use setters on {@link #getMappingData() MappingData} object.
diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java
index 7b976e0..b3c4f13 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -33,7 +33,6 @@ import java.util.Enumeration;
 import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
-import java.util.Vector;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletResponse;
@@ -782,11 +781,10 @@ public class Response implements HttpServletResponse {
      * of the request. This method must be called prior to reading
      * request parameters or reading input using getReader().
      *
-     * @param characterEncoding String containing the name of the character
-     *                          encoding.
+     * @param charset String containing the name of the character encoding.
      */
     @Override
-    public void setCharacterEncoding(String characterEncoding) {
+    public void setCharacterEncoding(String charset) {
 
         if (isCommitted()) {
             return;
@@ -804,9 +802,9 @@ public class Response implements HttpServletResponse {
         }
 
         try {
-            getCoyoteResponse().setCharacterEncoding(characterEncoding);
+            getCoyoteResponse().setCharacterEncoding(charset);
         } catch (IllegalArgumentException e) {
-            log.warn(sm.getString("coyoteResponse.encoding.invalid", characterEncoding), e);
+            log.warn(sm.getString("coyoteResponse.encoding.invalid", charset), e);
             return;
         }
         isCharacterEncodingSet = true;
@@ -870,7 +868,6 @@ public class Response implements HttpServletResponse {
 
     @Override
     public Collection<String> getHeaderNames() {
-
         MimeHeaders headers = getCoyoteResponse().getMimeHeaders();
         int n = headers.size();
         List<String> result = new ArrayList<>(n);
@@ -884,12 +881,11 @@ public class Response implements HttpServletResponse {
 
     @Override
     public Collection<String> getHeaders(String name) {
-
         Enumeration<String> enumeration =
                 getCoyoteResponse().getMimeHeaders().values(name);
-        Vector<String> result = new Vector<>();
+        List<String> result = new ArrayList<>();
         while (enumeration.hasMoreElements()) {
-            result.addElement(enumeration.nextElement());
+            result.add(enumeration.nextElement());
         }
         return result;
     }
@@ -1404,8 +1400,9 @@ public class Response implements HttpServletResponse {
 
         char cc=name.charAt(0);
         if (cc=='C' || cc=='c') {
-            if (checkSpecialHeader(name, value))
+            if (checkSpecialHeader(name, value)) {
                 return;
+            }
         }
 
         getCoyoteResponse().setHeader(name, value);
@@ -1481,7 +1478,6 @@ public class Response implements HttpServletResponse {
 
     // ------------------------------------------------------ Protected Methods
 
-
     /**
      * Return <code>true</code> if the specified URL should be encoded with
      * a session identifier.  This will be true if all of the following
@@ -1786,9 +1782,7 @@ public class Response implements HttpServletResponse {
     }
 
     private void copyChars(char[] c, int dest, int src, int len) {
-        for (int pos = 0; pos < len; pos++) {
-            c[pos + dest] = c[pos + src];
-        }
+        System.arraycopy(c, src, c, dest, len);
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 07/07: Deprecate FastHttpDateFormat.parseDate(String, DateFormat[])

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit bb5db7713d1ce0097b08095d6a9f8fc7b4d30863
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 21:34:34 2019 +0100

    Deprecate FastHttpDateFormat.parseDate(String,DateFormat[])
---
 java/org/apache/tomcat/util/http/FastHttpDateFormat.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
index ee7f780..1fdb9f6 100644
--- a/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
+++ b/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
@@ -150,7 +150,11 @@ public final class FastHttpDateFormat {
      * @param threadLocalformats Ignored. The local array of
      *                           ConcurrentDateFormat will always be used.
      * @return the date as a long
+     *
+     * @deprecated Unused. This will be removed in Tomcat 10
+     *             Use {@link #parseDate(String)}
      */
+    @Deprecated
     public static final long parseDate(String value, DateFormat[] threadLocalformats) {
         return parseDate(value);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/07: Align with master

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2182c043510c3864d31fbbcfea0a2fc69ee6a957
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 20:32:28 2019 +0100

    Align with master
---
 .../apache/catalina/webresources/FileResource.java |  2 +-
 .../catalina/webresources/JarWarResourceSet.java   |  2 +-
 .../catalina/webresources/LocalStrings.properties  |  3 +-
 .../webresources/LocalStrings_es.properties        | 24 +++++++++
 .../webresources/LocalStrings_fr.properties        | 59 ++++++++++++++++++++++
 .../webresources/LocalStrings_ja.properties        | 59 ++++++++++++++++++++++
 6 files changed, 146 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/webresources/FileResource.java b/java/org/apache/catalina/webresources/FileResource.java
index 2365b50..babe190 100644
--- a/java/org/apache/catalina/webresources/FileResource.java
+++ b/java/org/apache/catalina/webresources/FileResource.java
@@ -47,7 +47,7 @@ public class FileResource extends AbstractResource {
         boolean isEBCDIC = false;
         try {
             String encoding = System.getProperty("file.encoding");
-            if (encoding.indexOf("EBCDIC") != -1) {
+            if (encoding.contains("EBCDIC")) {
                 isEBCDIC = true;
             }
         } catch (SecurityException e) {
diff --git a/java/org/apache/catalina/webresources/JarWarResourceSet.java b/java/org/apache/catalina/webresources/JarWarResourceSet.java
index 52c4de6..adfb265 100644
--- a/java/org/apache/catalina/webresources/JarWarResourceSet.java
+++ b/java/org/apache/catalina/webresources/JarWarResourceSet.java
@@ -222,7 +222,7 @@ public class JarWarResourceSet extends AbstractArchiveResourceSet {
      */
     @Override
     protected JarEntry getArchiveEntry(String pathInArchive) {
-        throw new IllegalStateException("Coding error");
+        throw new IllegalStateException(sm.getString("jarWarResourceSet.codingError"));
     }
 
 
diff --git a/java/org/apache/catalina/webresources/LocalStrings.properties b/java/org/apache/catalina/webresources/LocalStrings.properties
index aa941cc..5b3f8b8 100644
--- a/java/org/apache/catalina/webresources/LocalStrings.properties
+++ b/java/org/apache/catalina/webresources/LocalStrings.properties
@@ -29,7 +29,6 @@ classpathUrlStreamHandler.notFound=Unable to load the resource [{0}] using the t
 
 dirResourceSet.manifestFail=Failed to read manifest from [{0}]
 dirResourceSet.notDirectory=The directory specified by base and internal path [{0}]{1}[{2}] does not exist.
-dirResourceSet.writeExists=The target of the write already exists
 dirResourceSet.writeNpe=The input stream may not be null
 
 extractingRoot.jarFailed=Failed to extract the JAR file [{0}]
@@ -46,6 +45,8 @@ jarResource.getUrlFail=Unable to determine a URL for the resource [{0}] located
 
 jarResourceRoot.invalidWebAppPath=This resource always refers to a directory so the supplied webAppPath must end with / but the provided webAppPath was [{0}]
 
+jarWarResourceSet.codingError=Coding error
+
 standardRoot.checkStateNotStarted=The resources may not be accessed if they are not currently started
 standardRoot.createInvalidFile=Unable to create WebResourceSet from [{0}]
 standardRoot.createNoFileResourceSet=The FileResourceSet feature has not yet been implemented
diff --git a/java/org/apache/catalina/webresources/LocalStrings_es.properties b/java/org/apache/catalina/webresources/LocalStrings_es.properties
new file mode 100644
index 0000000..0a2c28c
--- /dev/null
+++ b/java/org/apache/catalina/webresources/LocalStrings_es.properties
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cache.addFail=Imposible adicionar recursos a [{0}]  de la cache para la applicación web [{1}]  porque no hay suficiente espacio libre luego de eliminar los datos expirados de la caché - considere incrementar el tamaño máximo de la chaché
+
+dirResourceSet.notDirectory=El directorio especificado por la base y el camino interno [{0}]{1}[{2}] no existe.\n
+
+extractingRoot.targetFailed=Fallo al crear directorio [{0}] para los archivos JAR extraidos
+
+jarResource.getUrlFail=Imposible determinar una URL para el recurso [{0}] ubicado en el JAR [{1}]
+
+standardRoot.createUnknownType=Imposible crear  WebResourceSet de tipo desconocido [{0}]\n
diff --git a/java/org/apache/catalina/webresources/LocalStrings_fr.properties b/java/org/apache/catalina/webresources/LocalStrings_fr.properties
new file mode 100644
index 0000000..5a562f8
--- /dev/null
+++ b/java/org/apache/catalina/webresources/LocalStrings_fr.properties
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+abstractArchiveResourceSet.setReadOnlyFalse=Les archives basées sur WebResourceSets telles que celles des JARs sont fixées comme étant en lecture seule et ne peuvent être configurées en lecture écriture
+
+abstractResource.getContentFail=Impossible de retourner [{0}] en tant que tableau d''octets
+abstractResource.getContentTooLarge=Impossible de retourner [{0}] comme tableau d''octets car la ressource a une taille de [{1}] octets qui est supérieure à la taille maximale d''un tableau d''octets
+
+abstractResourceSet.checkPath=Le chemin demandé [{0}] n''est pas valide, il doit commencer par ''/''
+
+cache.addFail=Incapable d''ajouter la ressource située [{0}] au cache de l''application web [{1}] parce qu''il n''y avait pas assez d''espace libre disponible après l''éviction des entrées de cache expirées - envisagez d''augmenter la taille maximale du cache
+cache.backgroundEvictFail=Le processus d''arrière plan d''éviction du cache n''a pas pu nettoyer [{0}] pourcents du cache pour le contexte [{1}], il faudrait augmenter la taille maximale du cache; après l''éviction, approximativement [{2}] KO de données restaient dans le cache
+cache.objectMaxSizeTooBig=La valeur [{0}]kB pour l''objectMaxSize est plus grade que la limite de maxSize/20 son elle a été réduite à [{1}]kB\n
+cache.objectMaxSizeTooBigBytes=La valeur de taille d''objet maximale pouvant être mis en cache de [{0}]kB est supérieure à Integer.MAX_VALUE qui est le maximum, la limite a donc été fixée à Integer.MAX_VALUE octets
+
+classpathUrlStreamHandler.notFound=Impossible de charger la ressource [{0}] en utilisant le chargeur de classe de contexte du thread ou celui de la classe actuelle
+
+dirResourceSet.manifestFail=Impossible de lire le manifeste depuis [{0}]
+dirResourceSet.notDirectory=Le répertoire qui a été spécifié pour la base et le chemin interne [{0}]{1}[{2}] n''existe pas
+dirResourceSet.writeNpe=Le flux d'entrée ne peut pas être null
+
+extractingRoot.jarFailed=Echec de l’extraction du fichier JAR [{0}]
+extractingRoot.targetFailed=Echec de la création du répertoire [{0}] pour l''extraction des fichiers contenus dans le JAR
+
+fileResource.getCanonicalPathFail=Impossible de déterminer le chemin canonique pour la ressource [{0}]
+fileResource.getCreationFail=Impossible de déterminer la date de création de la ressource [{0}]
+fileResource.getUrlFail=Impossible de déterminer l''URL pour la ressource [{0}]
+
+fileResourceSet.notFile=Le fichier spécifié par ses chemins de base et internes [{0}]{1}[{2}] n''existe pas
+
+jarResource.getInputStreamFail=Impossible d''obtenir une InputStream pour la ressource [{0}] située dans le JAR [{1}]
+jarResource.getUrlFail=Impossible de déterminer une URL pour la ressource [{0}] dans le JAR [{1}]
+
+jarResourceRoot.invalidWebAppPath=Cette ressource se réfère toujours à un répertoire donc le webAppPath fourni doit se terminer avec ''/'' mais il était [{0}]
+
+jarWarResourceSet.codingError=Erreur de programmation
+
+standardRoot.checkStateNotStarted=Les resources ne peuvent pas être accédées tant qu'elles ne sont pas démarrées
+standardRoot.createInvalidFile=Impossible de créer WebResourceSet à partir de [{0}]
+standardRoot.createNoFileResourceSet=la fonctionnalité FileResourceSet n'a pas encore été implémentée
+standardRoot.createUnknownType=Impossible de créer un WebResourceSet pour le type inconnu [{0}]
+standardRoot.invalidPath=Le chemin de ressources [{0}] est invalide
+standardRoot.invalidPathNormal=Le chemin de ressource [{0}] a été normalisé en [{1}] ce qui est invalide
+standardRoot.lockedFile=L''application web [{0}] n''a pas fermé le fichier [{1}] ouvert à partir de la trace
+standardRoot.noContext=Un contexte n'a pas été configuré pour ce WebResourceRoot
+standardRoot.startInvalidMain=L''ensemble de ressources principal [{0}] est invalide
+standardRoot.unsupportedProtocol=Le protocole [{0}] de l''URL n''est pas supporté par cette implémentation des ressources web
diff --git a/java/org/apache/catalina/webresources/LocalStrings_ja.properties b/java/org/apache/catalina/webresources/LocalStrings_ja.properties
new file mode 100644
index 0000000..f3f1b30
--- /dev/null
+++ b/java/org/apache/catalina/webresources/LocalStrings_ja.properties
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+abstractArchiveResourceSet.setReadOnlyFalse=JARに基づくWebResourceSetなどのアーカイブベースのWebResourceSetは、読み取り専用にハードコードされており、読み取り/書き込み可能に構成されていない可能性があります。
+
+abstractResource.getContentFail=[{0}]をバイト配列として返すことができません。
+abstractResource.getContentTooLarge=リソースがバイト配列の最大サイズよりも大きいサイズの[{1}]バイトであるため、[{0}]をバイト配列として返すことができません。
+
+abstractResourceSet.checkPath=リクエストパス[{0}]が無効です。 "/"で始まる必要があります。
+
+cache.addFail=有効期限切れの項目を破棄しても利用可能な領域が不足するため、Web アプリケーション [{1}] のキャッシュにリソース [{0}] を追加できません。最大キャッシュサイズの増加を検討してください。
+cache.backgroundEvictFail=コンテキスト [{1}] のバックグラウンドキャッシュ削除処理は全体の [{0}] % を解放できませんでした。キャッシュサイズの最大値の増加を検討してください。現在は約 [{2}] kB のデータがキャッシュに残存しています。
+cache.objectMaxSizeTooBig=objectMaxSizeの[{0}] kBの値がmaxSize / 20の制限より大きいため、[{1}] kBに減少しました。
+cache.objectMaxSizeTooBigBytes=キャッシュ可能なオブジェクトサイズの最大値に指定された [{0}]kB は Integer.MAX_VALUE バイトを越えています。最大値に Integer.MAX_VALUE を設定します。
+
+classpathUrlStreamHandler.notFound=スレッドコンテキストクラスローダー、あるいは、現在のクラスのクラスローダーでリソース [{0}] を読み込みできません。
+
+dirResourceSet.manifestFail=[{0}]からマニフェストを読み込めませんでした。
+dirResourceSet.notDirectory=ベースパスと内部パスで指定した [{0}][{1}][{2}] にディレクトリがありません。
+dirResourceSet.writeNpe=入力ストリームには null を指定できません。
+
+extractingRoot.jarFailed=JARファイル[{0}]の抽出に失敗しました
+extractingRoot.targetFailed=JAR ファイルを展開するためのディレクトリ [{0}] を作成できません。
+
+fileResource.getCanonicalPathFail=リソース [{0}] の正規化パスを取得できません。
+fileResource.getCreationFail=リソース[{0}]の作成時間を特定できません。
+fileResource.getUrlFail=リソース [{0}] の URL を取得できません。
+
+fileResourceSet.notFile=基本パスおよび内部パスで指定されたファイル [{0}]{1}[{2}] がありません。
+
+jarResource.getInputStreamFail=JAR ファイル [{1}] のリソース [{0}] の入力ストリームを取得できません。
+jarResource.getUrlFail=JAR [{1}]にあるリソース[{0}]のURLを特定できません
+
+jarResourceRoot.invalidWebAppPath=このリソースは常にディレクトリを参照するため、指定されたwebAppPathは/で終了する必要がありますが、指定されたwebAppPathは[{0}]です。
+
+jarWarResourceSet.codingError=コーディングエラー
+
+standardRoot.checkStateNotStarted=リソースは、現在起動されていない場合はアクセスできない場合があります
+standardRoot.createInvalidFile=[{0}]からWebResourceSetを作成できません。
+standardRoot.createNoFileResourceSet=FileResourceSet機能はまだ実装されていません。
+standardRoot.createUnknownType=未知のクラス [{0}] の WebResourceSet を作成できません。
+standardRoot.invalidPath=不正なリソースパス [{0}]
+standardRoot.invalidPathNormal=リソースパス[{0}]は有効ではない[{1}]に正規化されています。
+standardRoot.lockedFile=Webアプリケーション[{0}]は、次のスタックトレースによって開かれたファイル[{1}]を閉じることに失敗しました。
+standardRoot.noContext=この WebResourceRoot にはContext が構成されていません。
+standardRoot.startInvalidMain=指定された主リソースセット[{0}]は無効です。
+standardRoot.unsupportedProtocol=URLプロトコル[{0}]はこのWebリソース実装ではサポートされていません。


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 03/07: Align with master. Deprecate

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 111f0d1b952e5c6f428fd809e5978a75be57c8c7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jul 29 20:34:15 2019 +0100

    Align with master. Deprecate
    
    Use org.apache.tomcat.util.http.ConcurrentDateFormat instead
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 5 ++---
 java/org/apache/catalina/servlets/WebdavServlet.java          | 2 +-
 java/org/apache/catalina/util/ConcurrentDateFormat.java       | 4 ++++
 java/org/apache/catalina/webresources/AbstractResource.java   | 6 +++---
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 6c0e5b2..d505c28 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -19,7 +19,6 @@ package org.apache.catalina.authenticator;
 import java.io.IOException;
 import java.security.Principal;
 import java.security.cert.X509Certificate;
-import java.util.Date;
 import java.util.Map;
 import java.util.Set;
 
@@ -55,7 +54,6 @@ import org.apache.catalina.authenticator.jaspic.MessageInfoImpl;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.realm.GenericPrincipal;
-import org.apache.catalina.util.ConcurrentDateFormat;
 import org.apache.catalina.util.SessionIdGeneratorBase;
 import org.apache.catalina.util.StandardSessionIdGenerator;
 import org.apache.catalina.valves.ValveBase;
@@ -65,6 +63,7 @@ import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
+import org.apache.tomcat.util.http.FastHttpDateFormat;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -93,7 +92,7 @@ public abstract class AuthenticatorBase extends ValveBase
     /**
      * "Expires" header always set to Date(1), so generate once only
      */
-    private static final String DATE_ONE = ConcurrentDateFormat.formatRfc1123(new Date(1));
+    private static final String DATE_ONE = FastHttpDateFormat.formatDate(1);
 
     private static final AuthConfigProvider NO_PROVIDER_AVAILABLE = new NoOpAuthConfigProvider();
 
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java
index f820e7e..4c59ac2 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -43,11 +43,11 @@ import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.catalina.WebResource;
 import org.apache.catalina.connector.RequestFacade;
-import org.apache.catalina.util.ConcurrentDateFormat;
 import org.apache.catalina.util.DOMWriter;
 import org.apache.catalina.util.URLEncoder;
 import org.apache.catalina.util.XMLWriter;
 import org.apache.tomcat.util.buf.UDecoder;
+import org.apache.tomcat.util.http.ConcurrentDateFormat;
 import org.apache.tomcat.util.http.FastHttpDateFormat;
 import org.apache.tomcat.util.http.RequestUtil;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
diff --git a/java/org/apache/catalina/util/ConcurrentDateFormat.java b/java/org/apache/catalina/util/ConcurrentDateFormat.java
index 4042b95..7408938 100644
--- a/java/org/apache/catalina/util/ConcurrentDateFormat.java
+++ b/java/org/apache/catalina/util/ConcurrentDateFormat.java
@@ -27,7 +27,11 @@ import java.util.concurrent.ConcurrentLinkedQueue;
  * A thread safe wrapper around {@link SimpleDateFormat} that does not make use
  * of ThreadLocal and - broadly - only creates enough SimpleDateFormat objects
  * to satisfy the concurrency requirements.
+ *
+ * @deprecated Unused. This will be removed in Tomcat 10.
+ *             Use {@link org.apache.tomcat.util.http.ConcurrentDateFormat}
  */
+@Deprecated
 public class ConcurrentDateFormat {
 
     private final String format;
diff --git a/java/org/apache/catalina/webresources/AbstractResource.java b/java/org/apache/catalina/webresources/AbstractResource.java
index 4160a96..ad6e8b2 100644
--- a/java/org/apache/catalina/webresources/AbstractResource.java
+++ b/java/org/apache/catalina/webresources/AbstractResource.java
@@ -17,12 +17,11 @@
 package org.apache.catalina.webresources;
 
 import java.io.InputStream;
-import java.util.Date;
 
 import org.apache.catalina.WebResource;
 import org.apache.catalina.WebResourceRoot;
-import org.apache.catalina.util.ConcurrentDateFormat;
 import org.apache.juli.logging.Log;
+import org.apache.tomcat.util.http.FastHttpDateFormat;
 import org.apache.tomcat.util.res.StringManager;
 
 public abstract class AbstractResource implements WebResource {
@@ -56,9 +55,10 @@ public abstract class AbstractResource implements WebResource {
 
     @Override
     public final String getLastModifiedHttp() {
-        return ConcurrentDateFormat.formatRfc1123(new Date(getLastModified()));
+        return FastHttpDateFormat.formatDate(getLastModified());
     }
 
+
     @Override
     public final String getETag() {
         if (weakETag == null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org