Skip to content

Make AbstractAnalyzeMojo.filterArtifactsByScope() null-safe#1622

Merged
elharo merged 1 commit into
masterfrom
i1619
May 17, 2026
Merged

Make AbstractAnalyzeMojo.filterArtifactsByScope() null-safe#1622
elharo merged 1 commit into
masterfrom
i1619

Conversation

@elharo
Copy link
Copy Markdown
Contributor

@elharo elharo commented May 17, 2026

fixes #1619

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the potential NullPointerException reported in #1619 by making AbstractAnalyzeMojo.filterArtifactsByScope() null-safe when comparing artifact scopes.

Changes:

  • Add java.util.Objects import.
  • Replace artifact.getScope().equals(scope) with Objects.equals(artifact.getScope(), scope) to prevent NPE when getScope() is null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@slawekjaranowski
Copy link
Copy Markdown
Member

Can you update a title of PR - it will be add to release notes, so should be more descriptive

@elharo elharo changed the title Prevent NPE Make AbstractAnalyzeMojo.filterArtifactsByScope() null-safe May 17, 2026
@elharo elharo merged commit aea7a64 into master May 17, 2026
23 checks passed
@elharo elharo deleted the i1619 branch May 17, 2026 21:40
@github-actions
Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 3.11.0 milestone May 17, 2026
@slawekjaranowski
Copy link
Copy Markdown
Member

@elharo please look at release notes .... your PR are no categorized, also GitHub bot points you about it

https://github.com/apache/maven-dependency-plugin/releases

@slawekjaranowski
Copy link
Copy Markdown
Member

Also commit should have similar - the best the same title as PR 😄

Do you look at git log ?

@elharo elharo added the bug Something isn't working label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential NPE in AbstractAnalyzeMojo.filterArtifactsByScope()

3 participants