dungnn / google-gson

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

Add JsonArray(int size) constructor #436

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. JSonArray json = new JsonArray()
2. json.add(jsonElt) over and over
3. array grows and grows

What is the expected output? What do you see instead?

array grows and grows

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

2.1, Windows 7 64-bit.

Please provide any additional information below.

Please add:

  /**
   * Creates an empty JsonArray.
   */
  public JsonArray(int size) {
    elements = new ArrayList<JsonElement>(size);
  }

Original issue reported on code.google.com by garydgre...@gmail.com on 17 Apr 2012 at 1:59

GoogleCodeExporter commented 9 years ago
We're looking at newer more efficient ways to build trees of JSON data.

Original comment by limpbizkit on 30 Jun 2012 at 3:27