Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3581

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 2.2.1
    • None
    • Core Actions
    • None

    Description

      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 )

      Attachments

        Activity

          People

            Unassigned Unassigned
            nancyesmis Xiaoming Shi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: