I am curious. I noticed in master you used DateTimeFormatter. The minimum version for Log4j 2.x is now Java 8. Why didn’t you use it here too?
Ralph > On Mar 4, 2021, at 3:56 AM, [email protected] wrote: > > This is an automated email from the ASF dual-hosted git repository. > > vy pushed a commit to branch release-2.x > in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git > > > The following commit(s) were added to refs/heads/release-2.x by this push: > new 8ae3eb8 LOG4J2-2948 Replace HashSet with IdentityHashMap in > ParameterFormatter to detect cycles. (#471) > 8ae3eb8 is described below > > > diff --git > a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java > > b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java > index 5c4cc73..1cc3b0c 100644 > --- > a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java > +++ > b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java > > > - private static ThreadLocal<SimpleDateFormat> threadLocalSimpleDateFormat > = new ThreadLocal<>(); > + private static final ThreadLocal<SimpleDateFormat> > SIMPLE_DATE_FORMAT_REF = > + ThreadLocal.withInitial(() -> new > SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); >
