This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/7.0.x by this push:
new e1d3469 Make the ms pattern constant public and use it
e1d3469 is described below
commit e1d34696dfc0ee71a37041a96cede811983e3155
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Mar 4 19:04:12 2020 +0000
Make the ms pattern constant public and use it
---
java/org/apache/juli/DateFormatCache.java | 4 ++--
java/org/apache/juli/OneLineFormatter.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/juli/DateFormatCache.java
b/java/org/apache/juli/DateFormatCache.java
index a311472..5b93e6e 100644
--- a/java/org/apache/juli/DateFormatCache.java
+++ b/java/org/apache/juli/DateFormatCache.java
@@ -43,7 +43,7 @@ import java.util.TimeZone;
*/
public class DateFormatCache {
- private static final String msecPattern = "#";
+ public static final char MSEC_PATTERN = '#';
/* Timestamp format */
private final String format;
@@ -70,7 +70,7 @@ public class DateFormatCache {
if (escape || x != 'S') {
result.append(x);
} else {
- result.append(msecPattern);
+ result.append(MSEC_PATTERN);
}
if (x == '\'') {
escape = !escape;
diff --git a/java/org/apache/juli/OneLineFormatter.java
b/java/org/apache/juli/OneLineFormatter.java
index 3daf126..44a74f4 100644
--- a/java/org/apache/juli/OneLineFormatter.java
+++ b/java/org/apache/juli/OneLineFormatter.java
@@ -198,7 +198,7 @@ public class OneLineFormatter extends Formatter {
// Some version of replace
long frac = timestamp % 1000;
// Formatted string may vary in length so the insert point may vary
- int insertStart = cachedTimeStamp.indexOf('#');
+ int insertStart =
cachedTimeStamp.indexOf(DateFormatCache.MSEC_PATTERN);
buf.append(cachedTimeStamp.subSequence(0, insertStart));
if (frac < 100 && millisHandling == MillisHandling.REPLACE_SSS) {
buf.append('0');
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]