Skip to content

Consistent resource-bundle descriptor validation (#272) - #286

Open
elharo wants to merge 1 commit into
masterfrom
fix/issue-272-consistent-bundle-validation
Open

Consistent resource-bundle descriptor validation (#272)#286
elharo wants to merge 1 commit into
masterfrom
fix/issue-272-consistent-bundle-validation

Conversation

@elharo

@elharo elharo commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #272

Problem

validate() split bundle descriptors with StringUtils.split(artifactDescriptor, ":"),
which collapses empty segments, while downloadBundles() used
artifactDescriptor.split(":"), which preserves them. So a malformed descriptor
such as group:artifact::type (missing version) passed validate() and then
failed later with a confusing resolution error, never showing the clear
validation message.

Fix

validate() now uses the same split(":") logic as downloadBundles() and
additionally rejects descriptors where groupId, artifactId or version is empty
(e.g. a missing segment). Malformed descriptors now fail fast with the existing,
clear "resource bundle configured must specify..." message.

The reactor lookup in downloadBundles() compares with a non-null receiver
(s[0].equals(p.getGroupId())), so it is already null-safe.

Test

New unit test testValidateRejectsDescriptorWithEmptySegment: configures a
org.example:dep::jar descriptor and asserts validate() throws the validation
error. Verified the test fails without the fix (validate() let the descriptor
through) and passes with it. Full mvn verify -Prun-its (unit + failsafe ITs,
spotless/checkstyle/RAT) passes.

@elharo
elharo requested review from dfoulks1 and hgschmie August 2, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent resource-bundle descriptor parsing between validate() and downloadBundles()

1 participant