Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v8]

2023-11-20 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unre

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v7]

2023-10-18 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unre

Re: RFR: 8318200: String::newStringNoRepl and String::getBytesNoRepl does not throw CharacterCodingException [v5]

2023-10-18 Thread Glavo
On Tue, 17 Oct 2023 14:22:10 GMT, Shaojin Wen wrote: >> When calling String::newStringNoRepl and String::getBytesNoRepl, we need to >> use try...catch to handle CharacterCodingException and throw >> IllegalArgumentException instead of CharacterCodingException to make the >> calling code cleane

Integrated: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base

2023-08-16 Thread Glavo
On Mon, 3 Jul 2023 20:53:34 GMT, Glavo wrote: > Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. This pull request has now been integrated. Changeset: b32d6411 Author: Glavo Committer: Naoto Sato URL: https://git.openjdk.org/jdk/com

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v3]

2023-08-16 Thread Glavo
On Tue, 15 Aug 2023 10:48:29 GMT, Glavo wrote: >> Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. > > Glavo has updated the pull request with a new target base due to a merge or a > rebase. The pull request now contains four commits: > > - Merge r

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v3]

2023-08-15 Thread Glavo
On Tue, 15 Aug 2023 10:48:29 GMT, Glavo wrote: >> Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. > > Glavo has updated the pull request with a new target base due to a merge or a > rebase. The pull request now contains four commits: > > - Merge r

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v3]

2023-08-15 Thread Glavo
> Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. Glavo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits: - Merge remote-tracking branch 'origin/master' into case-conversion-java-b

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v2]

2023-07-14 Thread Glavo
On Fri, 14 Jul 2023 13:01:46 GMT, Glavo 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 c

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v2]

2023-07-14 Thread Glavo
On Fri, 14 Jul 2023 10:24:47 GMT, Alan Bateman wrote: > 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 `toLow

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v2]

2023-07-12 Thread Glavo
On Wed, 12 Jul 2023 16:05:03 GMT, Uwe Schindler wrote: > Maybe a small suggestion to make it clear whats wanted here. In other > projects I am involved in (Apache Lucene/Solr, Apache TIKA, PostgresSQL JDBC, > Checkstyle itsself, Elasticserach/Opensearch), which use the [forbiddenapis > Maven/G

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base [v2]

2023-07-12 Thread Glavo
> Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. Glavo has updated the pull request incrementally with one additional commit since the last revision: Revert StreamTokenizer.java - Changes: - all: https://git.openjdk.org/jdk/pull/14763/files - new: ht

Re: RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base

2023-07-12 Thread Glavo
On Wed, 12 Jul 2023 13:26:03 GMT, Alan Bateman wrote: > I suspect this change to StreamTokenizer needs eyes. I think long standing > behavior of the lowerCaseMode(true) has been to use the rules for the default > locale so we need to be careful. I investigated some usage of this method on GitH

RFR: 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base

2023-07-12 Thread Glavo
Clean up misuses of `toLowerCase()`/`toUpperCase()` in java.base. - Commit messages: - Update DateTimeFormatterBuilder - Avoid locale-sensitive case conversions in java.base Changes: https://git.openjdk.org/jdk/pull/14763/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=1476

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v6]

2023-07-03 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request incrementally with one additional commit since the last revision: Use ne

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v5]

2023-07-03 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unre

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v4]

2023-06-28 Thread Glavo
On Wed, 28 Jun 2023 01:45:51 GMT, Chen Liang wrote: > On a side note, `NoRepl` means "no replication", implying the passed array is > already trusted. I think you should do something like this instead: I think `NoRepl` means "no replace", it's an ambiguous acronym. It cannot be replaced by `ne

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v4]

2023-06-27 Thread Glavo
On Tue, 27 Jun 2023 21:03:05 GMT, Roger Riggs wrote: > The goal of removing the try/catch from HexFormat can be solved locally by > creating a private method in HexFormat that swallows the exception. There is > no need to add a method to Java Lang Access or change 3 other files. The > method `

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v4]

2023-06-27 Thread Glavo
On Tue, 27 Jun 2023 17:58:05 GMT, Roger Riggs wrote: > It takes a local inconvenience try/catch and spreads the impact over multiple > files and packages as well as bulking up JLA. I don't quite understand what you mean. The main goal of this PR is to get rid of those annoying try-catch, but i

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v4]

2023-06-27 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unre

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v3]

2023-06-26 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unre

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v2]

2023-06-26 Thread Glavo
On Mon, 26 Jun 2023 16:02:57 GMT, Chen Liang wrote: > This is just a copycat of the original newStringNoRepl, which should be > fixed; newStringUTF8NoRepl has no such issue. Unfortunately, the behavior of `newStringUTF8NoRepl` is not the same as that of `newStringNoRepl`, as it actually always

Re: RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl [v2]

2023-06-26 Thread Glavo
al Latin-1 characters, > `newStringLatin1NoRepl` **will not throw `CharacterCodingException`**, so > users can make the compiler happy without using useless try-catch statements. Glavo has updated the pull request incrementally with one additional commit since the last revision: update javadoc

RFR: 8310901: Convert String::newStringNoRepl with Latin-1 to String::newStringLatin1NoRepl

2023-06-26 Thread Glavo
Added a new method `newStringLatin1NoRepl` to the `JavaLangAccess`. Reasons: * Most use cases of `newStringNoRepl` use `ISO_8859_1` as the charset, creating a new shortcut can make writing shorter; * Since all possible values of `byte` are legal Latin-1 characters, `newStringLatin1NoRepl` **wil