You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2016/09/01 19:06:02 UTC
groovy git commit: JsonOutput#prettyPrint: align CharBuf size with
intention expressed in comment (closes #408)
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 <jd...@users.noreply.github.com>
Authored: Thu Sep 1 18:54:16 2016 +0100
Committer: pascalschumacher <pa...@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.