Pankraz76 commented on code in PR #2376: URL: https://github.com/apache/maven/pull/2376#discussion_r2105417902
########## 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: indeed. This is the only use, which is an exception of the normal pattern (using is explizit). To make this clear the convention seems naming it `ignroed`, at least considering IDEA and PMD, both recognize the variable as marked explizit, as only used implicit. Now using the resource which the statement is all about, seems like an error, thats why its pointes out by these tools. Im altho wondering why its not used, allowing a comment to explain too. Then the comment end up in the code again, to be self explaining. ########## 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: indeed. This is the only use, which is an exception of the normal pattern (using is explizit). To make this clear the convention seems naming it `ignored`, at least considering IDEA and PMD, both recognize the variable as marked explizit, as only used implicit. Now using the resource which the statement is all about, seems like an error, thats why its pointes out by these tools. Im altho wondering why its not used, allowing a comment to explain too. Then the comment end up in the code again, to be self explaining. -- 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