douglascrockford/JSON-java — Issue #38: Error while trying to parse an array
Author: jorgetautz
Created: 2011-12-15 16:59:46+00:00
State: open

Im trying to parse a simple JSON array, like this:

```
{ "test" : [1,2,3,4] }
```

and the JSONObject constructor throws the following exception:

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous ctor sym type:
at br.com.mercur.permgen.json.JSONTokener.nextValue(JSONTokener.java:366)
at br.com.mercur.permgen.json.JSONObject.(JSONObject.java:207)
at br.com.mercur.permgen.json.JSONObject.(JSONObject.java:309)

I've tryed to generete the JSON from the classes, and the exception persists. The code that i used to test:

```java
ArrayList list = new ArrayList();
list.add("1");
list.add("2");
list.add("3");
JSONObject o = new JSONObject();
o.append("test", new JSONArray(list));

System.out.println(o.toString());

JSONObject o1 = new JSONObject(o.toString());
```

Sorry if i'm doing something wrong, but i really liked the classes, they suit my need of simplest way of accessing some data on JSON.

Thanks in advance, Jorge.