Ivonhoe / google-gson

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

fromJson returns null for empty string #540

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

public void testCase() {
        String json = "";
        final Map<String, String> cachedMap = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
        assertNotNull(cachedMap);
    }

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

It probably should throw an exception (JsonParseException or maybe a Syntax 
one).

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

2.2.4, Ubuntu 12.10 and Android 4.3

Please provide any additional information below.

Original issue reported on code.google.com by da...@swiftkey.com on 30 Oct 2013 at 4:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Might be duplicated : https://code.google.com/p/google-gson/issues/detail?id=457

Original comment by yancheng...@gmail.com on 9 Jan 2014 at 10:28