#fixed code
                                public void testParse() {
        final Calendar cal = new GregorianCalendar();
        cal.setTimeZone(TimeZone.getTimeZone("GMT"));

        // four-digit year
        String sDate = "Tue, 19 Jul 2005 23:00:51 GMT";
        cal.setTime(DateParser.parseRFC822(sDate, Locale.US));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // two-digit year
        sDate = "Tue, 19 Jul 05 23:00:51 GMT";
        cal.setTime(DateParser.parseRFC822(sDate, Locale.US));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // four-digit year
        sDate = "Tue, 19 Jul 2005 23:00:51 UT";
        cal.setTime(DateParser.parseRFC822(sDate, Locale.US));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // two-digit year
        sDate = "Tue, 19 Jul 05 23:00:51 UT";
        cal.setTime(DateParser.parseRFC822(sDate, Locale.US));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // RFC822
        sDate = "Tue, 19 Jul 2005 23:00:51 GMT";
        assertNotNull(DateParser.parseDate(sDate, Locale.US));

        // RFC822
        sDate = "Tue, 19 Jul 05 23:00:51 GMT";
        assertNotNull(DateParser.parseDate(sDate, Locale.US));

        final Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
        c.set(2000, Calendar.JANUARY, 01, 0, 0, 0);
        final Date expectedDate = c.getTime();

        // W3C
        sDate = "2000-01-01T00:00:00Z";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate, Locale.US).getTime() / 1000);

        // W3C
        sDate = "2000-01-01T00:00Z";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate, Locale.US).getTime() / 1000);

        // W3C
        sDate = "2000-01-01";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate, Locale.US).getTime() / 1000);

        // W3C
        sDate = "2000-01";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate, Locale.US).getTime() / 1000);

        // W3C
        sDate = "2000";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate, Locale.US).getTime() / 1000);

        // EXTRA
        sDate = "18:10 2000/10/10";
        assertNotNull(DateParser.parseDate(sDate, Locale.US));

        // INVALID
        sDate = "X20:10 2000-10-10";
        assertNull(DateParser.parseDate(sDate, Locale.US));

    }
#vulnerable code 
                                public void testParse() {
        final Calendar cal = new GregorianCalendar();
        cal.setTimeZone(TimeZone.getTimeZone("GMT"));

        // four-digit year
        String sDate = "Tue, 19 Jul 2005 23:00:51 GMT";
        cal.setTime(DateParser.parseRFC822(sDate));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // two-digit year
        sDate = "Tue, 19 Jul 05 23:00:51 GMT";
        cal.setTime(DateParser.parseRFC822(sDate));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // four-digit year
        sDate = "Tue, 19 Jul 2005 23:00:51 UT";
        cal.setTime(DateParser.parseRFC822(sDate));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // two-digit year
        sDate = "Tue, 19 Jul 05 23:00:51 UT";
        cal.setTime(DateParser.parseRFC822(sDate));

        assertEquals(2005, cal.get(Calendar.YEAR));
        assertEquals(6, cal.get(Calendar.MONTH)); // month is zero-indexed
        assertEquals(19, cal.get(Calendar.DAY_OF_MONTH));
        assertEquals(3, cal.get(Calendar.DAY_OF_WEEK));
        assertEquals(23, cal.get(Calendar.HOUR_OF_DAY));
        assertEquals(0, cal.get(Calendar.MINUTE));
        assertEquals(51, cal.get(Calendar.SECOND));

        // RFC822
        sDate = "Tue, 19 Jul 2005 23:00:51 GMT";
        assertNotNull(DateParser.parseDate(sDate));

        // RFC822
        sDate = "Tue, 19 Jul 05 23:00:51 GMT";
        assertNotNull(DateParser.parseDate(sDate));

        final Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
        c.set(2000, Calendar.JANUARY, 01, 0, 0, 0);
        final Date expectedDate = c.getTime();

        // W3C
        sDate = "2000-01-01T00:00:00Z";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate).getTime() / 1000);

        // W3C
        sDate = "2000-01-01T00:00Z";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate).getTime() / 1000);

        // W3C
        sDate = "2000-01-01";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate).getTime() / 1000);

        // W3C
        sDate = "2000-01";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate).getTime() / 1000);

        // W3C
        sDate = "2000";
        assertEquals(expectedDate.getTime() / 1000, DateParser.parseDate(sDate).getTime() / 1000);

        // EXTRA
        sDate = "18:10 2000/10/10";
        assertNotNull(DateParser.parseDate(sDate));

        // INVALID
        sDate = "X20:10 2000-10-10";
        assertNull(DateParser.parseDate(sDate));

    } 
                            #location 67 
                            #vulnerability type NULL_DEREFERENCE