zhangyue19921010 opened a new pull request, #30077:
URL: https://github.com/apache/flink/pull/30077

   ## What is the purpose of the change
   
   [FLINK-41639](https://issues.apache.org/jira/browse/FLINK-41639) tracks a 
round-trip failure in the string form of `MemorySize`. With the Java formatting 
locale set to `ar-EG`, `toString()` emits localized digits. Passing that string 
to `MemorySize.parse()` throws `NumberFormatException` because the parser 
accepts ASCII digits.
   
   ## Brief change log
   
   - Use `Locale.ROOT` when formatting the parseable string form of 
`MemorySize`.
   - Add a round-trip regression test using the `ar-EG` formatting locale and 
restore the previous locale after the test.
   
   ## Verifying this change
   
   - Before the fix, `MemorySizeTest#testToStringRoundTripWithLocalizedDigits` 
failed with `NumberFormatException: text does not start with a number`.
   - After the fix, all 18 tests in `MemorySizeTest` passed with Java 11 and 
Maven 3.9.16. The focused reactor run used `-Drat.skip=true -pl flink-core-api 
-am -Dtest=MemorySizeTest -Dsurefire.failIfNoSpecifiedTests=false test`.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies: No.
   - Public API: Yes. The `@PublicEvolving` class `MemorySize` now returns a 
locale-independent string from `toString()`.
   - Serializers: No.
   - Runtime per-record code paths: No.
   - Deployment or recovery: No.
   - S3 file system connector: No.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? No.
   - Feature documentation is not applicable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to