elharo opened a new issue, #1619:
URL: https://github.com/apache/maven-dependency-plugin/issues/1619

   ## Problem
   
   The `filterArtifactsByScope()` method at line 452 calls 
`artifact.getScope().equals(scope)` without checking if `getScope()` returns 
null:
   
   ```java
   private void filterArtifactsByScope(Set<Artifact> artifacts, String scope) {
       artifacts.removeIf(artifact -> artifact.getScope().equals(scope));
   }
   ```
   
   If `artifact.getScope()` returns `null`, this throws a 
`NullPointerException`.
   
   ## Fix
   
   Reverse the comparison or use `Objects.equals()`:
   
   ```java
   artifacts.removeIf(artifact -> Objects.equals(artifact.getScope(), scope));
   ```
   
   ## File
   
   
`src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java:451-453`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to