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

[JENKINS-55956] Replace DatatypeConverter.printHexBinary call with local helper method. #26

Merged
merged 2 commits into from Mar 29, 2019

Conversation

alexchiri
Copy link
Contributor

In order to remove dependency on JAXB from this plugin, I added a local method that does the same thing as DatatypeConverter.printHexBinary and called the local method instead.

Original ticket in Jenkins JIRA: https://issues.jenkins-ci.org/browse/JENKINS-55956

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is generally OK, but there should be libs supporting it in the plugin. E.g. https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Hex.html

Does not matter for the test code tho

CC @jenkinsci/java11-support

@batmat
Copy link
Member

batmat commented Mar 21, 2019

@dwnusbaum @jglick given the last commits, you might be the current maintainer(s)? I think this is ready for merge. Thanks!

@@ -161,7 +159,7 @@ public void testHashFile() throws Exception {
byte[] expectedHash = MessageDigest.getInstance("SHA-1").digest(fileContents);
assertThat(
Files.toString(timestampsHashFile, Charsets.US_ASCII).trim(),
is(DatatypeConverter.printHexBinary(expectedHash).toLowerCase()));
is(bytesToHex(expectedHash).toLowerCase()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW always pass Locale.ROOT as the argument here, to avoid messing with Turkish developers. OTOH this is just test code and I suppose we should make the parent POM set the root locale in Surefire.

@jglick jglick merged commit 43a3a2f into jenkinsci:master Mar 29, 2019
@jglick jglick changed the title Replace DatatypeConverter.printHexBinary call with local helper method. [JENKINS-55956] Replace DatatypeConverter.printHexBinary call with local helper method. Jul 5, 2019
@jglick jglick added the chore label Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants