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:02 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 2011a05b8 -> 7e8211fa3


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/7e8211fa
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7e8211fa
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7e8211fa

Branch: refs/heads/master
Commit: 7e8211fa314526ce72cf6c2d1a6193e20c940df2
Parents: 2011a05
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:05:53 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/7e8211fa/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