We are launching Java 1.4.
We have this method:
static SimpleDateFormat xmlFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); public static Date fromXml(String xmlDateTime) { ParsePosition pp = new ParsePosition(0); return xmlFormatter.parse(xmlDateTime, pp); }
Where xmlDateTime = 2013-08-22T16:03:00 e.g. It works, but it suddenly stopped!
Now we get this exception:
java.lang.ArrayIndexOutOfBoundsException: -1 at java.text.DigitList.fitsIntoLong(DigitList.java:170) at java.text.DecimalFormat.parse(DecimalFormat.java:1064) at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1381) at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1159)
I tried to reproduce this in Unit Test using different date formats, for example:
2013-08-22T16:03:00 2013-08-22 16:03:00
But no luck! Any ideas?
source share