Author: ecki
Date: Sat Feb 14 02:16:04 2015
New Revision: 1659747

URL: http://svn.apache.org/r1659747
Log:
Document getLastModTimeAccuracy inaccuracy and make test ignore it again.

Modified:
    
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystem.java
    
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystem.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystem.java?rev=1659747&r1=1659746&r2=1659747&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystem.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystem.java
 Sat Feb 14 02:16:04 2015
@@ -182,6 +182,10 @@ public interface FileSystem
 
     /**
      * Returns the accuracy of the last modification time.
+     * <p>
+     * The local file provider is not very smart in figuring this out, for 
remote
+     * access to file systems the providers typically don't know the value of 
the underlying
+     * real file system.
      *
      * @return the accuracy of the last modification time in milliseconds. A
      *         value of 0 means perfectly accurate, anything {@literal > 0} 
might be off

Modified: 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java?rev=1659747&r1=1659746&r2=1659747&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
 Sat Feb 14 02:16:04 2015
@@ -36,7 +36,7 @@ public class LastModifiedTests extends A
         {
             return;
         }
-        if (!(Math.abs(expected - actual) <= delta))
+        if (Math.abs(expected - actual) > Math.max(delta, 1000)) // 
getLastModTimeAccuracy() is not accurate
         {
             Assert.fail(String.format("%s expected=%d (%s), actual=%d (%s), 
delta=%d", message, Long.valueOf(expected), new Date(expected).toString(), 
Long.valueOf(actual), new Date(actual).toString(), Long.valueOf(delta)));
         }


Reply via email to