aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
diff options
context:
space:
mode:
authorAlex Blewitt <alex.blewitt@gmail.com>2020-02-25 21:14:59 +0000
committerMatthias Sohn <matthias.sohn@sap.com>2020-03-04 15:59:53 +0100
commit093fbbd11e01711efc1567d6c31516a448d2a455 (patch)
tree1352256c9bb5f9a48b9ffcbb84c5563c135538d3 /org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
parent30fb4808f2407cbea6c8cf46189033b0231aa423 (diff)
downloadjgit-093fbbd11e01711efc1567d6c31516a448d2a455.tar.gz
jgit-093fbbd11e01711efc1567d6c31516a448d2a455.zip
Expose FileStoreAttributes.setBackground()
The FS.setAsyncFileStoreAttributes() static method calls FileStoreAttributes.setBackground() as its implementation, but there are other public attributes on this inner class already and there isn't a real reason why this needs to be private. By making it public we allow callers to be able to invoke it directly. Although it doesn't appear that it would make a difference, by calling a static method on the FS class, all static fields and the transitive closure of class dependencies must be loaded and initialised, which can be non-trivial. Callers referring to FS.setAsyncFileStoreAttributes() may be replaced with FS.FileStoreAttributes.setBackground() with no change of behaviour other than improved performance due to less class loading required. Bug: 560527 Change-Id: I9538acc90da8d18f53fd60d74eb54496857f93a5 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java13
1 files changed, 12 insertions, 1 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 265950261a..2446de4c1e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -242,7 +242,16 @@ public abstract class FS {
private static Map<FileStore, Lock> locks = new ConcurrentHashMap<>();
- private static void setBackground(boolean async) {
+ /**
+ * Whether FileStore attributes should be determined asynchronously
+ *
+ * @param async
+ * whether FileStore attributes should be determined
+ * asynchronously. If false access to cached attributes may block
+ * for some seconds for the first call per FileStore
+ * @since 5.6.2
+ */
+ public static void setBackground(boolean async) {
background.set(async);
}
@@ -709,7 +718,9 @@ public abstract class FS {
* asynchronously. If false access to cached attributes may block
* for some seconds for the first call per FileStore
* @since 5.1.9
+ * @deprecated Use {@link FileStoreAttributes#setBackground} instead
*/
+ @Deprecated
public static void setAsyncFileStoreAttributes(boolean asynch) {
FileStoreAttributes.setBackground(asynch);
}