Merge branch 'stable-2.15' * stable-2.15: CreateReviewNotes: Use Logger's built-in string formatting Change-Id: Ib1b4ff88c7cb573a6df6f493e755b14b8393bdd8
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java index 0ccc648..4f6866b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java +++ b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/CreateReviewNotes.java
@@ -109,9 +109,9 @@ ProjectState projectState = projectCache.get(project); if (projectState == null) { log.error( - "Could not obtain available labels for project " - + project.get() - + ". Expect missing labels in its review notes."); + "Could not obtain available labels for project {}." + + " Expect missing labels in its review notes.", + project.get()); this.labelTypes = new LabelTypes(Collections.<LabelType>emptyList()); } else { this.labelTypes = projectState.getLabelTypes(); @@ -163,8 +163,11 @@ getMessage().append("* ").append(c.getShortMessage()).append("\n"); } } else { - log.debug( - "no note for this commit since it is a direct push: " + c.getName().substring(0, 7)); + if (log.isDebugEnabled()) { + log.debug( + "no note for this commit since it is a direct push {}", + c.getName().substring(0, 7)); + } } } }