vlsi commented on code in PR #5796:
URL: https://github.com/apache/jmeter/pull/5796#discussion_r1148534522


##########
src/functions/src/main/java/org/apache/jmeter/functions/TimeFunction.java:
##########
@@ -96,13 +99,17 @@ public String execute(SampleResult previousResult, Sampler 
currentSampler) throw
                 long div = Long.parseLong(fmt.substring(1)); // should never 
case NFE
                 datetime = Long.toString(System.currentTimeMillis() / div);
             } else {
-                if (fmt.contains("u")) {
+                DateTimeFormatter df = DateTimeFormatter // Not synchronised, 
so can't be shared
+                        .ofPattern(fmt);

Review Comment:
   Is it really non-thread-safe?
   
   The javadoc says otherwise: 
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
   
   > A formatter created from a pattern can be used as many times as necessary, 
it is immutable and is thread-safe.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to