Index: src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java =================================================================== --- src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java (revision 468250) +++ src/test/java/org/apache/harmony/text/tests/java/text/DateFormatTest.java (working copy) @@ -19,6 +19,7 @@ import java.text.DateFormat; import java.text.DateFormatSymbols; import java.text.NumberFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @@ -445,4 +446,17 @@ format.setNumberFormat(f1); assertTrue("Not identical NumberFormat", f1 == format.getNumberFormat()); } + + /** + * @tests java.text.DateFormat#parse(String) + */ + public void test_parse_LString() { + DateFormat format = DateFormat.getInstance(); + try { + format.parse("not a Date"); + fail("should throw ParseException first"); + } catch (ParseException e) { + assertNotNull(e.getMessage()); + } + } } Index: src/main/java/java/text/DateFormat.java =================================================================== --- src/main/java/java/text/DateFormat.java (revision 468250) +++ src/main/java/java/text/DateFormat.java (working copy) @@ -506,7 +506,9 @@ ParsePosition position = new ParsePosition(0); Date date = parse(string, position); if (position.getErrorIndex() != -1 || position.getIndex() == 0) { - throw new ParseException(null, position.getErrorIndex()); + // text.19=Unparseable date: {0} + throw new ParseException( + Messages.getString("text.19", string), position.getErrorIndex()); //$NON-NLS-1$ } return date; } Index: src/main/java/org/apache/harmony/text/internal/nls/messages.properties =================================================================== --- src/main/java/org/apache/harmony/text/internal/nls/messages.properties (revision 468250) +++ src/main/java/org/apache/harmony/text/internal/nls/messages.properties (working copy) @@ -41,3 +41,4 @@ text.16=Unknown element format text.17=Unknown format text.18=Not a valid {0}, subclass should override readResolve() +text.19=Unparseable date: {0}