Util: Switch users of net.minidev.json to com.json.simple

Tested with bundled 1.1.1 and Debian/Ubuntu 2.3.0
This commit is contained in:
zzz
2018-11-19 14:48:21 +00:00
parent af9ce6d173
commit 54184f2889
3 changed files with 17 additions and 15 deletions

View File

@ -30,9 +30,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
import edu.internet2.ndt.Tcpbw100;
import net.minidev.json.JSONObject;
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
@ -136,9 +136,10 @@ public class MLabRunner {
int code = eepget.getStatusCode();
if (code != 200)
throw new IOException("ns fetch failed: " + code);
JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE);
JSONParser parser = new JSONParser();
byte[] b = baos.toByteArray();
JSONObject map = (JSONObject) parser.parse(b);
String s = new String(b, "ISO-8859-1");
JSONObject map = (JSONObject) parser.parse(s);
if (map == null) {
throw new IOException("no map");
}

View File

@ -1,7 +1,7 @@
package edu.internet2.ndt;
import net.minidev.json.JSONObject;
import net.minidev.json.JSONValue;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import java.util.Iterator;
import java.util.Map;