Skip to content

Commit

Permalink
Add Checkstyle MultipleVariableDeclarations
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Feb 9, 2025
1 parent 35601cb commit a870d4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/conf/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/org/apache/commons/io/test/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a870d4f

Please sign in to comment.