Issue #15589 - Improve InetAddressPattern testing - #15609
Open
DragonFSKY wants to merge 1 commit into
Open
Conversation
DragonFSKY
force-pushed
the
test-15589-inet-address-pattern
branch
from
August 25, 2026 11:12
58c1875 to
c2d2149
Compare
Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
DragonFSKY
force-pushed
the
test-15589-inet-address-pattern
branch
from
August 25, 2026 16:03
c2d2149 to
9a02849
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds direct parameterized tests for
InetAddressPattern, covering singleton, CIDR, min/max, and legacy patterns across IPv4 and IPv6, along with invalid patterns and null handling.The tests exposed two edge cases: an all-zero address could accept a negative CIDR, and legacy patterns threw for a null address. This rejects negative CIDR values before calculating the mask and makes legacy patterns consistent with the other implementations.
Fixes #15589.
Tests:
mvn -pl jetty-core/jetty-util -Dtest=InetAddressPatternTest test(48 tests)mvn -pl jetty-core/jetty-util test(3011 tests, 0 failures, 0 errors)AI disclosure
I used OpenAI GPT-5.6 and Kimi K3 to assist with issue analysis and drafting the implementation and tests. I reviewed and verified the final changes.