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

[IO-781] Make CharSequenceInputStream.available() more correct in the face of multibyte encodings #525

Merged
merged 7 commits into from
Dec 17, 2023

Conversation

elharo
Copy link
Contributor

@elharo elharo commented Dec 17, 2023

Per contract, available() is not required to return the exact or maximum number of bytes available without blocking. It is required to return a number less than or equal to that. Always returning 0 is an acceptable implementation (though here we can do better than that).

@garydgregory

FYI locally the build fails on JDK 8 with an apparently unrelated error:

[ERROR] /Users/elharo/commons-io/src/test/java/org/apache/commons/io/file/FilesUncheckTest.java:[99,25] cannot access org.apache.commons.io.file.FilesUncheck
bad class file: /Users/elharo/commons-io/target/classes/org/apache/commons/io/file/FilesUncheck.class
undeclared type variable: A
Please remove or make sure it appears in the correct subdirectory of the classpath.

Let's see what the CI does with this.

@elharo elharo changed the title [IO-781] Make available() more correct in the face of multibyte encodings [IO-781] Make CharSequenceInputStream.available() more correct in the face of multibyte encodings Dec 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (a8ee7b9) 86.31% compared to head (1350f15) 86.24%.
Report is 1 commits behind head on master.

Files Patch % Lines
...ache/commons/io/input/CharSequenceInputStream.java 50.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #525      +/-   ##
============================================
- Coverage     86.31%   86.24%   -0.07%     
+ Complexity     3438     3437       -1     
============================================
  Files           229      229              
  Lines          8154     8159       +5     
  Branches        959      959              
============================================
- Hits           7038     7037       -1     
- Misses          834      839       +5     
- Partials        282      283       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@garydgregory garydgregory merged commit e73aa1d into apache:master Dec 17, 2023
15 checks passed
@elharo elharo deleted the IO-781 branch December 17, 2023 21:20
asfgit pushed a commit that referenced this pull request Dec 17, 2023
@garydgregory
Copy link
Member

@elharo TY!

asfgit pushed a commit that referenced this pull request Dec 17, 2023
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Mar 31, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `commons-io` from `2.15.1` to `2.16.0`.

### Why are the changes needed?
1.2.15.1 vs 2.16.0
apache/commons-io@rel/commons-io-2.15.1...rel/commons-io-2.16.0

2.The version fix some bugs:
apache/commons-io#525
apache/commons-io#521

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #45781 from panbingkun/SPARK-47656.

Authored-by: panbingkun <panbingkun@baidu.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
sweisdb pushed a commit to sweisdb/spark that referenced this pull request Apr 1, 2024
### What changes were proposed in this pull request?
The pr aims to upgrade `commons-io` from `2.15.1` to `2.16.0`.

### Why are the changes needed?
1.2.15.1 vs 2.16.0
apache/commons-io@rel/commons-io-2.15.1...rel/commons-io-2.16.0

2.The version fix some bugs:
apache/commons-io#525
apache/commons-io#521

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes apache#45781 from panbingkun/SPARK-47656.

Authored-by: panbingkun <panbingkun@baidu.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants