lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject [1/2] lucene-solr:branch_6_0: SOLR-9115: Get rid of javax.xml.bind.DatatypeConverter in Solr's SimplePostTool
Date Fri, 20 May 2016 22:47:39 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 9b04cd0d0 -> 1272c02ea


SOLR-9115: Get rid of javax.xml.bind.DatatypeConverter in Solr's SimplePostTool

# Conflicts:
#	solr/CHANGES.txt


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

Branch: refs/heads/branch_6_0
Commit: 24381c23d5300143aa8e078ca662184fe179b6ab
Parents: 3709760
Author: Uwe Schindler <uschindler@apache.org>
Authored: Mon May 16 18:01:32 2016 +0200
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Sat May 21 00:46:29 2016 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 3 +++
 solr/core/src/java/org/apache/solr/util/SimplePostTool.java | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24381c23/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e02f40b..fd9e137 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -91,6 +91,9 @@ Other Changes
 
 * SOLR-9053: Upgrade commons-fileupload to 1.3.1, fixing a potential vulnerability (Jeff
Field, Mike Drob via janhoy)
 
+* SOLR-9115: Get rid of javax.xml.bind.DatatypeConverter in SimplePostTool
+  for Java 9 compatibility. (Uwe Schindler)
+
 ==================  6.0.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24381c23/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
index 448897a..10e3eb4 100644
--- a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
+++ b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
@@ -16,7 +16,6 @@
  */
 package org.apache.solr.util;
 
-import javax.xml.bind.DatatypeConverter;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.xpath.XPath;
@@ -45,6 +44,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -852,7 +852,7 @@ public class SimplePostTool {
       if(mockMode) return;
       HttpURLConnection urlc = (HttpURLConnection) url.openConnection();
       if (url.getUserInfo() != null) {
-        String encoding = DatatypeConverter.printBase64Binary(url.getUserInfo().getBytes(StandardCharsets.US_ASCII));
+        String encoding = Base64.getEncoder().encodeToString(url.getUserInfo().getBytes(StandardCharsets.US_ASCII));
         urlc.setRequestProperty("Authorization", "Basic " + encoding);
       }
       urlc.connect();
@@ -887,7 +887,7 @@ public class SimplePostTool {
         urlc.setAllowUserInteraction(false);
         urlc.setRequestProperty("Content-type", type);
         if (url.getUserInfo() != null) {
-          String encoding = DatatypeConverter.printBase64Binary(url.getUserInfo().getBytes(StandardCharsets.US_ASCII));
+          String encoding = Base64.getEncoder().encodeToString(url.getUserInfo().getBytes(StandardCharsets.US_ASCII));
           urlc.setRequestProperty("Authorization", "Basic " + encoding);
         }
         if (null != length) urlc.setFixedLengthStreamingMode(length);


Mime
View raw message