Repository navigation
Conversation
refreshCache() writes the cache file through an OutputStreamWriter with UTF-8, but loadCache() read it with FileReader, i.e. the platform charset. On JDK 8-17 with a non-UTF-8 default (for example GBK on Chinese Windows) non-ASCII text in cached metadata came back garbled. loadCache() also split each line on every '=', so a value containing '=' (base64 padding, "a=b" parameters) was cut at the first one. Only the first '=' separates the key now.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16571 +/- ##
============================================
+ Coverage 61.00% 61.02% +0.02%
- Complexity 15 11768 +11753
============================================
Files 1953 1953
Lines 89286 89286
Branches 13478 13478
============================================
+ Hits 54471 54491 +20
+ Misses 29213 29200 -13
+ Partials 5602 5595 -7
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:
|
This branch has not been deployed
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.
What is the purpose of the change?
FileCacheStore.refreshCache()writes the local cache file (.metadata,.mapping) with anOutputStreamWriterset to UTF-8, butloadCache()reads it back withFileReader, which uses the platform charset. On JDK 8–17 with a non-UTF-8 default, e.g. GBK on Chinese Windows, any non-ASCII text in the cachedMetadataInfo(such as a service parameter value) comes back garbled after a restart.loadCache()also splits each line on every=, so a value that contains=(base64 padding, a parameter likea=b) is cut at the first one.This reads the file as UTF-8 and splits only on the first
=.The new
FileCacheStoreTest#testLoadCacheReadsBackWhatRefreshCacheWrotewrites two entries withrefreshCache()and expectsloadCache()to return them unchanged. On3.3it fails:and with JDK 17 and
-Dargline=-Dfile.encoding=GBKthe value is also garbled ("desc":"璁㈠崟鏈嶅姟"). It passes with the change.Checklist