Search in sources :

Example 1 with JSONParser

use of org.sonar.wsclient.jsonsimple.parser.JSONParser in project sonarqube by SonarSource.

the class WsCallAndWait method toJsonObject.

private JSONObject toJsonObject(String s) {
    try {
        JSONParser parser = new JSONParser();
        Object o = parser.parse(s);
        if (o instanceof JSONObject) {
            return (JSONObject) o;
        }
        throw new RuntimeException("Can not parse response from server migration WS (not a JSON object)");
    } catch (Exception e) {
        throw new IllegalStateException("Invalid JSON: " + s, e);
    }
}
Also used : JSONObject(org.sonar.wsclient.jsonsimple.JSONObject) JSONParser(org.sonar.wsclient.jsonsimple.parser.JSONParser) JSONObject(org.sonar.wsclient.jsonsimple.JSONObject)

Aggregations

JSONObject (org.sonar.wsclient.jsonsimple.JSONObject)1 JSONParser (org.sonar.wsclient.jsonsimple.parser.JSONParser)1