summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-08-17 14:23:29 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2020-11-07 03:53:13 -0500
commitf39f848c99e4313e4dbd860744a5b4b864e060bf (patch)
treed49eb5129a01d97dd11d8bba2b258eeff1f0b7b9
parent4f3161d3cc1af6ff725d6e7fb21909001df62705 (diff)
downloadjgit-f39f848c99e4313e4dbd860744a5b4b864e060bf.tar.gz
jgit-f39f848c99e4313e4dbd860744a5b4b864e060bf.zip
Document that setLastModified sets time of symlink target
Due to Java bug JDK-8220793 [1] Java cannot set timestamps of a symlink but only of the symlink target. This bug was fixed in Java 13. Since we don't have a use case to set the timestamp of the symlink itself simply document the current behavior of setLastModified methods. [1] https://bugs.openjdk.java.net/browse/JDK-8220793 Change-Id: Ibc28c1702a1b9845602bd257606fbd44803a43fb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java4
2 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
index bf7b753693..d8cab358e7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -1080,8 +1080,9 @@ public abstract class FS {
}
/**
- * Set the last modified time of a file system object. If the OS/JRE support
- * symbolic links, the link is modified, not the target,
+ * Set the last modified time of a file system object.
+ * <p>
+ * For symlinks it sets the modified time of the link target.
*
* @param f
* a {@link java.io.File} object.
@@ -1097,8 +1098,9 @@ public abstract class FS {
}
/**
- * Set the last modified time of a file system object. If the OS/JRE support
- * symbolic links, the link is modified, not the target,
+ * Set the last modified time of a file system object.
+ * <p>
+ * For symlinks it sets the modified time of the link target.
*
* @param p
* a {@link Path} object.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
index c43956e53d..aa39a44642 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
@@ -710,6 +710,8 @@ public class FileUtils {
}
/**
+ * Set the last modified time of a file system object.
+ *
* @param file
* @param time
* @throws IOException
@@ -720,6 +722,8 @@ public class FileUtils {
}
/**
+ * Set the last modified time of a file system object.
+ *
* @param path
* @param time
* @throws IOException