catekr / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

JSONArray doesn't handle correctly empty array #85

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create new JSONArray: e.g. JSONArray t = new JSONArray();
2. t.toJSONString() gives you "[" instead of "[]"

What is the expected output? What do you see instead?
Expected output "[]"
Instead I see "["

What version of the product are you using? On what operating system?
json-simple-1.1.1, OS Linux Fedora 18

Original issue reported on code.google.com by SemmZ...@gmail.com on 12 Jun 2013 at 1:25

GoogleCodeExporter commented 8 years ago
How did you print result? Could you test the following code and let me know the 
result?

System.out.println(t.toJSONString().equals("[]"));

Original comment by fangyid...@gmail.com on 12 Jun 2013 at 1:56

GoogleCodeExporter commented 8 years ago
I'm so sorry... (( 
It was my fault.
And not clear printing of ']' by NetBeans

Original comment by SemmZ...@gmail.com on 12 Jun 2013 at 2:30

GoogleCodeExporter commented 8 years ago

Original comment by fangyid...@gmail.com on 13 Jun 2013 at 1:53