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

Russole pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 4827609bbd6 HDDS-16978. Reuse DateTimeFormatter instance in 
IsoDateAdapter (#11521)
4827609bbd6 is described below

commit 4827609bbd6493aa144412f76679d81b31c84ae4
Author: fmorg-git <[email protected]>
AuthorDate: Thu Oct 15 09:10:53 2026 -0700

    HDDS-16978. Reuse DateTimeFormatter instance in IsoDateAdapter (#11521)
    
    Co-authored-by: Fabian Morgan <[email protected]>
---
 .../apache/hadoop/ozone/s3/commontypes/IsoDateAdapter.java    | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/commontypes/IsoDateAdapter.java
 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/commontypes/IsoDateAdapter.java
index faaf6b85898..f3d76e82919 100644
--- 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/commontypes/IsoDateAdapter.java
+++ 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/commontypes/IsoDateAdapter.java
@@ -27,13 +27,8 @@
  */
 public class IsoDateAdapter extends XmlAdapter<String, Instant> {
 
-  private DateTimeFormatter iso8861Formatter;
-
-  public IsoDateAdapter() {
-    iso8861Formatter =
-        DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX")
-            .withZone(ZoneOffset.UTC);
-  }
+  private static final DateTimeFormatter ISO_8861_FORMATTER = 
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX")
+      .withZone(ZoneOffset.UTC);
 
   @Override
   public Instant unmarshal(String v) throws Exception {
@@ -42,6 +37,6 @@ public Instant unmarshal(String v) throws Exception {
 
   @Override
   public String marshal(Instant v) throws Exception {
-    return iso8861Formatter.format(v);
+    return ISO_8861_FORMATTER.format(v);
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to