Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-25 Thread Naoto Sato
On Mon, 23 Jun 2025 20:14:36 GMT, Naoto Sato wrote: > Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, > where the delimiter is set to `null` even if the method throws an NPE. Thanks for the reviews! - PR Comment: https://git.openjdk.org/jdk/pull/25942#i

Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-24 Thread Alan Bateman
On Mon, 23 Jun 2025 21:21:44 GMT, ExE Boss wrote: > Note that as mentioned in the bug discussion, the same also occurs when doing > `new StringTokenizer("some string", (String) null)`. Right, and it's super weird, but seems to have been specified since JDK 5 to defer the NPE to later. I don't

Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-23 Thread Alan Bateman
On Mon, 23 Jun 2025 20:14:36 GMT, Naoto Sato wrote: > Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, > where the delimiter is set to `null` even if the method throws an NPE. Marked as reviewed by alanb (Reviewer). - PR Review: https://git.openjdk.org/j

Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-23 Thread ExE Boss
On Mon, 23 Jun 2025 20:14:36 GMT, Naoto Sato wrote: > Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, > where the delimiter is set to `null` even if the method throws an NPE. Note that as mentioned in the bug discussion, the same also occurs when doing `new StringTo

Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-23 Thread Chen Liang
On Mon, 23 Jun 2025 20:14:36 GMT, Naoto Sato wrote: > Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, > where the delimiter is set to `null` even if the method throws an NPE. Indeed, looking at the spec, we would anticipate an exception means no change has been comm

RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-23 Thread Naoto Sato
Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, where the delimiter is set to `null` even if the method throws an NPE. - Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/25942/files Webrev: https://webrevs.openjdk.org/?repo=j