Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace printHexBinary and add JDK 11 to travis #702

Merged
merged 3 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ jdk:
- oraclejdk8
- oraclejdk9
- oraclejdk10
- oraclejdk11

install: make deps
script: make test
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.1

#### Improved
Expand Down
11 changes: 10 additions & 1 deletion boot/base/src/main/java/boot/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down