FranzGames / google-gson

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

Cannot Serialize Object[] of String[]'s #342

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. new Gson().toJson(new Object[]{new String[]{"test1", "test2"}, new 
String[]{"test3", "test4"}})
2. output: [{},{}]

What is the expected output? What do you see instead?
Expected output: [["test1","test2"],["test3","test4"]]
The output I'm seeing instead is: [{},{}]

What version of the product are you using? On what operating system?
Version: 1.7.1
OS: Windows 7

Please provide any additional information below.
A LinkedList<String[]> will be correctly serialized but if you convert it to 
".toArray()" which gives you an Object[] that Object[] will give you an 
incorrect output when serialized.

Original issue reported on code.google.com by jamespwa...@gmail.com on 6 Jul 2011 at 10:04

GoogleCodeExporter commented 9 years ago
Fixed in GSON 2.

Original comment by limpbizkit on 1 Oct 2011 at 4:19