You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/10/04 13:45:08 UTC

lucene-solr:branch_6x: SOLR-9589: Remove jackson dependency from SolrJ

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 1e3781500 -> ffef46ec9


SOLR-9589: Remove jackson dependency from SolrJ


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ffef46ec
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ffef46ec
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ffef46ec

Branch: refs/heads/branch_6x
Commit: ffef46ec95ee71236661497e5a8313f9a72e2fdd
Parents: 1e37815
Author: Noble Paul <no...@apache.org>
Authored: Tue Oct 4 19:14:58 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Oct 4 19:14:58 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                       |  3 +++
 solr/solrj/ivy.xml                                     |  3 ---
 .../client/solrj/response/DelegationTokenResponse.java | 13 +++++++------
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ffef46ec/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 534d0fb..a32bb58 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -212,6 +212,9 @@ Other Changes
 
 * SOLR-8140: Remove mentions of unimplemented admin-extra from the new Admin UI (Alexandre Rafalovitch)
 
+* SOLR-9589: Remove jackson dependency from SolrJ (Ishan Chattopadhyaya, noble)
+
+
 ==================  6.2.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ffef46ec/solr/solrj/ivy.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/ivy.xml b/solr/solrj/ivy.xml
index 553e81f..c9995f3 100644
--- a/solr/solrj/ivy.xml
+++ b/solr/solrj/ivy.xml
@@ -41,9 +41,6 @@
 
     <dependency org="org.slf4j" name="slf4j-log4j12" rev="${/org.slf4j/slf4j-log4j12}" conf="test"/>
 
-    <dependency org="com.fasterxml.jackson.core" name="jackson-annotations"  rev="${/com.fasterxml.jackson.core/jackson-annotations}"   conf="compile"/>
-    <dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="${/com.fasterxml.jackson.core/jackson-core}" conf="compile"/>
-    <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="${/com.fasterxml.jackson.core/jackson-databind}" conf="compile"/>
     <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
   </dependencies>
 </ivy-module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ffef46ec/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java
index c80e2eb..f6281a0 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java
@@ -20,11 +20,11 @@ package org.apache.solr.client.solrj.response;
 import org.apache.solr.client.solrj.ResponseParser;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
+import org.noggit.JSONParser;
+import org.noggit.ObjectBuilder;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.Reader;
 import java.util.Map;
 
@@ -77,11 +77,12 @@ public abstract class DelegationTokenResponse extends SolrResponseBase {
 
     @Override
     public NamedList<Object> processResponse(InputStream body, String encoding) {
-      ObjectMapper mapper = new ObjectMapper();
       Map map = null;
       try {
-        map = mapper.readValue(body, Map.class);
-      } catch (IOException e) {
+        ObjectBuilder builder = new ObjectBuilder(
+            new JSONParser(new InputStreamReader(body, encoding == null? "UTF-8": encoding)));
+        map = (Map)builder.getObject();
+      } catch (IOException | JSONParser.ParseException e) {
         throw new SolrException (SolrException.ErrorCode.SERVER_ERROR,
           "parsing error", e);
       }