]> source.dussan.org Git - jgit.git/commitdiff
Suppress non-externalized string warnings 14/1203914/1
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 19 Nov 2024 12:12:53 +0000 (13:12 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 19 Nov 2024 12:12:53 +0000 (13:12 +0100)
Change-Id: Ib0737f7ec6b9872f6d4514d140e7d32a4a40809d

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheStats.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/PackExtBlockCacheTable.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java

index d63c208bbbd1aab3f6f34f23f6808c1f875ee24b..17bf51876d945477736439639616d91ac1d53193 100644 (file)
@@ -51,7 +51,7 @@ public class DfsBlockCacheConfig {
        /** Default number of max cache hits. */
        public static final int DEFAULT_CACHE_HOT_MAX = 1;
 
-       static final String DEFAULT_NAME = "<default>";
+       static final String DEFAULT_NAME = "<default>"; //$NON-NLS-1$
 
        private String name;
 
@@ -91,7 +91,7 @@ public class DfsBlockCacheConfig {
         *            {@link PrintWriter} to write the cache's configuration to.
         */
        public void print(PrintWriter writer) {
-               print(/* linePrefix= */ "", /* pad= */ "  ", writer);
+               print(/* linePrefix= */ "", /* pad= */ "  ", writer); //$NON-NLS-1$//$NON-NLS-2$
        }
 
        /**
@@ -105,14 +105,12 @@ public class DfsBlockCacheConfig {
         * @param writer
         *            {@link PrintWriter} to write the cache's configuration to.
         */
+       @SuppressWarnings("nls")
        private void print(String linePrefix, String pad, PrintWriter writer) {
                String currentPrefixLevel = linePrefix;
                if (!name.isEmpty() || !packExtCacheConfigurations.isEmpty()) {
-                       String name = this.name;
-                       if (name.isEmpty()) {
-                               name = "<Default>";
-                       }
-                       writer.println(linePrefix + "Name: " + name);
+                       writer.println(linePrefix + "Name: "
+                                       + (name.isEmpty() ? DEFAULT_NAME : this.name));
                        currentPrefixLevel += pad;
                }
                writer.println(currentPrefixLevel + "BlockLimit: " + blockLimit);
@@ -602,7 +600,7 @@ public class DfsBlockCacheConfig {
 
                void print(String linePrefix, String pad, PrintWriter writer) {
                        packExtCacheConfiguration.print(linePrefix, pad, writer);
-                       writer.println(linePrefix + pad + "PackExts: "
+                       writer.println(linePrefix + pad + "PackExts: " //$NON-NLS-1$
                                        + packExts.stream().sorted().collect(Collectors.toList()));
                }
        }
index 518db8c82dbf0addc10ac8263a6df9642cf995e4..436f57437e1d5d04281fcdae9db5f63082746f89 100644 (file)
@@ -46,7 +46,7 @@ class DfsBlockCacheStats implements BlockCacheStats {
        private final AtomicReference<AtomicLong[]> liveBytes;
 
        DfsBlockCacheStats() {
-               this("");
+               this(""); //$NON-NLS-1$
        }
 
        DfsBlockCacheStats(String name) {
index 28b021c68f90344087687d29c1424386d1f3dcca..bb44f9397aa26c99e94a6360e122f486fdb31c2c 100644 (file)
@@ -125,10 +125,10 @@ class PackExtBlockCacheTable implements DfsBlockCacheTable {
                Set<DfsBlockCacheTable> blockCacheTables = new HashSet<>();
                blockCacheTables.add(defaultBlockCacheTable);
                blockCacheTables.addAll(packExtBlockCacheTables.values());
-               String name = defaultBlockCacheTable.getName() + ","
+               String name = defaultBlockCacheTable.getName() + "," //$NON-NLS-1$
                                + packExtBlockCacheTables.values().stream()
                                                .map(DfsBlockCacheTable::getName).sorted()
-                                               .collect(Collectors.joining(","));
+                                               .collect(Collectors.joining(",")); //$NON-NLS-1$
                return new PackExtBlockCacheTable(name, defaultBlockCacheTable,
                                List.copyOf(blockCacheTables), packExtBlockCacheTables);
        }
index 24614f7d184d7542ee32b3b0816fc12c64cb16c6..ec1b599b77b8378e04fd7a258636f6ccd329e349 100644 (file)
@@ -244,11 +244,11 @@ public class RecursiveMerger extends ResolveMerger {
        private String failingPathsMessage() {
                int max = 25;
                String failedPaths = failingPaths.entrySet().stream().limit(max)
-                               .map(entry -> entry.getKey() + ":" + entry.getValue())
-                               .collect(Collectors.joining("\n"));
+                               .map(entry -> entry.getKey() + ":" + entry.getValue()) //$NON-NLS-1$
+                               .collect(Collectors.joining("\n")); //$NON-NLS-1$
 
                if (failingPaths.size() > max) {
-                       failedPaths = String.format("%s\n... (%s failing paths omitted)",
+                       failedPaths = String.format("%s\n... (%s failing paths omitted)", //$NON-NLS-1$
                                        failedPaths, failingPaths.size() - max);
                }
                return failedPaths;