Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 88da03387 -> caa108afb
Revert "'new String()' is redundant" This reverts commit b07369a (cherry picked from commit 600e08b) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/caa108af Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/caa108af Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/caa108af Branch: refs/heads/GROOVY_2_6_X Commit: caa108afb1b3e218f0f6b7445ab514e4adabcfa8 Parents: 88da033 Author: sunlan <sun...@apache.org> Authored: Wed Apr 4 15:13:41 2018 +0800 Committer: sunlan <sun...@apache.org> Committed: Wed Apr 4 15:14:14 2018 +0800 ---------------------------------------------------------------------- .../java/org/apache/groovy/jsondirect/DirectFastStringService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/caa108af/subprojects/groovy-json-direct/src/main/java/org/apache/groovy/jsondirect/DirectFastStringService.java ---------------------------------------------------------------------- diff --git a/subprojects/groovy-json-direct/src/main/java/org/apache/groovy/jsondirect/DirectFastStringService.java b/subprojects/groovy-json-direct/src/main/java/org/apache/groovy/jsondirect/DirectFastStringService.java index a2ed84a..0d7d4ad 100644 --- a/subprojects/groovy-json-direct/src/main/java/org/apache/groovy/jsondirect/DirectFastStringService.java +++ b/subprojects/groovy-json-direct/src/main/java/org/apache/groovy/jsondirect/DirectFastStringService.java @@ -37,7 +37,7 @@ public class DirectFastStringService implements FastStringService { @Override public String noCopyStringFromChars(char[] chars) { if (WRITE_TO_FINAL_FIELDS) { - String string = ""; + String string = new String(); UNSAFE.putObject(string, STRING_VALUE_FIELD_OFFSET, chars); return string; } else {