Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16452 +/- ##
============================================
- Coverage 61.00% 59.03% -1.98%
Complexity 15 15
============================================
Files 1953 1953
Lines 89286 89286
Branches 13478 13478
============================================
- Hits 54471 52706 -1765
- Misses 29213 30868 +1655
- Partials 5602 5712 +110
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
It looks like this method isn’t used anywhere. Please fix it, mark it as deprecated, and note that it will be removed in the next version. |
Signed-off-by: cuishuang <imcusg@gmail.com>
c46bbd1 to
b926206
Compare
Thanks, @RainYuY. I rebased onto 3.3, which already includes the MD5 fix and regression tests from #16543. I marked Bytes.getMD5(File) and Bytes.getMD5(InputStream) as deprecated and documented that both will be removed in the next version. All 15 BytesTest tests passed locally. Could you approve the new CI run and take another look when you have a chance? |
What is the purpose of the change?
Fix incorrect MD5 calculation in
Bytes.getMD5(InputStream)andBytes.getMD5(File).The previous implementation used
InputStream.available()to detect EOF and passed the entire buffer toMessageDigest.update(). For a final partial read, zero-filled bytes were included in the digest. Streams that reportavailable() == 0while still containing readable data were also skipped.This change reads until
read()returns-1and updates the digest with only the bytes actually read.GitHub issue: #16451
Checklist