On Fri, 14 Jul 2023 13:01:46 GMT, Glavo <d...@openjdk.org> wrote: >>> However, while I think this corrects the behavior, this caused a change in >>> the behavior of the API, so a CSR may be required. I don't want to debate >>> this in this PR, so I'll revert this change and open a new PR in the future. >> >> StreamTokenizer is a very old API and changing long standing behavior may >> break something or be observable with existing code/usages. I see youve >> reverted this part (thanks) and looking at it separately is fine. It might >> be that the conclusion is that it's just too risky to change, in which case >> Uwe's suggestion is good and would avoid it showing up on someone's else >> radar in the future. > >> It might be that the conclusion is that it's just too risky to change, in >> which case Uwe's suggestion is good and would avoid it showing up on >> someone's else radar in the future. > > Until we're sure we want to normalize a usage of `toLowerCase()` to one of > `toLowerCase(Locale.ROOT)` or `toLowerCase(Locale.getDefault())`, I think it > should be left here as-is, thus keeping it in an ambiguous state to remind us > to continue discussing it in the future.
If we can't normalize this use case to be locale-independent, then I even think `lowerCaseMode` should be deprecated, because it's almost impossible for users to get expected behavior with this method. In order to make it meaningful, I think it is still necessary to consider making it locale insensitive. We can allow users to fall back to the old behavior through new system properties, or introduce new API methods in `StreamTokenizer` to allow users to set the Locale to be used. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14763#discussion_r1263725166