@Test public void testMultipleDateFormats() throws ParseException { String[][] tests = new String[][]{ {"2016-01-01 10:00:00", "'abcd'", "yyyy", "yyyy-MM-dd HH:mm:ss"}, {"2016 Sat, 5 Apr 2008 15:12:51 +0000", "yyyy d MMM yyyy HH:mm:ss Z", "yyyy EE, d MMM yyyy HH:mm:ss Z"}, {"Sat, 5 Apr 2008 15:12:51 +0000", "d MMM yyyy Z", "EE, d MMM yyyy HH:mm:ss Z"}, {"2016_01_01T10:00:00Z", "yyyy_MM_dd'T'HH:mm:ss'Z'"}, {"2016-01-01 10:00", "yyyy-MM-dd", "yyyy-MM-dd HH", "yyyy-MM-dd HH:mm"}, {"2016_01_01 10:00 +0000", "yyyy_MM_dd HH:mm Z"}, {"2016-01-01 10:00:00 +0000", "yyyy-MM-dd HH:mm:ss Z", "'bad format'"}, {"2016-01-01 10:00 +0000", "y-MM-d HH:mm", "yyyy-MM-dd HH:mm Z"}, {"2016-01-02 10:00 +0000", "yyyy-MM HH:mm Z", "yyyy-MM-dd HH:mm Z"} }; for (String[] test : tests) { RepositoryImplementation repository = new RepositoryImplementation(); repository.setDatePatterns(Arrays.copyOfRange(test, 1, test.length)); repository.parse(test[0]); } }
public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); String getRepoCommand(); boolean getHistoryGet(
            File target, String parent, String basename, String rev); InputStream getHistoryGet(
            String parent, String basename, String rev); final boolean isRepositoryFor(File file); final String determineParent(); final String determineBranch(); List<String> getIgnoredFiles(); List<String> getIgnoredDirs(); final String determineCurrentVersion(); String format(Date date); Date parse(String dateString); }
Repository extends RepositoryInfo { public Date parse(String dateString) throws ParseException { final DateFormat format = getDateFormat(); synchronized (format) { return format.parse(dateString); } } Repository(); String getRepoCommand(); boolean getHistoryGet(
            File target, String parent, String basename, String rev); InputStream getHistoryGet(
            String parent, String basename, String rev); final boolean isRepositoryFor(File file); final String determineParent(); final String determineBranch(); List<String> getIgnoredFiles(); List<String> getIgnoredDirs(); final String determineCurrentVersion(); String format(Date date); Date parse(String dateString);  }