ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1451412 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyTask.java
Date Thu, 28 Feb 2013 22:50:45 GMT
Author: maartenc
Date: Thu Feb 28 22:50:44 2013
New Revision: 1451412

URL: http://svn.apache.org/r1451412
Log:
FIX: Parsing publication date in Ant tasks not thread-safe (IVY-1412)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1451412&r1=1451411&r2=1451412&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Feb 28 22:50:44 2013
@@ -143,6 +143,7 @@ for detailed view of each issue, please 
 - IMPROVEMENT: add support for source bundles from p2 repositories
 - IMPROVEMENT: add support for source URI from OBR repositories
 
+- FIX: Parsing publication date in Ant tasks not thread-safe (IVY-1412)
 - FIX: NullPointerException when using httpclient and server doesn't return content-type
header (IVY-1400) (thanks to Frederic Riviere)
 - FIX: Properly handle evicted nodes in ResolveReport
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java?rev=1451412&r1=1451411&r2=1451412&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java Thu Feb 28 22:50:44 2013
@@ -17,8 +17,6 @@
  */
 package org.apache.ivy.ant;
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Locale;
 
@@ -27,6 +25,7 @@ import org.apache.ivy.core.IvyContext;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.report.ResolveReport;
 import org.apache.ivy.core.settings.IvySettings;
+import org.apache.ivy.util.DateUtil;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.StringUtils;
 import org.apache.tools.ant.BuildException;
@@ -184,19 +183,16 @@ public abstract class IvyTask extends Ta
         return StringUtils.join(conf, ", ");
     }
 
-    private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");
-
     protected static Date getPubDate(String date, Date def) {
         if (date != null) {
             if ("now".equals(date.toLowerCase(Locale.US))) {
                 return new Date();
             }
             try {
-                return DATE_FORMAT.parse(date);
+                return DateUtil.parse(date);
             } catch (Exception ex) {
-                throw new BuildException(
-                        "publication date provided in bad format. should be yyyyMMddHHmmss
and not "
-                                + date);
+                throw new BuildException("Publication date provided in bad format. Should
be '" 
+                                + DateUtil.DATE_FORMAT_PATTERN + "' and not '" + date + "'!");
             }
         } else {
             return def;



Mime
View raw message