You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/12/30 18:47:53 UTC

[maven-dependency-plugin] branch null created (now 9646b0e)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch null
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git.


      at 9646b0e  fix NullPointerException

This branch includes the following new commits:

     new 9646b0e  fix NullPointerException

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-dependency-plugin] 01/01: fix NullPointerException

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch null
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit 9646b0ed76a6d00e468c8eb1b6a27d260b09e944
Author: Elliotte Rusty Harold <el...@google.com>
AuthorDate: Wed Dec 30 13:07:53 2020 -0500

    fix NullPointerException
---
 .../maven/plugins/dependency/tree/VerboseDependencyGraphBuilder.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/tree/VerboseDependencyGraphBuilder.java b/src/main/java/org/apache/maven/plugins/dependency/tree/VerboseDependencyGraphBuilder.java
index 610fb0f..ed43cd4 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/tree/VerboseDependencyGraphBuilder.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/tree/VerboseDependencyGraphBuilder.java
@@ -51,6 +51,7 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
 /**
@@ -160,8 +161,7 @@ class VerboseDependencyGraphBuilder
                 node.setArtifact( node.getArtifact().setVersion( manager.getVersion() ) );
             }
 
-            // split these out one dereference per statement to narrow down a null pointer exception
-            String managerScope = manager.getScope();
+            String managerScope = Objects.toString( manager.getScope(), "compile" );
             Dependency dependency = node.getDependency();
             String dependencyScope = dependency.getScope();
             if ( !managerScope.equals( dependencyScope ) )