JSONArray.toString removing escaped quotes

Help
AbreChase
2008-12-23
2013-04-29
  • AbreChase
    AbreChase
    2008-12-23

    This code:

    JSONArray jsa = new JSONArray();
    jsa.element("\"test\"");
    System.out.println(jsa.toString());

    Produces:

    ["test"]

    However, this code:

    List v = new Vector();
    v.add("\"test\"");
    System.out.println(JSONSerializer.toJSON(v));

    Produces:

    ["\"test\""]

    I would expect the behavior from the second example.  Is there a reason for this behavior or is it a bug?

    - Abre Chase

     
    • aalmiray
      aalmiray
      2009-01-28

      Hi AbreChase,

      Sorry for the late reply, this may be indeed a bug, please feel free to file a bug at the issue tracker.

      Thanks!