Repository navigation
Conversation
The next release changes the return type of CopyUtil.copy, which breaks binary compatibility, so it is a minor version bump.
CopyUtil.copy returned an int, so since #25 a copy larger than Integer.MAX_VALUE bytes or characters reported Integer.MAX_VALUE instead of the real count. Every copy method and copyInternal now return a long with the exact count, and the cap is removed. BREAKING CHANGE: the return type of every CopyUtil.copy overload and of the protected copyInternal methods changes from int to long. Code that assigns the result to an int no longer compiles, and classes compiled against an earlier corelib fail with NoSuchMethodError at the call site until they are recompiled, even when they ignore the result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #25.
Changes
0.8.0-SNAPSHOT.CopyUtil.copyoverload and the protectedcopyInternalmethods now return along. Since fix(io): copy content larger than 2GB and keep what a file stream already holds #25 a copy larger thanInteger.MAX_VALUEbytes or characters reportedInteger.MAX_VALUE; it now reports the exact count, and that cap is removed.Compatibility
This is a breaking change, hence the minor version bump:
intno longer compiles. No caller in the codelibs repositories uses the result (fess, fess-crawler and fess-ds-git callCopyUtil.copyand discard it), so they compile unchanged.int-returning method and fails withNoSuchMethodErrorat the call site until it is recompiled, even when it ignores the result. Consumers have to be rebuilt against 0.8.0 rather than given the new jar alone.Verification
mvn test: 708 tests pass. TheCopyUtilTestassertions now compare againstlongcounts.copy(InputStream, File),copy(File, OutputStream)andcopy(File, File). Each returned exactly 2,147,495,953, matching the bytes written.