zhangyue19921010 opened a new pull request, #30195: URL: https://github.com/apache/flink/pull/30195
## What is the purpose of the change Changing the array returned by `MemoryUnit.getUnits()` can make configuration parsing reject valid sizes elsewhere in the same JVM. For example, overwriting the first mebibyte suffix makes `1m` fail to parse. [FLINK-41732](https://issues.apache.org/jira/browse/FLINK-41732) ## Brief change log Return a copy of the suffix array to callers. Parsing and formatting use the private aliases directly. Add a regression that mutates the returned array and then parses `1m`. ## Verifying this change The new regression failed on master and passed with the fix. The memory-size and configuration tests passed locally. The parser and pretty-printing tests also passed with the whole-tebibyte change from #30150 applied. ## Does this pull request potentially affect one of the following parts The public `getUnits()` signature and its accepted suffixes stay the same. Each call now returns an independent array. The change is confined to memory-size configuration and formatting. ## Documentation The method Javadoc now describes the returned copy. -- 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]
