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 2022/06/28 13:56:39 UTC
[commons-io] branch master updated: Use longer lines
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 b7ba2ecd Use longer lines
b7ba2ecd is described below
commit b7ba2ecd6cd2039a3b7b350da0547d69da1fd364
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 28 09:56:33 2022 -0400
Use longer lines
---
src/main/java/org/apache/commons/io/FileUtils.java | 6 ++----
.../java/org/apache/commons/io/input/CharSequenceReader.java | 11 ++++-------
.../org/apache/commons/io/input/ReadAheadInputStream.java | 3 +--
.../org/apache/commons/io/output/ByteArrayOutputStream.java | 3 +--
4 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index 5c85238e..c7876c74 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -2799,8 +2799,7 @@ public class FileUtils {
private static File requireExists(final File file, final String fileParamName) {
Objects.requireNonNull(file, fileParamName);
if (!file.exists()) {
- throw new IllegalArgumentException(
- "File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
+ throw new IllegalArgumentException("File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
}
return file;
}
@@ -2817,8 +2816,7 @@ public class FileUtils {
private static File requireExistsChecked(final File file, final String fileParamName) throws FileNotFoundException {
Objects.requireNonNull(file, fileParamName);
if (!file.exists()) {
- throw new FileNotFoundException(
- "File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
+ throw new FileNotFoundException("File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
}
return file;
}
diff --git a/src/main/java/org/apache/commons/io/input/CharSequenceReader.java b/src/main/java/org/apache/commons/io/input/CharSequenceReader.java
index 89448e66..203a65f9 100644
--- a/src/main/java/org/apache/commons/io/input/CharSequenceReader.java
+++ b/src/main/java/org/apache/commons/io/input/CharSequenceReader.java
@@ -116,12 +116,10 @@ public class CharSequenceReader extends Reader implements Serializable {
*/
public CharSequenceReader(final CharSequence charSequence, final int start, final int end) {
if (start < 0) {
- throw new IllegalArgumentException(
- "Start index is less than zero: " + start);
+ throw new IllegalArgumentException("Start index is less than zero: " + start);
}
if (end < start) {
- throw new IllegalArgumentException(
- "End index is less than start " + start + ": " + end);
+ throw new IllegalArgumentException("End index is less than start " + start + ": " + end);
}
// Don't check the start and end indexes against the CharSequence,
// to let it grow and shrink without breaking existing behavior.
@@ -269,13 +267,12 @@ public class CharSequenceReader extends Reader implements Serializable {
@Override
public long skip(final long n) {
if (n < 0) {
- throw new IllegalArgumentException(
- "Number of characters to skip is less than zero: " + n);
+ throw new IllegalArgumentException("Number of characters to skip is less than zero: " + n);
}
if (idx >= end()) {
return 0;
}
- final int dest = (int)Math.min(end(), idx + n);
+ final int dest = (int) Math.min(end(), idx + n);
final int count = dest - idx;
idx = dest;
return count;
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 3a685d7e..1af228fe 100644
--- a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
@@ -145,8 +145,7 @@ public class ReadAheadInputStream extends InputStream {
private ReadAheadInputStream(final InputStream inputStream, final int bufferSizeInBytes,
final ExecutorService executorService, final boolean shutdownExecutorService) {
if (bufferSizeInBytes <= 0) {
- throw new IllegalArgumentException(
- "bufferSizeInBytes should be greater than 0, but the value is " + bufferSizeInBytes);
+ throw new IllegalArgumentException("bufferSizeInBytes should be greater than 0, but the value is " + bufferSizeInBytes);
}
this.executorService = Objects.requireNonNull(executorService, "executorService");
this.underlyingInputStream = Objects.requireNonNull(inputStream, "inputStream");
diff --git a/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java b/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java
index d8f9edd3..23474f9f 100644
--- a/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java
+++ b/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java
@@ -102,8 +102,7 @@ public class ByteArrayOutputStream extends AbstractByteArrayOutputStream {
*/
public ByteArrayOutputStream(final int size) {
if (size < 0) {
- throw new IllegalArgumentException(
- "Negative initial size: " + size);
+ throw new IllegalArgumentException("Negative initial size: " + size);
}
synchronized (this) {
needNewBuffer(size);