You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. create the java Class
package experiment;
import java.util.Map;
import com.json.parsers.JSONParser;
import com.json.parsers.JsonParserFactory;
public class Dummy {
public static void main(String[] args) {
JsonParserFactory factory=JsonParserFactory.getInstance();
JSONParser parser = factory.newJsonParser();
String strJSONtoParse = "{\"id\":\"[EMPTY]\",\"AN_Response\":\"\"}";
System.out.println("Parsing of : " + strJSONtoParse);
Map mapModel = parser.parseJson(strJSONtoParse);
System.out.println("Empty String : '" + mapModel.get("AN_Response")+"'");
}
}
2. Run the Class (execute "main()")
What is the expected output? What do you see instead?
>>expected output console:
Parsing of : {"id":"[EMPTY]","AN_Response":""}
Empty String : ''
>> what I see
Parsing of : {"id":"[EMPTY]","AN_Response":""}
Exception in thread "main" com.json.exceptions.JSONParsingException:
@Key-Heirarchy::root/ @Key::AN_Response Value is expected but found
empty...@Position::32
at com.json.utils.JSONUtility.handleFailure(JSONUtility.java:124)
at com.json.parsers.JSONParser.stringLiteralTemplate(JSONParser.java:580)
at com.json.parsers.JSONParser.nonValidatingValueTemplate(JSONParser.java:698)
at com.json.parsers.JSONParser.parseValue(JSONParser.java:377)
at com.json.parsers.JSONParser.parseKeysValues(JSONParser.java:254)
at com.json.parsers.JSONParser.parseJsonBody(JSONParser.java:232)
at com.json.parsers.JSONParser.parseJsonBlock(JSONParser.java:212)
at com.json.parsers.JSONParser.parseJson(JSONParser.java:139)
at experiment.Dummy.main(Dummy.java:20)
What version of the product are you using? On what operating system?
OS : OpsenSUSE linux 12.3 x86_64
jdk : 1.7.0_40
Eclipse : Luna build id: 20131113-1838
quickjson : 1.0.2.3
Please provide any additional information below.
/
Original issue reported on code.google.com by [email protected] on 17 Dec 2013 at 8:48
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 17 Dec 2013 at 8:48The text was updated successfully, but these errors were encountered: