Skip to content
Snippets Groups Projects
Commit 70c63a7e authored by Matthias Sohn's avatar Matthias Sohn
Browse files

Suppress non-externalized string warnings

Change-Id: Ib0737f7ec6b9872f6d4514d140e7d32a4a40809d
parent d44ce061
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ public class DfsBlockCacheConfig { ...@@ -51,7 +51,7 @@ public class DfsBlockCacheConfig {
/** Default number of max cache hits. */ /** Default number of max cache hits. */
public static final int DEFAULT_CACHE_HOT_MAX = 1; 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; private String name;
...@@ -91,7 +91,7 @@ public DfsBlockCacheConfig() { ...@@ -91,7 +91,7 @@ public DfsBlockCacheConfig() {
* {@link PrintWriter} to write the cache's configuration to. * {@link PrintWriter} to write the cache's configuration to.
*/ */
public void print(PrintWriter writer) { public void print(PrintWriter writer) {
print(/* linePrefix= */ "", /* pad= */ " ", writer); print(/* linePrefix= */ "", /* pad= */ " ", writer); //$NON-NLS-1$//$NON-NLS-2$
} }
/** /**
...@@ -105,14 +105,12 @@ public void print(PrintWriter writer) { ...@@ -105,14 +105,12 @@ public void print(PrintWriter writer) {
* @param writer * @param writer
* {@link PrintWriter} to write the cache's configuration to. * {@link PrintWriter} to write the cache's configuration to.
*/ */
@SuppressWarnings("nls")
private void print(String linePrefix, String pad, PrintWriter writer) { private void print(String linePrefix, String pad, PrintWriter writer) {
String currentPrefixLevel = linePrefix; String currentPrefixLevel = linePrefix;
if (!name.isEmpty() || !packExtCacheConfigurations.isEmpty()) { if (!name.isEmpty() || !packExtCacheConfigurations.isEmpty()) {
String name = this.name; writer.println(linePrefix + "Name: "
if (name.isEmpty()) { + (name.isEmpty() ? DEFAULT_NAME : this.name));
name = "<Default>";
}
writer.println(linePrefix + "Name: " + name);
currentPrefixLevel += pad; currentPrefixLevel += pad;
} }
writer.println(currentPrefixLevel + "BlockLimit: " + blockLimit); writer.println(currentPrefixLevel + "BlockLimit: " + blockLimit);
...@@ -602,7 +600,7 @@ private static DfsBlockCachePackExtConfig fromConfig(Config config, ...@@ -602,7 +600,7 @@ private static DfsBlockCachePackExtConfig fromConfig(Config config,
void print(String linePrefix, String pad, PrintWriter writer) { void print(String linePrefix, String pad, PrintWriter writer) {
packExtCacheConfiguration.print(linePrefix, pad, 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())); + packExts.stream().sorted().collect(Collectors.toList()));
} }
} }
......
...@@ -46,7 +46,7 @@ class DfsBlockCacheStats implements BlockCacheStats { ...@@ -46,7 +46,7 @@ class DfsBlockCacheStats implements BlockCacheStats {
private final AtomicReference<AtomicLong[]> liveBytes; private final AtomicReference<AtomicLong[]> liveBytes;
DfsBlockCacheStats() { DfsBlockCacheStats() {
this(""); this(""); //$NON-NLS-1$
} }
DfsBlockCacheStats(String name) { DfsBlockCacheStats(String name) {
......
...@@ -125,10 +125,10 @@ static PackExtBlockCacheTable fromCacheTables( ...@@ -125,10 +125,10 @@ static PackExtBlockCacheTable fromCacheTables(
Set<DfsBlockCacheTable> blockCacheTables = new HashSet<>(); Set<DfsBlockCacheTable> blockCacheTables = new HashSet<>();
blockCacheTables.add(defaultBlockCacheTable); blockCacheTables.add(defaultBlockCacheTable);
blockCacheTables.addAll(packExtBlockCacheTables.values()); blockCacheTables.addAll(packExtBlockCacheTables.values());
String name = defaultBlockCacheTable.getName() + "," String name = defaultBlockCacheTable.getName() + "," //$NON-NLS-1$
+ packExtBlockCacheTables.values().stream() + packExtBlockCacheTables.values().stream()
.map(DfsBlockCacheTable::getName).sorted() .map(DfsBlockCacheTable::getName).sorted()
.collect(Collectors.joining(",")); .collect(Collectors.joining(",")); //$NON-NLS-1$
return new PackExtBlockCacheTable(name, defaultBlockCacheTable, return new PackExtBlockCacheTable(name, defaultBlockCacheTable,
List.copyOf(blockCacheTables), packExtBlockCacheTables); List.copyOf(blockCacheTables), packExtBlockCacheTables);
} }
......
...@@ -244,11 +244,11 @@ private static PersonIdent mockAuthor(List<RevCommit> parents) { ...@@ -244,11 +244,11 @@ private static PersonIdent mockAuthor(List<RevCommit> parents) {
private String failingPathsMessage() { private String failingPathsMessage() {
int max = 25; int max = 25;
String failedPaths = failingPaths.entrySet().stream().limit(max) String failedPaths = failingPaths.entrySet().stream().limit(max)
.map(entry -> entry.getKey() + ":" + entry.getValue()) .map(entry -> entry.getKey() + ":" + entry.getValue()) //$NON-NLS-1$
.collect(Collectors.joining("\n")); .collect(Collectors.joining("\n")); //$NON-NLS-1$
if (failingPaths.size() > max) { 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); failedPaths, failingPaths.size() - max);
} }
return failedPaths; return failedPaths;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment