[PATCH] Avoid API that is removed in Java 11

Wald Commits scm-commit at wald.intevation.org
Thu Jan 12 18:01:57 CET 2023


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1673542894 -3600
#      Thu Jan 12 18:01:34 2023 +0100
# Branch 3.2.x
# Node ID 7a51e6321a4ef1986b72bfaa717c88b4d25ebbe9
# Parent  b5d4cb088737db12b3ee82657a30237ae87e603f
Avoid API that is removed in Java 11

diff -r b5d4cb088737 -r 7a51e6321a4e artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Jan 12 13:11:24 2023 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Jan 12 18:01:34 2023 +0100
@@ -10,6 +10,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Base64;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -25,7 +26,6 @@
 import java.io.IOException;
 
 import javax.xml.xpath.XPathConstants;
-import javax.xml.bind.DatatypeConverter;
 
 import net.sf.ehcache.Cache;
 
@@ -1163,7 +1163,7 @@
             }
             MessageDigest md = MessageDigest.getInstance("MD5");
             byte[] md5sum = md.digest(ba.toByteArray());
-            return DatatypeConverter.printBase64Binary(md5sum);
+            return Base64.getEncoder().encodeToString(md5sum);
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException("MD5 unavailable. Can't happen.");
         } catch (IOException e) {


More information about the Dive4Elements-commits mailing list