From 7dd56699912522d9f5d419625017bc10476cd684 Mon Sep 17 00:00:00 2001 From: Jochen Berger Date: Wed, 17 Sep 2014 09:31:47 +0200 Subject: [PATCH 1/2] remove unused methods from `JsonProvider` interface --- .../internal/spi/json/JacksonProvider.java | 17 ----------------- .../spi/json/JsonSmartJsonProvider.java | 14 -------------- .../jayway/jsonpath/spi/json/JsonProvider.java | 5 ----- 3 files changed, 36 deletions(-) diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java index 919d8070..cd87dd9f 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JacksonProvider.java @@ -23,12 +23,9 @@ import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; -import java.io.Reader; import java.io.StringWriter; -import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; public class JacksonProvider extends AbstractJsonProvider { @@ -75,15 +72,6 @@ public class JacksonProvider extends AbstractJsonProvider { } } - @Override - public Object parse(Reader jsonReader) throws InvalidJsonException { - try { - return objectReader.readValue(jsonReader); - } catch (IOException e) { - throw new InvalidJsonException(e); - } - } - @Override public Object parse(InputStream jsonStream) throws InvalidJsonException { try { @@ -108,11 +96,6 @@ public class JacksonProvider extends AbstractJsonProvider { } } - @Override - public Map createMap() { - return new LinkedHashMap(); - } - @Override public List createArray() { return new LinkedList(); diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java index 31c554da..85394137 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/JsonSmartJsonProvider.java @@ -25,7 +25,6 @@ import net.minidev.json.parser.ParseException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.Reader; import java.util.List; import java.util.Map; @@ -43,10 +42,6 @@ public class JsonSmartJsonProvider extends AbstractJsonProvider { this.mode = mode; } - public Object createMap() { - return orderedMapper.createObject(); - } - public Object createArray() { return orderedMapper.createArray(); } @@ -59,15 +54,6 @@ public class JsonSmartJsonProvider extends AbstractJsonProvider { } } - @Override - public Object parse(Reader jsonReader) throws InvalidJsonException { - try { - return createParser().parse(jsonReader, orderedMapper); - } catch (ParseException e) { - throw new InvalidJsonException(e); - } - } - @Override public Object parse(InputStream jsonStream) throws InvalidJsonException { try { diff --git a/json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java b/json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java index 67ca5ed6..c50f7d76 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java +++ b/json-path/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java @@ -17,7 +17,6 @@ package com.jayway.jsonpath.spi.json; import com.jayway.jsonpath.InvalidJsonException; import java.io.InputStream; -import java.io.Reader; import java.util.Collection; public interface JsonProvider { @@ -26,14 +25,10 @@ public interface JsonProvider { Object parse(String json) throws InvalidJsonException; - Object parse(Reader jsonReader) throws InvalidJsonException; - Object parse(InputStream jsonStream) throws InvalidJsonException; String toJson(Object obj); - Object createMap(); - Object createArray(); /** From e4f78bc8ce47395f483bf1976b1a4c672798367b Mon Sep 17 00:00:00 2001 From: Jochen Berger Date: Wed, 17 Sep 2014 12:47:19 +0200 Subject: [PATCH 2/2] remove unused import --- .../jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java | 1 - 1 file changed, 1 deletion(-) diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java index c64d83c9..3442ff97 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java @@ -20,7 +20,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigDecimal; -import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map;