rmannibucau commented on PR #1566:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/1566#issuecomment-3675793769

    > try-with-resources handles the flush.
   
   Please run
   
   ```
   class Foo {
       @Test
       void run() throws IOException {
           try (final var writer = new StringWriter() {
               @Override
               public void flush() {
                   throw new IllegalStateException("this will not happen");
               }
           }) {
               writer.write("test");
           }
       }
   }
   ```
   
   
   > That's what this block was originally trying to do with the ignored 
variable.
   
   No, the current code works cause we call `toString` after `close` which does 
handle `flush`, no more your version which doesn't work then


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