groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Revert "'new String()' is redundant"
Date Wed, 04 Apr 2018 07:13:50 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 08b98ddbb -> 600e08b09


Revert "'new String()' is redundant"

This reverts commit b07369a


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/600e08b0
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/600e08b0
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/600e08b0

Branch: refs/heads/master
Commit: 600e08b09c46f1a18fa856ee9d46de7abcead2dc
Parents: 08b98dd
Author: sunlan <sunlan@apache.org>
Authored: Wed Apr 4 15:13:41 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Wed Apr 4 15:13:41 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/600e08b0/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 {


Mime
View raw message