RFR: 8349705: java.net.URI.scanIPv4Address throws unnecessary URISyntaxException
Xiaolong Peng
xpeng at openjdk.org
Mon Feb 10 09:52:51 UTC 2025
java.net.URI.scanIPv4Address is a private method, it is only called by java.net.URI.takeIPv4Address and java.net.URI.parseIPv4Address, the URISyntaxException("Malformed IPv4 address") is not necessary, returning -1 should be good. In one of our systems, we noticed the exception consumes ~0.3% CPU.
Additional test:
- [x] make test TEST=jdk/java/net
-------------
Commit messages:
- 8349705: java.net.URI.scanIPv4Address throws unnecessary URISyntaxException
Changes: https://git.openjdk.org/jdk/pull/23538/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23538&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8349705
Stats: 6 lines in 1 file changed: 4 ins; 1 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/23538.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23538/head:pull/23538
PR: https://git.openjdk.org/jdk/pull/23538
More information about the net-dev
mailing list