Skip to content

CODEC-305: Fix byte-skipping in Base16 decoding#135

Merged
asfgit merged 1 commit into
apache:masterfrom
gpsfl:CODEC-305-byte-skip-fix
Jun 13, 2022
Merged

CODEC-305: Fix byte-skipping in Base16 decoding#135
asfgit merged 1 commit into
apache:masterfrom
gpsfl:CODEC-305-byte-skip-fix

Conversation

@gpsfl

@gpsfl gpsfl commented Jun 12, 2022

Copy link
Copy Markdown

No description provided.

@codecov-commenter

codecov-commenter commented Jun 12, 2022

Copy link
Copy Markdown

Codecov Report

Merging #135 (10e99d1) into master (b22276d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #135      +/-   ##
============================================
- Coverage     92.16%   92.16%   -0.01%     
  Complexity     1746     1746              
============================================
  Files            67       67              
  Lines          4659     4658       -1     
  Branches        748      748              
============================================
- Hits           4294     4293       -1     
  Misses          249      249              
  Partials        116      116              
Impacted Files Coverage Δ
...n/java/org/apache/commons/codec/binary/Base16.java 98.52% <100.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b22276d...10e99d1. Read the comment docs.

@kinow kinow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution! I pressed the button to allow the workflow to run, but didn't review the code @gpsfl. Looks like the build failed. Could you take a look, maybe try running mvn locally to confirm the build passes on your environment first, if you don't want to wait for GH Actions to run.

@gpsfl

gpsfl commented Jun 12, 2022

Copy link
Copy Markdown
Author

Thank you for the quick response. It looks like builds on the master branch were already failing before my changes with the same error (see here for example). I was also able to reproduce it locally, both with and without my changes. Should I perhaps use another branch for the pull request?

@kinow

kinow commented Jun 12, 2022

Copy link
Copy Markdown
Member

Thank you for the quick response. It looks like builds on the master branch were already failing before my changes with the same error (see here for example). I was also able to reproduce it locally, both with and without my changes. Should I perhaps use another branch for the pull request?

Ah, thanks for looking into that @gpsfl . In that case we should fix the build and rebase this one to confirm these changes work as well. Feel free to wait until someone else steps in and fixes the build (or if you have spare time and feel like fixing that, pull requests are always welcome, though sometimes it can be tricky to figure out how to fix the build).

Bruno

@aherbert aherbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix. It seems the method logic is a bit convoluted. I have suggested a change that will consume the trailing 1/2 byte if present, then consume an even number of bytes from the remaining input length, then save a trailing 1/2 byte if present.

Can you review this and see if it passes your new unit test. Thanks.

Comment thread src/main/java/org/apache/commons/codec/binary/Base16.java
Comment thread src/main/java/org/apache/commons/codec/binary/Base16.java Outdated
@gpsfl

gpsfl commented Jun 12, 2022

Copy link
Copy Markdown
Author

I have implemented your suggestions and ran all unit tests successfully (using IntelliJ because the maven build is still broken).

@aherbert

Copy link
Copy Markdown
Contributor

Looks good. Can you rebase on master as I have fixed the build. Thanks.

@kinow

kinow commented Jun 12, 2022

Copy link
Copy Markdown
Member

Looks good. Can you rebase on master as I have fixed the build. Thanks.

I think @gpsfl found out that the build on master is broken - #135 (comment)

If so we may need to fix that so that this PR can be rebased and hopefully pass the build.

@aherbert

Copy link
Copy Markdown
Contributor

@kinow I just fixed the master build. It was due to animal-sniffer plugin complaining about a breaking API change in JDK 9+ with Buffer -> ByteBuffer as a return object from ByteBuffer operations. So a rebase should pick this up.

@kinow

kinow commented Jun 12, 2022

Copy link
Copy Markdown
Member

@kinow I just fixed the master build. It was due to animal-sniffer plugin complaining about a breaking API change in JDK 9+ with Buffer -> ByteBuffer as a return object from ByteBuffer operations. So a rebase should pick this up.

Thanks @aherbert !!!

@gpsfl gpsfl force-pushed the CODEC-305-byte-skip-fix branch from 28c86f9 to 10e99d1 Compare June 12, 2022 21:59
@gpsfl

gpsfl commented Jun 12, 2022

Copy link
Copy Markdown
Author

I have rebased the changes from master

@aherbert aherbert changed the title Fix byte-skipping described in CODEC-305 CODEC-305: Fix byte-skipping in Base16 decoding Jun 13, 2022
@aherbert

Copy link
Copy Markdown
Contributor

Looks fine. Can you squash all changes and prefix the commit message with CODEC-305: Fix byte-skipping in Base16 decoding. Thanks.

@gpsfl gpsfl force-pushed the CODEC-305-byte-skip-fix branch from 10e99d1 to 7ccbc3d Compare June 13, 2022 10:58
@gpsfl

gpsfl commented Jun 13, 2022

Copy link
Copy Markdown
Author

Looks fine. Can you squash all changes and prefix the commit message with CODEC-305: Fix byte-skipping in Base16 decoding. Thanks.

Done

@asfgit asfgit merged commit 7ccbc3d into apache:master Jun 13, 2022
@gpsfl

gpsfl commented Jun 13, 2022

Copy link
Copy Markdown
Author

Can you give any ETA on 1.16 release?

@aherbert

Copy link
Copy Markdown
Contributor

A 1.16 RC1 was trialled in January. However the release process was halted by an upstream dependency. I shall raise a question on the dev mailing list to see if the release manager has an update on this.

@gpsfl

gpsfl commented Jul 16, 2022

Copy link
Copy Markdown
Author

A 1.16 RC1 was trialled in January. However the release process was halted by an upstream dependency. I shall raise a question on the dev mailing list to see if the release manager has an update on this.

Any news regarding this?

@aherbert

Copy link
Copy Markdown
Contributor

The issue was related to upstream dependencies for managing the release. From the conversation on the mailing list:

"The current issue is that if a component does not use the
latest Apache RAT plugins, then it must do so in its POM. This could be
handled automatically if we released a new commons-parent."

@gpsfl gpsfl deleted the CODEC-305-byte-skip-fix branch August 2, 2022 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants