Pankraz76 commented on code in PR #2376:
URL: https://github.com/apache/maven/pull/2376#discussion_r2104702849


##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java:
##########
@@ -306,7 +306,7 @@ private void doExecute(MavenSession session, MojoExecution 
mojoExecution, Depend
 
         ensureDependenciesAreResolved(mojoDescriptor, session, 
dependencyContext);
 
-        try (NoExceptionCloseable lock = getProjectLock(session, 
mojoDescriptor)) {
+        try (NoExceptionCloseable ignore = getProjectLock(session, 
mojoDescriptor)) {

Review Comment:
   declaring something not used is misleading.
   
   Its just "used" in terms of resource handling, but not 
   
   Then simply remove the overhead not needed:
   
   <img width="1148" alt="image" 
src="https://github.com/user-attachments/assets/ef738267-e474-4549-bd61-4083935146f4";
 />
   
   
   We would expect some interaction with the field like:
   
   ```java
           try (NoExceptionCloseable lock = getProjectLock(session, 
mojoDescriptor)) {
               lock.close();
               doExecute2(session, mojoExecution);
           } finally {
               for (MavenProject forkedProject : forkedProjects) {
                   forkedProject.setExecutionProject(null);
               }
           }
   ```



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to