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-io.git

commit 6b889d83c9147082deadbce256bbcf4867119ee0
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Mar 2 07:03:21 2025 -0500

    Inline single use local variables
    
    Better comment wording
---
 src/main/java/org/apache/commons/io/RandomAccessFiles.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/RandomAccessFiles.java 
b/src/main/java/org/apache/commons/io/RandomAccessFiles.java
index 7d3a223be..db91e7d77 100644
--- a/src/main/java/org/apache/commons/io/RandomAccessFiles.java
+++ b/src/main/java/org/apache/commons/io/RandomAccessFiles.java
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
 import java.util.Objects;
 
 import org.apache.commons.io.channels.FileChannels;
@@ -56,11 +55,9 @@ public static boolean contentEquals(final RandomAccessFile 
raf1, final RandomAcc
             return true;
         }
         // Dig in and to the work
-        // We do not close FileChannels because that closes the owning 
RandomAccessFile.
+        // We do not close FileChannels because that would close the owning 
RandomAccessFile.
         // Instead, the caller is assumed to manage the given RandomAccessFile 
objects.
-        final FileChannel channel1 = raf1.getChannel();
-        final FileChannel channel2 = raf2.getChannel();
-        return FileChannels.contentEquals(channel1, channel2, 
IOUtils.DEFAULT_BUFFER_SIZE);
+        return FileChannels.contentEquals(raf1.getChannel(), 
raf2.getChannel(), IOUtils.DEFAULT_BUFFER_SIZE);
     }
 
     private static long length(final RandomAccessFile raf) throws IOException {

Reply via email to