Skip to content

Commit b7ba2ec

Browse files
author
Gary Gregory
committed
Use longer lines
1 parent 235a243 commit b7ba2ec

4 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,8 +2799,7 @@ private static void requireEqualSizes(final File srcFile, final File destFile, f
27992799
private static File requireExists(final File file, final String fileParamName) {
28002800
Objects.requireNonNull(file, fileParamName);
28012801
if (!file.exists()) {
2802-
throw new IllegalArgumentException(
2803-
"File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
2802+
throw new IllegalArgumentException("File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
28042803
}
28052804
return file;
28062805
}
@@ -2817,8 +2816,7 @@ private static File requireExists(final File file, final String fileParamName) {
28172816
private static File requireExistsChecked(final File file, final String fileParamName) throws FileNotFoundException {
28182817
Objects.requireNonNull(file, fileParamName);
28192818
if (!file.exists()) {
2820-
throw new FileNotFoundException(
2821-
"File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
2819+
throw new FileNotFoundException("File system element for parameter '" + fileParamName + "' does not exist: '" + file + "'");
28222820
}
28232821
return file;
28242822
}

src/main/java/org/apache/commons/io/input/CharSequenceReader.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,10 @@ public CharSequenceReader(final CharSequence charSequence, final int start) {
116116
*/
117117
public CharSequenceReader(final CharSequence charSequence, final int start, final int end) {
118118
if (start < 0) {
119-
throw new IllegalArgumentException(
120-
"Start index is less than zero: " + start);
119+
throw new IllegalArgumentException("Start index is less than zero: " + start);
121120
}
122121
if (end < start) {
123-
throw new IllegalArgumentException(
124-
"End index is less than start " + start + ": " + end);
122+
throw new IllegalArgumentException("End index is less than start " + start + ": " + end);
125123
}
126124
// Don't check the start and end indexes against the CharSequence,
127125
// to let it grow and shrink without breaking existing behavior.
@@ -269,13 +267,12 @@ public void reset() {
269267
@Override
270268
public long skip(final long n) {
271269
if (n < 0) {
272-
throw new IllegalArgumentException(
273-
"Number of characters to skip is less than zero: " + n);
270+
throw new IllegalArgumentException("Number of characters to skip is less than zero: " + n);
274271
}
275272
if (idx >= end()) {
276273
return 0;
277274
}
278-
final int dest = (int)Math.min(end(), idx + n);
275+
final int dest = (int) Math.min(end(), idx + n);
279276
final int count = dest - idx;
280277
idx = dest;
281278
return count;

src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ public ReadAheadInputStream(final InputStream inputStream, final int bufferSizeI
145145
private ReadAheadInputStream(final InputStream inputStream, final int bufferSizeInBytes,
146146
final ExecutorService executorService, final boolean shutdownExecutorService) {
147147
if (bufferSizeInBytes <= 0) {
148-
throw new IllegalArgumentException(
149-
"bufferSizeInBytes should be greater than 0, but the value is " + bufferSizeInBytes);
148+
throw new IllegalArgumentException("bufferSizeInBytes should be greater than 0, but the value is " + bufferSizeInBytes);
150149
}
151150
this.executorService = Objects.requireNonNull(executorService, "executorService");
152151
this.underlyingInputStream = Objects.requireNonNull(inputStream, "inputStream");

src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ public ByteArrayOutputStream() {
102102
*/
103103
public ByteArrayOutputStream(final int size) {
104104
if (size < 0) {
105-
throw new IllegalArgumentException(
106-
"Negative initial size: " + size);
105+
throw new IllegalArgumentException("Negative initial size: " + size);
107106
}
108107
synchronized (this) {
109108
needNewBuffer(size);

0 commit comments

Comments
 (0)