You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2024/01/29 23:35:23 UTC

(lucene) 01/06: Remove concatenation in String.format() calls (#13038)

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 659ed4bdb731c75f7f827ff307b15627a2e3601b
Author: Dmitry Cherniachenko <2s...@gmail.com>
AuthorDate: Tue Jan 30 00:13:31 2024 +0100

    Remove concatenation in String.format() calls (#13038)
---
 .../apache/lucene/replicator/nrt/PreCopyMergedSegmentWarmer.java  | 3 ++-
 .../test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java  | 8 +++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PreCopyMergedSegmentWarmer.java b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PreCopyMergedSegmentWarmer.java
index dc7034904d7..e3e42224ecf 100644
--- a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PreCopyMergedSegmentWarmer.java
+++ b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/PreCopyMergedSegmentWarmer.java
@@ -60,7 +60,8 @@ class PreCopyMergedSegmentWarmer implements IndexReaderWarmer {
     primary.message(
         String.format(
             Locale.ROOT,
-            "top: done warm merge " + info + ": took %.3f sec, %.1f MB",
+            "top: done warm merge %s: took %.3f sec, %.1f MB",
+            info,
             (System.nanoTime() - startNS) / (double) TimeUnit.SECONDS.toNanos(1),
             info.sizeInBytes() / 1024. / 1024.));
     primary.finishedMergedFiles.addAll(filesMetaData.keySet());
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java
index 66a011dacaf..16892feed08 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/SimplePrimaryNode.java
@@ -242,11 +242,9 @@ class SimplePrimaryNode extends PrimaryNode {
           message(
               String.format(
                   Locale.ROOT,
-                  "top: warning: still warming merge "
-                      + info
-                      + " to "
-                      + preCopy.connections.size()
-                      + " replicas for %.1f sec...",
+                  "top: warning: still warming merge %s to %d replicas for %.1f sec...",
+                  info,
+                  preCopy.connections.size(),
                   (ns - startNS) / (double) TimeUnit.SECONDS.toNanos(1)));
           lastWarnNS = ns;
         }