In CVS 1.12.12 the command "cvs log" uses "-" as date separator (e.g. 2005-10-02). Other CVS versions use "/" as separator (e.g. 2005/10/02). Ant ChangeLogParser does not understand the "-" format and throws a NullPointerException in java.util.Date#after(). The following patch fixes the problem: --- ChangeLogParser.java.1 2005-06-02 15:20:00.000000000 +0200 +++ ChangeLogParser.java.2 2005-11-25 10:21:56.000000000 +0100 @@ -36,12 +36,15 @@ private static final int GET_PREVIOUS_REV = 5; /** input format for dates read in from cvs log */ - private static final SimpleDateFormat c_inputDate - = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + private static final SimpleDateFormat[] c_inputDates = { + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"), + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") + }; static { TimeZone utc = TimeZone.getTimeZone("UTC"); - c_inputDate.setTimeZone(utc); + for (int i = 0; i < c_inputDates.length; i++) + c_inputDates[i].setTimeZone(utc); } //The following is data used while processing stdout of CVS command @@ -215,13 +218,14 @@ * @return the date object or null if unknown date format */ private Date parseDate(final String date) { + for (int i = 0; i < c_inputDates.length; i++) { try { - return c_inputDate.parse(date); + return c_inputDates[i].parse(date); } catch (ParseException e) { - //final String message = REZ.getString( "changelog.bat-date.error", date ); - //getContext().error( message ); - return null; + // ignore } + } + return null; } /**
*** This bug has been marked as a duplicate of 30962 ***