Commits

Zemian Deng committed efc222c

Do not parse timezone date input string from release pom.properties.

Comments (0)

Files changed (1)

timemachine-scheduler/src/main/java/timemachine/scheduler/support/VersionUtils.java

 							@SuppressWarnings("unchecked")
 							List<String> lines = IOUtils.readLines(inStream);
 							if (lines.size() >= 2 && lines.get(1).startsWith("#")) {
-								// it should be in this format: #Sun Feb 21 23:38:24 GMT 2010
+								// It should be a string like "#Thu Aug 02 22:36:01 EDT 2012"
 								String dateStr = lines.get(1).substring(1).trim();
-								Date date = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(dateStr);
+								
+								// To minimize the problem of https://bitbucket.org/timemachine/scheduler/issue/27
+								// we will not parse the timezone input.
+								dateStr = dateStr.substring(0, dateStr.length() - 8) +
+									dateStr.substring(dateStr.length() - 4);
+								
+								Date date = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy").parse(dateStr);
 								schedulerVersion += "." + new SimpleDateFormat("MMddyyyyHHmm").format(date);
 							}
 						} catch (Exception e) {