[ https://issues.apache.org/jira/browse/MSHARED-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059020#comment-17059020 ]
Karl Heinz Marbaise commented on MSHARED-863: --------------------------------------------- In the end they are going to call the constructor of [CollectRequest|https://github.com/apache/maven-artifact-transfer/blob/master/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java#L190] which calls methods like {{setManagedDependencies}} which are implemented like this: {code:java} public CollectRequest setManagedDependencies( List<Dependency> managedDependencies ) { if ( managedDependencies == null ) { this.managedDependencies = Collections.emptyList(); } else { this.managedDependencies = managedDependencies; } return this; } {code} which would mean that we can prevent using {{null}} and use {{Collections.emptyList()}} instead and that should not change a thing. So first step is to prevent NPE... > Possible NPEx in Maven30DependencyResolver.resolveDependencies > -------------------------------------------------------------- > > Key: MSHARED-863 > URL: https://issues.apache.org/jira/browse/MSHARED-863 > Project: Maven Shared Components > Issue Type: Bug > Components: maven-artifact-transfer > Affects Versions: maven-artifact-transfer-0.12.0 > Reporter: Piotr Zygielo > Priority: Major > > Possible NPEx in > [Maven30DependencyResolver.resolveDependencies|https://github.com/apache/maven-artifact-transfer/blob/dc0d6bd30b855e147576c4e9cdfacf1382d69f07/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java#L156] > {code:java} > List<Dependency> aetherDependencies = new ArrayList<Dependency>( > mavenDependencies.size() ); > if ( mavenDependencies != null ) > { > aetherDependencies = new ArrayList<Dependency>( > mavenDependencies.size() ); > ... > {code} > Line 161 > {code:java} > if ( mavenDependencies != null ) > {code} > suggests that {{mavenDependencies}} can be {{null}}. > However in such case previous {{mavenDependencies.size()}} results in > {{NPEx}}. -- This message was sent by Atlassian Jira (v8.3.4#803005)