Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-547

api2 ObjectIdentityTest.testStringNullDateConstructor fails due to unexpected date format in different locales

    XMLWordPrintableJSON

Details

    Description

      Method testStringNullDateConstructor of api2 test class ObjectIdentityTest uses a DateFormat instance obtained by DateFormat.getInstance(). This returns the default date/time formatter which is then used to parse a date in format "M/d/yy h:mm a".

      This does not work in case the default date/time formatter uses a format different from "M/d/yy h:mm a", because of a different locale. E.g. the format for the German locale is "dd.MM.yy HH:mm". This leads to an exception when parsing the date string:
      Testcase: testStringNullDateConstructor(javax.jdo.identity.ObjectIdentityTest): Caused an ERROR
      Error parsing Date string "10/9/2007 4:26 PM" at position 2 using date format "dd.MM.yy HH:mm".
      javax.jdo.JDOUserException: Error parsing Date string "10/9/2007 4:26 PM" at position 2 using date format "dd.MM.yy HH:mm".

      Attachments

        1. JDO-547.patch
          2 kB
          Michael Bouschen

        Activity

          People

            mbo Michael Bouschen
            mbo Michael Bouschen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: