Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1373

SimpleDateFormat not thread safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0-RC1
    • 2.3.0-RC2
    • Core
    • None

    Description

      Class org.apache.ivy.Ivy defines

      public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");

      SimpleDateFormat is not thread safe. Errors might occur like

      Caused by: java.lang.NumberFormatException: multiple points
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
        at java.lang.Double.parseDouble(Double.java:540)
        at java.text.DigitList.getDouble(DigitList.java:168)
        at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1791)
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1455)
        at java.text.DateFormat.parse(DateFormat.java:355)
        at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.infoStarted(XmlModuleDescriptorParser.java:935)
        at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.startElement(XmlModuleDescriptorParser.java:297)
      

      Attachments

        Activity

          People

            maartenc Maarten Coene
            wofrank Wolfgang Frank
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: