gnodet-bot commented on code in PR #13233:
URL: https://github.com/apache/maven/pull/13233#discussion_r4068891515
##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java:
##########
@@ -619,6 +620,7 @@ private Clock getClock(Object key) {
private void plan() {
lock.writeLock().lock();
try {
+ Set<String> skippedPhases = new
HashSet<>(session.getRequest().getSkippedPhases());
Review Comment:
**Missing null guard — inconsistent with the sequential path.**
`DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions()` added
`session.getRequest() != null` before calling `getSkippedPhases()`. The
concurrent path here does not. Both callers need the same defensive guard so
that test-only usage paths (which call `calculateMojoExecutions` with a stub
session where `getRequest()` is null) don't NPE at a different call site.
```suggestion
Set<String> skippedPhases = session.getRequest() != null
? new
HashSet<>(session.getRequest().getSkippedPhases())
: Set.of();
```
##########
impl/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -121,6 +121,11 @@ public interface MavenExecutionRequest {
List<String> getGoals();
+ // Skipped phases
+ MavenExecutionRequest setSkippedPhases(List<String> skippedPhases);
+
+ List<String> getSkippedPhases();
Review Comment:
**Missing Javadoc on the new interface methods.**
Every other section in `MavenExecutionRequest` that adds public methods has
at minimum a `@since` tag. The new `setSkippedPhases`/`getSkippedPhases` have
only a bare inline comment. At minimum:
```suggestion
/**
* Sets the lifecycle phases whose mojo executions should be suppressed.
*
* @param skippedPhases list of phase names (e.g. {@code "test"}, {@code
"integration-test"}),
* or {@code null} to clear
* @return this request
* @since 4.1.0
*/
MavenExecutionRequest setSkippedPhases(List<String> skippedPhases);
/**
* Returns the lifecycle phases whose mojo executions are suppressed.
*
* @return mutable list of phase names; never {@code null}
* @since 4.1.0
*/
List<String> getSkippedPhases();
```
--
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]