groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject groovy git commit: JsonOutput#prettyPrint: align CharBuf size with intention expressed in comment (closes #408)
Date Thu, 01 Sep 2016 19:06:37 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 359b6a93c -> a62888abf


JsonOutput#prettyPrint: align CharBuf size with intention expressed in comment (closes #408)


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

Branch: refs/heads/GROOVY_2_4_X
Commit: a62888abf2a834a5fe3e34d0e160d80740eefba1
Parents: 359b6a9
Author: JuanDavi Evora Hanggi <jdevora@users.noreply.github.com>
Authored: Thu Sep 1 18:54:16 2016 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Thu Sep 1 21:06:29 2016 +0200

----------------------------------------------------------------------
 .../groovy-json/src/main/java/groovy/json/JsonOutput.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a62888ab/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java
index 8bee49d..322e9f1 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java
@@ -492,8 +492,8 @@ public class JsonOutput {
      */
     public static String prettyPrint(String jsonPayload) {
         int indentSize = 0;
-        // Just a guess that the pretty view will take a 20 percent more than original.
-        final CharBuf output = CharBuf.create((int) (jsonPayload.length() * 0.2));
+        // Just a guess that the pretty view will take 20 percent more than original.
+        final CharBuf output = CharBuf.create((int) (jsonPayload.length() * 1.2));
 
         JsonLexer lexer = new JsonLexer(new StringReader(jsonPayload));
         // Will store already created indents.


Mime
View raw message