gnodet-bot commented on code in PR #13828:
URL: https://github.com/apache/maven/pull/13828#discussion_r4469310206


##########
impl/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java:
##########
@@ -37,6 +37,16 @@ public interface MavenExecutionResult {
      */
     List<MavenProject> getTopologicallySortedProjects();
 
+    MavenExecutionResult setAllProjects(List<MavenProject> projects);
+
+    /**
+     * Returns all projects in the reactor graph, including those not selected 
by {@code -pl}.
+     * This is a superset of {@link #getTopologicallySortedProjects()}.
+     *
+     * @return all reactor projects, or an empty list if the graph has not 
been built.
+     */
+    List<MavenProject> getAllProjects();

Review Comment:
   Same issue — `getAllProjects()` also needs a default to keep existing 
implementations compilable:
   
   ```suggestion
       default List<MavenProject> getAllProjects() {
           return Collections.emptyList();
       }
   ```
   
   (Add `import java.util.Collections;` to the interface if not already present 
— or use `List.of()` since Java 9.)



##########
impl/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java:
##########
@@ -37,6 +37,16 @@ public interface MavenExecutionResult {
      */
     List<MavenProject> getTopologicallySortedProjects();
 
+    MavenExecutionResult setAllProjects(List<MavenProject> projects);

Review Comment:
   ⚠️ **API break — missing `default` implementations**
   
   `MavenExecutionResult` is a public interface. Adding a non-`default` method 
breaks any embedder that implements this interface. For Java 8+, add a no-op 
default so existing implementations keep compiling:
   
   ```suggestion
       default MavenExecutionResult setAllProjects(List<MavenProject> projects) 
{
           return this;
       }
   ```



-- 
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