Skip to content

Commit

Permalink
Use JSONParser.setUseLongsInstance and JSONParser.setUseBooleanInstan…
Browse files Browse the repository at this point in the history
…ce in PropertyIndex (#3797)
  • Loading branch information
nprice-flextrade committed Mar 12, 2024
1 parent c7f843d commit cf4a235
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CodenameOne/src/com/codename1/properties/PropertyIndex.java
Expand Up @@ -701,8 +701,8 @@ public <X extends PropertyBusinessObject> List<X> loadJSONList(String name) {
public <X extends PropertyBusinessObject> List<X> loadJSONList(InputStream stream)
throws IOException {
JSONParser jp = new JSONParser();
JSONParser.setUseBoolean(true);
JSONParser.setUseLongs(true);
jp.setUseBooleanInstance(true);
jp.setUseLongsInstance(true);
List<X> response = new ArrayList<X>();
Map<String, Object> result = jp.parseJSON(new InputStreamReader(stream, "UTF-8"));
List<Map> entries = (List<Map>)result.get("root");
Expand Down Expand Up @@ -735,8 +735,8 @@ public void fromJSON(String jsonString) {
try {
StringReader r = new StringReader(jsonString);
JSONParser jp = new JSONParser();
JSONParser.setUseBoolean(true);
JSONParser.setUseLongs(true);
jp.setUseBooleanInstance(true);
jp.setUseLongsInstance(true);
populateFromMap(jp.parseJSON(r), parent.getClass());
} catch(IOException err) {
Log.e(err);
Expand Down Expand Up @@ -774,8 +774,8 @@ public void loadJSON(String name) {
*/
public void loadJSON(InputStream stream) throws IOException {
JSONParser jp = new JSONParser();
JSONParser.setUseBoolean(true);
JSONParser.setUseLongs(true);
jp.setUseBooleanInstance(true);
jp.setUseLongsInstance(true);
populateFromMap(jp.parseJSON(new InputStreamReader(stream, "UTF-8")), parent.getClass());
}

Expand Down

0 comments on commit cf4a235

Please sign in to comment.