Skip to content
Permalink
Browse files

Fix Travis builds

Remove DatatypeConverter, replace with homegrown Hex utility
Remove Java 11 - SBT doesn't play well with it yet
  • Loading branch information...
melezov committed Feb 22, 2019
1 parent c7580db commit a3b07d4f6ebd8432e792f3b4f3494131922c65fb
Showing with 3 additions and 4 deletions.
  1. +1 −2 .travis.yml
  2. +2 −2 src/test/scala/com/oradian/infra/monohash/HashResultsSpec.scala
@@ -4,9 +4,8 @@ scala:
- "2.12.8"

jdk:
- oraclejdk9
- oraclejdk8
- oraclejdk11
- oraclejdk9

sudo: false

@@ -1,11 +1,11 @@
package com.oradian.infra.monohash

import java.io.File
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.Files
import java.util.AbstractMap.SimpleEntry
import java.util.Locale

import javax.xml.bind.DatatypeConverter.parseHexBinary
import org.specs2.matcher.MatchResult

import scala.collection.JavaConverters._
@@ -56,7 +56,7 @@ class HashResultsSpec extends MutableSpecification {

private[this] def toHR(files: (String, Char)*): HashResults = {
val results = files map { case (path, body) =>
path -> Array.fill(LengthInBytes) { parseHexBinary(body.toString * 2).head }
path -> Array.fill(LengthInBytes) { Hex.fromHex((body.toString * 2).getBytes(UTF_8), 2).head }
}
new HashResults(logger, Algorithm, (results map { case (k, v) =>
new SimpleEntry[String, Array[Byte]](k, v): java.util.Map.Entry[String, Array[Byte]]

0 comments on commit a3b07d4

Please sign in to comment.
You can’t perform that action at this time.