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


##########
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:
   Yes, looks like a bug in PMD



##########
compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManager.java:
##########
@@ -50,8 +50,6 @@ public class DefaultUpdateCheckManager extends 
AbstractLogEnabled implements Upd
 
     private static final String ERROR_KEY_SUFFIX = ".error";
 
-    public DefaultUpdateCheckManager() {}

Review Comment:
   don't change the API



##########
compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultUpdateCheckManager.java:
##########
@@ -303,7 +301,7 @@ private Properties read(File touchfile) {
                 Properties props = new Properties();
 
                 try (FileInputStream in = new FileInputStream(touchfile)) {
-                    try (FileLock lock = in.getChannel().lock(0, 
Long.MAX_VALUE, true)) {
+                    try (FileLock ignored = in.getChannel().lock(0, 
Long.MAX_VALUE, true)) {

Review Comment:
   It's not ignored. Is PMD simply wrong here?



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