diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 29881ec9b422..7bdff80a434e 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -117,7 +117,6 @@ 2.9.9 1.3.6 3.9.1 - 20140107 1.5.0 2.2.0 1.2 @@ -1787,11 +1786,6 @@ jolokia-core ${jolokia.version} - - org.json - json - ${json.version} - org.jooq jooq diff --git a/spring-boot-docs/pom.xml b/spring-boot-docs/pom.xml index 564a47d8f7be..cdaff921eb15 100644 --- a/spring-boot-docs/pom.xml +++ b/spring-boot-docs/pom.xml @@ -463,11 +463,6 @@ infinispan-spring4-embedded true - - org.json - json - true - org.jolokia jolokia-core diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 64a926571377..c76835bf4885 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -174,11 +174,6 @@ hibernate-validator true - - org.json - json - true - org.liquibase liquibase-core diff --git a/spring-boot/src/main/java/org/springframework/boot/json/JsonJsonParser.java b/spring-boot/src/main/java/org/springframework/boot/json/JsonJsonParser.java deleted file mode 100644 index 405bad36eea1..000000000000 --- a/spring-boot/src/main/java/org/springframework/boot/json/JsonJsonParser.java +++ /dev/null @@ -1,85 +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; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.json.JSONArray; -import org.json.JSONObject; - -/** - * Thin wrapper to adapt {@code org.json.JSONObject} to a {@link JsonParser}. - * - * @author Dave Syer - * @since 1.2.0 - * @see JsonParserFactory - */ -public class JsonJsonParser implements JsonParser { - - @Override - public Map parseMap(String json) { - Map map = new LinkedHashMap<>(); - putAll(map, new JSONObject(json)); - return map; - } - - private void putAll(Map map, JSONObject object) { - for (Object key : object.keySet()) { - String name = key.toString(); - Object value = object.get(name); - if (value instanceof JSONObject) { - Map nested = new LinkedHashMap<>(); - putAll(nested, (JSONObject) value); - value = nested; - } - if (value instanceof JSONArray) { - List nested = new ArrayList<>(); - addAll(nested, (JSONArray) value); - value = nested; - } - map.put(name, value); - } - } - - private void addAll(List list, JSONArray array) { - for (int i = 0; i < array.length(); i++) { - Object value = array.get(i); - if (value instanceof JSONObject) { - Map nested = new LinkedHashMap<>(); - putAll(nested, (JSONObject) value); - value = nested; - } - if (value instanceof JSONArray) { - List nested = new ArrayList<>(); - addAll(nested, (JSONArray) value); - value = nested; - } - list.add(value); - } - } - - @Override - public List parseList(String json) { - List nested = new ArrayList<>(); - addAll(nested, new JSONArray(json)); - return nested; - } - -} diff --git a/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java b/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java index 035dda21fdc7..95c6dd26fc4e 100644 --- a/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/json/JsonParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * 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. @@ -26,7 +26,6 @@ * @see GsonJsonParser * @see YamlJsonParser * @see JsonSimpleJsonParser - * @see JsonJsonParser * @see BasicJsonParser */ public abstract class JsonParserFactory { @@ -50,9 +49,6 @@ public static JsonParser getJsonParser() { if (ClassUtils.isPresent("org.json.simple.JSONObject", null)) { return new JsonSimpleJsonParser(); } - if (ClassUtils.isPresent("org.json.JSONObject", null)) { - return new JsonJsonParser(); - } return new BasicJsonParser(); } diff --git a/spring-boot/src/test/java/org/springframework/boot/json/JsonJsonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/json/JsonJsonParserTests.java deleted file mode 100644 index b2a45e90bc3f..000000000000 --- a/spring-boot/src/test/java/org/springframework/boot/json/JsonJsonParserTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012-2014 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 JsonJsonParser}. - * - * @author Dave Syer - */ -public class JsonJsonParserTests extends AbstractJsonParserTests { - - @Override - protected JsonParser getParser() { - return new JsonJsonParser(); - } - -}