Skip to content

Commit a9dd9f1

Browse files
author
Artur Artikov
committed
Fix build on Java 11
1 parent 73e8c7d commit a9dd9f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/kotlin/ru/mobileup/codequality/output/IssuesWriter.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import ru.mobileup.codequality.issueconverter.Issue
55
import java.io.File
66
import java.io.OutputStreamWriter
77
import java.security.MessageDigest
8-
import javax.xml.bind.DatatypeConverter
98

109
private class IssueJson(
1110
val description: String,
@@ -52,8 +51,12 @@ class IssuesWriter {
5251
}
5352

5453
private fun md5Hash(input: String): String {
55-
val bytes = MessageDigest.getInstance("MD5")
54+
return MessageDigest.getInstance("MD5")
5655
.digest(input.toByteArray())
57-
return DatatypeConverter.printHexBinary(bytes)
56+
.toHexString()
57+
}
58+
59+
private fun ByteArray.toHexString() = joinToString("") {
60+
(0xFF and it.toInt()).toString(16).padStart(2, '0')
5861
}
5962
}

0 commit comments

Comments
 (0)