Index: modules/luni/src/main/java/java/util/Date.java =================================================================== --- modules/luni/src/main/java/java/util/Date.java.orig 2006-03-27 19:23:15.000000000 +0100 +++ modules/luni/src/main/java/java/util/Date.java 2006-03-27 20:34:29.000000000 +0100 @@ -363,6 +363,9 @@ * @deprecated use DateFormat */ public static long parse(String string) { + if (string == null) + throw new IllegalArgumentException(); + char sign = 0; int commentLevel = 0; int offset = 0, length = string.length(), state = 0; Index: modules/luni/src/test/java/tests/api/java/util/DateTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/DateTest.java.orig 2006-03-27 19:23:15.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/DateTest.java 2006-03-27 20:32:37.000000000 +0100 @@ -344,6 +344,17 @@ cal.clear(); cal.set(1999, Calendar.NOVEMBER, 22, 12, 52, 06); assertTrue("Wrong parsed date 5", d.equals(cal.getTime())); + } + + public void test_parse_exception() { + + try { + Date.parse((String)null); + fail("Date.parse(null) should throw IllegalArgumentException"); + } catch (Exception e) { + assertEquals("java.lang.IllegalArgumentException", + e.getClass().getName()); + } } /**