DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve 
performance
------------------------------------------------------------------------------------------

                 Key: WW-3581
                 URL: https://issues.apache.org/jira/browse/WW-3581
             Project: Struts 2
          Issue Type: Improvement
          Components: Core Actions
    Affects Versions: 2.2.1
            Reporter: Xiaoming Shi
            Priority: Critical


In the file
./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java
  line:547

DateFormat.getDateTimeInstance() is called 3 times for each function call of 
"parseDateString"

We can add a class field to store the instances to improve performance.

Similar code can be found in 
(./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
  line: 323)

(Similar to the Appache Bug 
https://issues.apache.org/bugzilla/show_bug.cgi?id=48778 )

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to