I did neither replace the usage of SimpleDateFormat in release-2.x, nor implemented myself DateTimeFormatter in master. I have just touched to the indentation in release-2.x. I deliberately left it out since it wasn't related to the ticket and I could not invest time into figuring out the reason for the discrepancy.
On Thu, Mar 4, 2021 at 4:48 PM Ralph Goers <[email protected]> wrote: > 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")); > > > > >
