This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 6ce967f801 Trivial refactoring: replace `StringBuilder` with `String`
6ce967f801 is described below
commit 6ce967f8019f175e589e71873f025b0a16bb0a13
Author: Daniel Sun <[email protected]>
AuthorDate: Sun Mar 30 20:34:35 2025 +0900
Trivial refactoring: replace `StringBuilder` with `String`
---
.../java/org/codehaus/groovy/classgen/VariableScopeVisitor.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git
a/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
b/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
index 3ce83726a2..2a610282fb 100644
--- a/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
@@ -168,11 +168,8 @@ public class VariableScopeVisitor extends
ClassCodeVisitorSupport {
variableType = "parameter";
}
- final StringBuilder msg = new StringBuilder(64);
- msg.append("The current ").append(scopeType);
- msg.append(" already contains a ").append(variableType);
- msg.append(" of the name ").append(variableName);
- return msg.toString();
+ String msg = "The current " + scopeType + " already contains a " +
variableType + " of the name " + variableName;
+ return msg;
};
if (currentScope.getDeclaredVariable(variableName) != null) {