summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-11-15 16:02:43 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-11-15 16:02:43 +0100
commit91c9146224cf2f8c9053cf565fa292c983acaca0 (patch)
tree5ac3bf02cb719e04782085363837006cf718c86a
parent4aaf8cad90ad94d96cf93f6163562b496a3bef7a (diff)
downloadjgit-91c9146224cf2f8c9053cf565fa292c983acaca0.tar.gz
jgit-91c9146224cf2f8c9053cf565fa292c983acaca0.zip
Fix typo in constant name CONFIG_KEY_STREAM_FILE_TRESHOLD
Since it's part of the API deprecate the wrong spelling and add the correct one with the same value. Change-Id: I0f6ea95a5e66c9e80142eb6d40eb7ec3a7aaf8e2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java13
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java4
3 files changed, 15 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java
index 146f76167d..f2ac461deb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java
@@ -14,7 +14,7 @@ import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_CORE_SECTION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_DFS_SECTION;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_DELTA_BASE_CACHE_LIMIT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_BUFFER;
-import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_FILE_TRESHOLD;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_FILE_THRESHOLD;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.storage.pack.PackConfig;
@@ -157,7 +157,7 @@ public class DfsReaderOptions {
long sft = rc.getLong(
CONFIG_CORE_SECTION,
CONFIG_DFS_SECTION,
- CONFIG_KEY_STREAM_FILE_TRESHOLD,
+ CONFIG_KEY_STREAM_FILE_THRESHOLD,
getStreamFileThreshold());
sft = Math.min(sft, maxMem / 4); // don't use more than 1/4 of the heap
sft = Math.min(sft, Integer.MAX_VALUE); // cannot exceed array length
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
index 9852ae3786..aad1342fe2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
@@ -337,8 +337,17 @@ public final class ConfigConstants {
*/
public static final String CONFIG_KEY_SYMLINKS = "symlinks";
- /** The "streamFileThreshold" key */
- public static final String CONFIG_KEY_STREAM_FILE_TRESHOLD = "streamFileThreshold";
+ /**
+ * The "streamFileThreshold" key
+ *
+ * @since 6.8
+ */
+ public static final String CONFIG_KEY_STREAM_FILE_THRESHOLD = "streamFileThreshold";
+
+ /**
+ * @Deprecated typo, use CONFIG_KEY_STREAM_FILE_THRESHOLD instead
+ */
+ public static final String CONFIG_KEY_STREAM_FILE_TRESHOLD = CONFIG_KEY_STREAM_FILE_THRESHOLD;
/**
* The "packedGitMmap" key
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
index 27795ab96b..571248eac6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java
@@ -16,7 +16,7 @@ import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_LIMIT;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_MMAP;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_OPENFILES;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_WINDOWSIZE;
-import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_FILE_TRESHOLD;
+import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_STREAM_FILE_THRESHOLD;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_GIT_USE_STRONGREFS;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_PACKED_INDEX_GIT_USE_STRONGREFS;
@@ -314,7 +314,7 @@ public class WindowCacheConfig {
long maxMem = Runtime.getRuntime().maxMemory();
long sft = rc.getLong(CONFIG_CORE_SECTION, null,
- CONFIG_KEY_STREAM_FILE_TRESHOLD, getStreamFileThreshold());
+ CONFIG_KEY_STREAM_FILE_THRESHOLD, getStreamFileThreshold());
sft = Math.min(sft, maxMem / 4); // don't use more than 1/4 of the heap
sft = Math.min(sft, Integer.MAX_VALUE); // cannot exceed array length
setStreamFileThreshold((int) sft);