This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit ff3437b0b3d7495d7e3017b1fa9ef793a8c71fdb Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat May 11 17:51:54 2024 -0400 Java convention for variable declarations --- src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java b/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java index 121d9ade..29aa780a 100644 --- a/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java +++ b/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java @@ -156,15 +156,13 @@ public final class TFTPExample { private static boolean receive(final int transferMode, final String hostname, final String localFilename, final String remoteFilename, final TFTPClient tftp) throws IOException { - final boolean closed; - FileOutputStream output; - final File file; - file = new File(localFilename); + final File file = new File(localFilename); // If file exists, don't overwrite it. if (file.exists()) { System.err.println("Error: " + localFilename + " already exists."); return false; } + FileOutputStream output; // Try to open local file for writing try { output = new FileOutputStream(file); @@ -173,6 +171,7 @@ public final class TFTPExample { throw new IOException("Error: could not open local file for writing.", e); } open(tftp); + final boolean closed; // Try to receive remote file via TFTP try { final String[] parts = hostname.split(":");