Browse Source

Underlying net.minidev.json.parser.JsonParser is not threadsafe

pull/17/head
alfthomas 12 years ago
parent
commit
49e8640ea8
  1. 11
      json-path-assert/src/main/java/com/jayway/jsonassert/JsonAssert.java

11
json-path-assert/src/main/java/com/jayway/jsonassert/JsonAssert.java

@ -19,13 +19,6 @@ import java.util.Map;
*/ */
public class JsonAssert { public class JsonAssert {
private static JsonProvider jsonProvider = JsonProviderFactory.createProvider();
public static void setJsonProvider(JsonProvider jsonProvider) {
JsonAssert.jsonProvider = jsonProvider;
}
/** /**
* Creates a JSONAsserter * Creates a JSONAsserter
* *
@ -34,7 +27,7 @@ public class JsonAssert {
* @throws ParseException when the given JSON could not be parsed * @throws ParseException when the given JSON could not be parsed
*/ */
public static JsonAsserter with(String json) { public static JsonAsserter with(String json) {
return new JsonAsserterImpl(jsonProvider.parse(json)); return new JsonAsserterImpl(JsonProviderFactory.createProvider().parse(json));
} }
/** /**
@ -45,7 +38,7 @@ public class JsonAssert {
* @throws ParseException when the given JSON could not be parsed * @throws ParseException when the given JSON could not be parsed
*/ */
public static JsonAsserter with(Reader reader) throws IOException { public static JsonAsserter with(Reader reader) throws IOException {
return new JsonAsserterImpl(jsonProvider.parse(convertReaderToString(reader))); return new JsonAsserterImpl(JsonProviderFactory.createProvider().parse(convertReaderToString(reader)));
} }

Loading…
Cancel
Save