Skip to content

Commit 92069fa

Browse files
iroquetaanaiberta
authored andcommitted
Remove org.json lib fork and use new version of the API https://github.com/stleary/JSON-java
Issue: 105607 (cherry picked from commit be49277)
1 parent 141eb67 commit 92069fa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/src/main/java/com/genexus/internet/GXRestAPIClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ public String getJsonStr(String varName) {
341341
try {
342342
if (jsonResponse != null) {
343343
if (jsonResponse.has(varName))
344-
jsonstr = jsonResponse.getString(varName);
344+
jsonstr = jsonResponse.get(varName).toString();
345345
else if (jsonResponse.length() == 1 && jsonResponse.has(""))
346-
jsonstr = jsonResponse.getString("");
346+
jsonstr = jsonResponse.get("").toString();
347347
}
348348
else {
349349
errorCode = RESPONSE_ERROR_CODE;
@@ -375,10 +375,10 @@ public <T extends GXXMLSerializable> T getBodyObj(String varName, Class<T> sdtCl
375375
if (jsonResponse != null) {
376376
Boolean dSuccess = false;
377377
if (jsonResponse.has(varName) && jsonResponse.length() == 1) {
378-
dSuccess = sdt.fromJSonString(jsonResponse.getString(varName), null);
378+
dSuccess = sdt.fromJSonString(jsonResponse.get(varName).toString(), null);
379379
}
380380
else if (jsonResponse.length() == 1 && jsonResponse.has("")) {
381-
dSuccess = sdt.fromJSonString(jsonResponse.getString(""), null);
381+
dSuccess = sdt.fromJSonString(jsonResponse.get("").toString(), null);
382382
}
383383
else if (jsonResponse.length()>= 1) {
384384
dSuccess = sdt.fromJSonString(httpClient.getString(), null);
@@ -462,10 +462,10 @@ public <T extends Object> GXSimpleCollection<T> getBodyCollection(String varName
462462
}
463463
try {
464464
if (jsonResponse.has(varName)) {
465-
coll.fromJSonString(jsonResponse.getString(varName), null);
465+
coll.fromJSonString(jsonResponse.get(varName).toString(), null);
466466
}
467467
else if (jsonResponse.length() == 1 && jsonResponse.has("")) {
468-
coll.fromJSonString(jsonResponse.getString(varName), null);
468+
coll.fromJSonString(jsonResponse.get(varName).toString(), null);
469469
}
470470
}
471471
catch (JSONException e) {

0 commit comments

Comments
 (0)