You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/02/09 20:08:30 UTC

(commons-io) branch master updated: Add Checkstyle MultipleVariableDeclarations

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


The following commit(s) were added to refs/heads/master by this push:
     new a870d4f33 Add Checkstyle MultipleVariableDeclarations
a870d4f33 is described below

commit a870d4f337859e2493d2c049de31190836641c3d
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:08:24 2025 -0500

    Add Checkstyle MultipleVariableDeclarations
---
 src/conf/checkstyle.xml                                             | 1 +
 src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java | 3 ++-
 src/test/java/org/apache/commons/io/test/TestUtils.java             | 6 ++++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index 2fd89cbcb..72a8c1ea9 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -57,6 +57,7 @@ limitations under the License.
     <module name="LeftCurly" />
     <module name="MissingOverride" />
     <module name="ModifierOrder" />
+    <module name="MultipleVariableDeclarations" />
     <module name="NeedBraces" />
     <module name="ParenPad" />
     <module name="RedundantImport" />
diff --git a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
index 39a9d13b9..c03725140 100644
--- a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
@@ -414,7 +414,8 @@ private void readAsync() throws IOException {
             //
             // So there is no race condition in both the situations.
             int read = 0;
-            int off = 0, len = arr.length;
+            int off = 0;
+            int len = arr.length;
             Throwable exception = null;
             try {
                 // try to fill the read ahead buffer.
diff --git a/src/test/java/org/apache/commons/io/test/TestUtils.java b/src/test/java/org/apache/commons/io/test/TestUtils.java
index 987fd89ce..776623ea6 100644
--- a/src/test/java/org/apache/commons/io/test/TestUtils.java
+++ b/src/test/java/org/apache/commons/io/test/TestUtils.java
@@ -64,7 +64,8 @@ public static void assertEqualContent(final byte[] b0, final File file) throws I
      * @throws IOException If an I/O error occurs while reading the file contents
      */
     public static void assertEqualContent(final byte[] b0, final Path file) throws IOException {
-        int count = 0, numRead = 0;
+        int count = 0;
+        int numRead = 0;
         final byte[] b1 = new byte[b0.length];
         try (InputStream is = Files.newInputStream(file)) {
             while (count < b0.length && numRead >= 0) {
@@ -97,7 +98,8 @@ public static void assertEqualContent(final char[] c0, final File file) throws I
      * @throws IOException If an I/O error occurs while reading the file contents
      */
     public static void assertEqualContent(final char[] c0, final Path file) throws IOException {
-        int count = 0, numRead = 0;
+        int count = 0;
+        int numRead = 0;
         final char[] c1 = new char[c0.length];
         try (Reader ir = Files.newBufferedReader(file)) {
             while (count < c0.length && numRead >= 0) {