From 31009402e2d950c97efe7a3d4ad204304e81ed69 Mon Sep 17 00:00:00 2001 From: xtreak Date: Fri, 22 Jun 2018 12:24:06 +0000 Subject: [PATCH 1/2] Replace printHexBinary and add JDK 11 to travis --- .travis.yml | 1 + boot/base/src/main/java/boot/App.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5dbf1e93..f34a3695 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ jdk: - oraclejdk8 - oraclejdk9 - oraclejdk10 + - oraclejdk11 install: make deps script: make test diff --git a/boot/base/src/main/java/boot/App.java b/boot/base/src/main/java/boot/App.java index 9fd363ab..3cd51e3d 100644 --- a/boot/base/src/main/java/boot/App.java +++ b/boot/base/src/main/java/boot/App.java @@ -7,6 +7,7 @@ import java.nio.channels.FileChannel; import java.lang.ref.WeakReference; import java.net.URL; +import java.util.Formatter; import java.util.Map; import java.util.Date; import java.util.UUID; @@ -121,7 +122,15 @@ public class App { public static String md5hash(String data) throws Exception { java.security.MessageDigest algo = java.security.MessageDigest.getInstance("MD5"); - return javax.xml.bind.DatatypeConverter.printHexBinary(algo.digest(data.getBytes())); } + return renderAsHex(algo.digest(data.getBytes())); } + + private static String + renderAsHex(byte[] content) { + Formatter formatter = new Formatter(); + for (byte b : content) { + formatter.format("%02X", b); + } + return formatter.toString(); } public static File projectDir() throws Exception { From f65f1be41b1ac30c604296240c80b1cb9ada935f Mon Sep 17 00:00:00 2001 From: Xtreak Date: Sat, 30 Jun 2018 21:19:48 +0530 Subject: [PATCH 2/2] Add changelog entry --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 842fcdf0..a3cd0ef0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,12 @@ ## master +#### Fixed + +- Fix `printHexBinary` for Java 11 support [#702][702] + +[702]: https://github.com/boot-clj/boot/pull/702 + ## 2.8.0 #### Breaking