commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r645441 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
Date Mon, 07 Apr 2008 10:09:42 GMT
Author: sebb
Date: Mon Apr  7 03:09:40 2008
New Revision: 645441

URL: http://svn.apache.org/viewvc?rev=645441&view=rev
Log:
NET-211 - setLenient() does not work across a year boundary

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=645441&r1=645440&r2=645441&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
Mon Apr  7 03:09:40 2008
@@ -99,6 +99,11 @@
 
 		Date parsed = null;
 		if (recentDateFormat != null) {
+            if (lenientFutureDates) {
+                // add a day to "now" so that "slop" doesn't cause a date 
+                // slightly in the future to roll back a full year.  (Bug 35181)
+                now.add(Calendar.DATE, 1);
+            }    
 			parsed = recentDateFormat.parse(timestampStr, pp);
 		}
 		if (parsed != null && pp.getIndex() == timestampStr.length()) 
@@ -106,11 +111,6 @@
 			working.setTime(parsed);
 			working.set(Calendar.YEAR, now.get(Calendar.YEAR));
 
-			if (lenientFutureDates) {
-				// add a day to "now" so that "slop" doesn't cause a date 
-				// slightly in the future to roll back a full year.  (Bug 35181)
-				now.add(Calendar.DATE, 1);
-			}    
 			if (working.after(now)) {
 				working.add(Calendar.YEAR, -1);
 			}



Mime
View raw message