From 0c4176f596f97217fe85d2d18a1b7c468c297477 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 18 Jun 2018 10:11:50 +0200 Subject: [PATCH] Drop JsonSimpleJsonParser and JSON simple dependency Closes gh-13471 --- .../spring-boot-dependencies/pom.xml | 12 ----- spring-boot-project/spring-boot-docs/pom.xml | 5 -- spring-boot-project/spring-boot/pom.xml | 5 -- .../boot/json/JsonParserFactory.java | 11 ++--- .../boot/json/JsonSimpleJsonParser.java | 49 ------------------- .../boot/json/JsonSimpleJsonParserTests.java | 31 ------------ 6 files changed, 3 insertions(+), 110 deletions(-) delete mode 100644 spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonSimpleJsonParser.java delete mode 100644 spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/JsonSimpleJsonParserTests.java diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index c727b00943..e5c583127d 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -148,7 +148,6 @@ 2.29.3 4.1.2 3.1.0 - 1.1.1 1.7.25 1.19 7.2.1 @@ -623,17 +622,6 @@ gson ${gson.version} - - com.googlecode.json-simple - json-simple - ${simple-json.version} - - - junit - junit - - - com.h2database h2 diff --git a/spring-boot-project/spring-boot-docs/pom.xml b/spring-boot-project/spring-boot-docs/pom.xml index 2e4d96a11a..c88b648a22 100644 --- a/spring-boot-project/spring-boot-docs/pom.xml +++ b/spring-boot-project/spring-boot-docs/pom.xml @@ -131,11 +131,6 @@ gson true - - com.googlecode.json-simple - json-simple - true - com.hazelcast hazelcast diff --git a/spring-boot-project/spring-boot/pom.xml b/spring-boot-project/spring-boot/pom.xml index 756f14f544..f8682f0da0 100644 --- a/spring-boot-project/spring-boot/pom.xml +++ b/spring-boot-project/spring-boot/pom.xml @@ -56,11 +56,6 @@ gson true - - com.googlecode.json-simple - json-simple - true - com.samskivert jmustache diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java index 95c6dd26fc..737af957ef 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,15 +25,13 @@ import org.springframework.util.ClassUtils; * @see JacksonJsonParser * @see GsonJsonParser * @see YamlJsonParser - * @see JsonSimpleJsonParser * @see BasicJsonParser */ public abstract class JsonParserFactory { /** - * Static factory for the "best" JSON parser available on the classpath. Tries Jackson - * 2, then Gson, Snake YAML, Simple JSON, JSON (from eclipse), and then falls back to - * the {@link BasicJsonParser}. + * Static factory for the "best" JSON parser available on the classpath. Tries + * Jackson, then Gson, Snake YAML,and then falls back to the {@link BasicJsonParser}. * @return a {@link JsonParser} */ public static JsonParser getJsonParser() { @@ -46,9 +44,6 @@ public abstract class JsonParserFactory { if (ClassUtils.isPresent("org.yaml.snakeyaml.Yaml", null)) { return new YamlJsonParser(); } - if (ClassUtils.isPresent("org.json.simple.JSONObject", null)) { - return new JsonSimpleJsonParser(); - } return new BasicJsonParser(); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonSimpleJsonParser.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonSimpleJsonParser.java deleted file mode 100644 index bdede7e059..0000000000 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JsonSimpleJsonParser.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.json; - -import java.util.List; -import java.util.Map; - -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; - -/** - * Thin wrapper to adapt {@link org.json.simple.JSONObject} to a {@link JsonParser}. - * - * @author Dave Syer - * @author Jean de Klerk - * @since 1.2.0 - * @see JsonParserFactory - */ -public class JsonSimpleJsonParser extends AbstractJsonParser { - - @Override - @SuppressWarnings("unchecked") - public Map parseMap(String json) { - return (Map) tryParse(() -> new JSONParser().parse(json), - ParseException.class); - } - - @Override - @SuppressWarnings("unchecked") - public List parseList(String json) { - return (List) tryParse(() -> new JSONParser().parse(json), - ParseException.class); - } - -} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/JsonSimpleJsonParserTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/JsonSimpleJsonParserTests.java deleted file mode 100644 index 5a6c50e74f..0000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/JsonSimpleJsonParserTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012-2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.json; - -/** - * Tests for {@link JsonSimpleJsonParser}. - * - * @author Dave Syer - */ -public class JsonSimpleJsonParserTests extends AbstractJsonParserTests { - - @Override - protected JsonParser getParser() { - return new JsonSimpleJsonParser(); - } - -}