Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d844074
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 22, 2024
3b607ce
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 22, 2024
53eee0d
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 23, 2024
04003dc
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 23, 2024
11cfef3
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 23, 2024
8611985
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 24, 2024
6ae833f
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 24, 2024
9b79487
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 27, 2024
75563b2
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 27, 2024
95be0dc
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 28, 2024
a64fd32
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 28, 2024
5f66ab7
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 28, 2024
af1c60c
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 29, 2024
1555418
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 29, 2024
be49277
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 31, 2024
457df2a
Remove org.json lib fork and use new version of the API https://githu…
iroqueta May 31, 2024
bf106f1
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jun 6, 2024
1bae3d3
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jun 7, 2024
30fdb7f
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jun 7, 2024
8187fba
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jun 11, 2024
285c0db
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jun 24, 2024
48b1f68
Fix SDTs instantiation not working in offline Android procedures
jotapeg Jun 26, 2024
a2f506e
Rename Iterator variables
jotapeg Jun 26, 2024
4c4ee08
Remove org.json lib fork and use new version of the API https://githu…
iroqueta Jul 23, 2024
3bdb7fd
Merge branch 'master' into ReplaceJsonAPI
iroqueta Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.genexus.GxSilentTrnSdt;
import com.genexus.IGxSilentTrn;

import json.org.json.JSONArray;
import org.json.JSONArray;

public class PendingEventHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.TreeMap;

import json.org.json.JSONArray;
import org.json.JSONArray;

public interface ISynchronizationHelper {

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/genexus/GXutil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.genexus.util.GXThreadLocal;
import com.genexus.util.IThreadLocal;

import json.org.json.JSONObject;
import org.json.JSONObject;

public final class GXutil
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.genexus.db.driver;

import json.org.json.JSONException;
import json.org.json.JSONObject;
import org.json.JSONException;
import org.json.JSONObject;

public class ExternalProviderMetadata
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.ArrayList;
import java.util.Stack;

import json.org.json.IJsonFormattable;
import json.org.json.JSONArray;
import json.org.json.JSONException;
import json.org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public abstract class HttpAjaxContext
{
Expand Down Expand Up @@ -497,7 +496,7 @@ public Object GetJSONObject()
return wrapper;
}

public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{
}

Expand Down
9 changes: 4 additions & 5 deletions android/src/main/java/com/genexus/internet/HttpContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
import com.genexus.util.Codecs;
import com.genexus.util.Encryption;

import json.org.json.IJsonFormattable;
import json.org.json.JSONArray;
import json.org.json.JSONException;
import json.org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public abstract class HttpContext extends HttpAjaxContext implements IHttpContext
{
Expand Down Expand Up @@ -613,7 +612,7 @@ public void ajax_req_read_hidden_sdt(String jsonStr, Object SdtObj)
{
try
{
IJsonFormattable jsonObj;
Object jsonObj;
if (jsonStr.startsWith("["))
jsonObj = new JSONArray(jsonStr);
else
Expand Down
29 changes: 2 additions & 27 deletions android/src/main/java/com/genexus/specific/android/Connect.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import java.util.Date;

import com.genexus.common.interfaces.SpecificImplementation;
import com.genexus.db.UserInformation;

import json.org.json.IExtensionJSONObject;
import json.org.json.JSONException;
import json.org.json.JSONObject;
import org.json.JSONException;
import org.json.JSONObject;

public final class Connect {

Expand Down Expand Up @@ -41,28 +39,5 @@ public static void init()
SpecificImplementation.cdowMask = "EEEE";
SpecificImplementation.Base64Encode = "8859_1";
SpecificImplementation.UseUnicodeCharacterClass = false;
JSONObject.extension = new JSONObjectExtension();

}

static class JSONObjectExtension implements IExtensionJSONObject {

@Override
public String dateToString(Date d) throws JSONException {
if (d == null) {
throw new JSONException("Null pointer");
}
UserInformation ui = (UserInformation) com.genexus.GXObjectHelper.getUserInformation(new com.genexus.ModelContext(com.genexus.ModelContext.getModelContextPackageClass()), -1);
com.genexus.LocalUtil localUtil = ui.getLocalUtil();
String dateString = localUtil.format(d, localUtil.getDateFormat() + " " + localUtil.getTimeFormat());
try
{
com.genexus.db.DBConnectionManager.getInstance().disconnect(ui.getHandle());
}
catch (Throwable e)
{}
return dateString;
}

}
}
5 changes: 5 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<artifactId>opentelemetry-api</artifactId>
<version>${io.opentelemetry.version}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/com/genexus/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.genexus.diagnostics.core.LogManager;
import com.genexus.util.*;

import json.org.json.JSONObject;
import org.json.JSONObject;

import java.math.BigDecimal;
import java.io.*;
Expand Down
13 changes: 8 additions & 5 deletions common/src/main/java/com/genexus/GXBaseCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import com.genexus.xml.GXXMLSerializer;
import com.genexus.xml.XMLReader;
import com.genexus.xml.XMLWriter;
import com.genexus.json.JSONObjectWrapper;

import json.org.json.IJsonFormattable;
import json.org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;

public class GXBaseCollection<T extends GXXMLSerializable> extends GXSimpleCollection<T> {

Expand Down Expand Up @@ -223,15 +224,17 @@ public boolean add(T item)

@Override
@SuppressWarnings("unchecked")
public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{
this.clear();
JSONArray jsonArr = (JSONArray)obj;
for (int i = 0; i < jsonArr.length(); i++)
{
try
{
Object jsonObj = jsonArr.get(i);
Object jsonObj = jsonArr.get(i);
if (jsonObj instanceof JSONObject)
jsonObj = new JSONObjectWrapper((JSONObject)jsonObj);
Class[] parTypes = new Class[] {};
Object[] arglist = new Object[] {};
if (elementsType == null)
Expand All @@ -251,7 +254,7 @@ public void FromJSONObject(IJsonFormattable obj)

Constructor<T> constructor = elementsType.getConstructor(parTypes);
currObj = constructor.newInstance(arglist);
((IGxJSONAble)currObj).FromJSONObject((IJsonFormattable)jsonObj);
((IGxJSONAble)currObj).FromJSONObject(jsonObj);
}
add((T)currObj);
}
Expand Down
11 changes: 5 additions & 6 deletions common/src/main/java/com/genexus/GXSimpleCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@

import com.genexus.xml.XMLWriter;

import json.org.json.IJsonFormattable;
import json.org.json.JSONArray;
import json.org.json.JSONException;
import org.json.JSONArray;
import org.json.JSONException;

public class GXSimpleCollection<T> extends GXBaseList<T> {

Expand Down Expand Up @@ -1031,7 +1030,7 @@ public Object GetJSONObject(boolean includeState)
tojson(includeState);
return jsonArr;
}
public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{

this.clear();
Expand Down Expand Up @@ -1059,7 +1058,7 @@ public void FromJSONObject(IJsonFormattable obj)
{
Constructor constructor = elementsType.getConstructor(parTypes);
currObj = constructor.newInstance(arglist);
((IGxJSONAble)currObj).FromJSONObject((IJsonFormattable)jsonObj);
((IGxJSONAble)currObj).FromJSONObject(jsonObj);
}
if (IGxJSONSerializable.class.isAssignableFrom(elementsType))
{
Expand Down Expand Up @@ -1317,7 +1316,7 @@ public String toStringCollectionClientJsonString()
result = result + ",[";
GxUnknownObjectCollection tableCollection = (GxUnknownObjectCollection)super.get(i);
int tableCollectionSize = tableCollection.size();
jsonObj = new json.org.json.JSONArray();
jsonObj = new JSONArray();
for (int j = 1; j <= tableCollectionSize; j++)
{
jsonObj.put((StringCollection)tableCollection.item(j));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.genexus.common.interfaces;

import json.org.json.JSONArray;
import org.json.JSONArray;

public interface IGXWebGrid {
Object GetJSONObject();
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/com/genexus/internet/GXHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import HTTPClient.URI;
import com.genexus.CommonUtil;
import com.genexus.common.interfaces.SpecificImplementation;
import json.org.json.JSONException;
import json.org.json.JSONObject;
import org.json.JSONException;
import com.genexus.json.JSONObjectWrapper;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
Expand Down Expand Up @@ -807,7 +807,7 @@ private String getContentTypeFromString(String value){

private boolean isJsonString(String value){
try {
JSONObject json = new JSONObject(value);
JSONObjectWrapper json = new JSONObjectWrapper(value);
return true;
} catch (JSONException e) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/com/genexus/internet/GXJSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.genexus.util.Codecs;

import json.org.json.*;
import com.genexus.json.JSONObjectWrapper;

public class GXJSONObject extends JSONObject
public class GXJSONObject extends JSONObjectWrapper
{
private boolean base64Encoded;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.genexus.CommonUtil;
import com.genexus.common.interfaces.SpecificImplementation;

import json.org.json.*;
import org.json.JSONArray;

import java.io.Serializable;

Expand Down
4 changes: 1 addition & 3 deletions common/src/main/java/com/genexus/internet/IGxJSONAble.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.genexus.internet;

import json.org.json.*;

public interface IGxJSONAble
{
void tojson();
void AddObjectProperty(String name, Object prop);
Object GetJSONObject();
Object GetJSONObject(boolean includeState);
void FromJSONObject(IJsonFormattable obj);
void FromJSONObject(Object obj);
String ToJavascriptSource();
}
7 changes: 3 additions & 4 deletions common/src/main/java/com/genexus/internet/Msg.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.genexus.internet;

import json.org.json.IJsonFormattable;
import json.org.json.JSONObject;
import com.genexus.json.JSONObjectWrapper;

public class Msg implements java.io.Serializable, IGxJSONAble
{
Expand All @@ -10,7 +9,7 @@ public class Msg implements java.io.Serializable, IGxJSONAble
protected int type;
protected String att;
protected boolean gxMessage;
protected JSONObject jsonObj = new JSONObject();
protected JSONObjectWrapper jsonObj = new JSONObjectWrapper();

public Msg( String description, String id, int type, String att)
{
Expand Down Expand Up @@ -82,7 +81,7 @@ public Object GetJSONObject()
return jsonObj;
}

public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{
}
}
4 changes: 2 additions & 2 deletions common/src/main/java/com/genexus/internet/MsgList.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import com.genexus.SdtMessages_Message;

import json.org.json.*;
import org.json.JSONArray;

import com.genexus.GXBaseCollection;

Expand Down Expand Up @@ -148,7 +148,7 @@ public Object GetJSONObject()
return jsonArr;
}

public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.genexus.internet;
import com.genexus.util.*;

import json.org.json.*;
import org.json.JSONArray;

import com.genexus.CommonUtil;
import com.genexus.SdtMessages_Message;
Expand Down Expand Up @@ -145,7 +145,7 @@ public Object GetJSONObject()
return jsonArr;
}

public void FromJSONObject(IJsonFormattable obj)
public void FromJSONObject(Object obj)
{
}

Expand Down
Loading