Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-849

FastDateFormat and FastDatePrinter generates Date objects wastefully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • lang.time.*
    • None

    Description

      The code:

      @Override
      public String format(long millis)

      { return format(new Date(millis)); }

      should be:

      @Override
      public String format(long millis)

      { return printer.format(millis); }

      There is no need to create the extra Date object.

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: