MojoExecutor: Auto-unbox NPE on missing project index
Found in: maven-4.0.x branch
File: impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java (line 374)
Severity: Medium
Description
The method executeForkedExecutions() auto-unboxes a potentially null Integer:
int index = projectIndex.getIndices().get(projectId); // auto-unboxing of null
projectIndex.getIndices() returns a Map<String, Integer>. If projectId is not in the map, Map.get() returns null, which auto-unboxes to int, throwing a NullPointerException. This can happen if a forked execution references a project ID that is not in the reactor.
MojoExecutor: Auto-unbox NPE on missing project index
Found in: maven-4.0.x branch
File:
impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java(line 374)Severity: Medium
Description
The method
executeForkedExecutions()auto-unboxes a potentially nullInteger:projectIndex.getIndices()returns aMap<String, Integer>. IfprojectIdis not in the map,Map.get()returnsnull, which auto-unboxes toint, throwing aNullPointerException. This can happen if a forked execution references a project ID that is not in the reactor.