discomarathon / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Bug using pretty printing #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the test
@Test
public void json_pretty_printing_bug() {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("F868", new Object());
    map.put("F867", new Object());
    map.put("ID", new Object());
    GsonBuilder builder = new GsonBuilder();
    builder.setPrettyPrinting();
    Gson gson = builder.create();
    assertEquals("{\"F868\":{},\"F867\":{},\"ID\":{}}", gson.toJson(map));
}

What is the expected output? What do you see instead?
Expected: {"F868":{},"F867":{},"ID":{}}
Actual: {"F868":{}"F867":{}"ID":{}}

What version of the product are you using? On what operating system?
1.3

Please provide any additional information below.
removing setPrettyPrinting() solves the problem

Original issue reported on code.google.com by gianmarco.gherardi on 10 Sep 2010 at 7:30

GoogleCodeExporter commented 9 years ago
Fixed in the latest SVN.

Original comment by limpbizkit on 11 Sep 2010 at 9:12