Skip to content

Fixed a problem with dependency management filtering in the logged results - #1298

Merged
andrzejj0 merged 1 commit into
mojohaus:masterfrom
andrzejj0:dependency-management-filtering
Oct 27, 2025
Merged

andrzejj0 merged 1 commit into
mojohaus:masterfrom
andrzejj0:dependency-management-filtering

Conversation

@andrzejj0

@andrzejj0 andrzejj0 commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor

DisplayDependencyManagement should only show updates for dependency management entries, if these are not present in dependencies: it uses dependenciesMatch to filter those. However, the function was not correct: it should treat no values in dependency management as "wildcards" and not try matching nulls against dependency values.

Fixed that. A minor issue.

Edit: Copilot review is not entirely correct. There were no problems with NPE with this bug, it's rather that the matching was incorrect. It should treat not defined fields in dependency management as wildcards rather than match nulls with dependencies.

@andrzejj0 andrzejj0 self-assigned this Oct 21, 2025
@andrzejj0 andrzejj0 added maintenance Cleanup, refactoring or other internal change bug Something isn't working labels Oct 21, 2025
@slachiewicz
slachiewicz requested a review from Copilot October 21, 2025 08:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in dependency management filtering where null values in managed dependencies should act as wildcards when matching against actual dependencies, but were incorrectly being matched using .equals() which caused NullPointerExceptions.

Key Changes:

  • Fixed the dependenciesMatch method to treat null values in managed dependencies as wildcards rather than attempting to match them
  • Changed visibility from protected to package-private (static) for better encapsulation
  • Added comprehensive test coverage for the wildcard matching behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
DisplayDependencyUpdatesMojo.java Fixed null handling in dependenciesMatch to treat null managed dependency fields as wildcards and inverted the logic for scope/classifier matching
DisplayDependencyUpdatesMojoTest.java Added test coverage for wildcard matching behavior with null values in managed dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@andrzejj0
andrzejj0 merged commit 4edadbc into mojohaus:master Oct 27, 2025
@andrzejj0
andrzejj0 deleted the dependency-management-filtering branch October 27, 2025 08:47
@github-actions github-actions Bot added this to the 2.19.2 milestone Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working maintenance Cleanup, refactoring or other internal change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants