Skip to content

Commit 563aa2c

Browse files
committed
Use longer lines
1 parent 361cbac commit 563aa2c

File tree

3 files changed

+16
-40
lines changed

3 files changed

+16
-40
lines changed

src/test/java/org/apache/commons/io/build/AbstractOriginTest.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,8 @@ void testGetRandomAccessFile(final OpenOption openOption) throws IOException {
277277

278278
@Test
279279
void testGetReadableByteChannel() throws IOException {
280-
try (ReadableByteChannel channel =
281-
getOriginRo().getChannel(ReadableByteChannel.class, StandardOpenOption.READ)) {
282-
final SeekableByteChannel seekable =
283-
channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
280+
try (ReadableByteChannel channel = getOriginRo().getChannel(ReadableByteChannel.class, StandardOpenOption.READ)) {
281+
final SeekableByteChannel seekable = channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
284282
assertNotNull(channel);
285283
assertTrue(channel.isOpen());
286284
if (seekable != null) {
@@ -313,11 +311,9 @@ void testGetReader() throws IOException {
313311
@Test
314312
void testGetWritableByteChannel() throws IOException {
315313
final boolean supportsRead;
316-
try (WritableByteChannel channel =
317-
getOriginRw().getChannel(WritableByteChannel.class, StandardOpenOption.WRITE)) {
314+
try (WritableByteChannel channel = getOriginRw().getChannel(WritableByteChannel.class, StandardOpenOption.WRITE)) {
318315
supportsRead = channel instanceof ReadableByteChannel;
319-
final SeekableByteChannel seekable =
320-
channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
316+
final SeekableByteChannel seekable = channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
321317
assertNotNull(channel);
322318
assertTrue(channel.isOpen());
323319
if (seekable != null) {
@@ -332,18 +328,15 @@ void testGetWritableByteChannel() throws IOException {
332328
}
333329
if (supportsRead) {
334330
setOriginRw(newOriginRw());
335-
try (ReadableByteChannel channel =
336-
getOriginRw().getChannel(ReadableByteChannel.class, StandardOpenOption.READ)) {
331+
try (ReadableByteChannel channel = getOriginRw().getChannel(ReadableByteChannel.class, StandardOpenOption.READ)) {
337332
assertNotNull(channel);
338333
assertTrue(channel.isOpen());
339334
checkRead(channel);
340335
}
341336
}
342337
setOriginRw(newOriginRw());
343-
try (WritableByteChannel channel =
344-
getOriginRw().getChannel(WritableByteChannel.class, StandardOpenOption.WRITE)) {
345-
final SeekableByteChannel seekable =
346-
channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
338+
try (WritableByteChannel channel = getOriginRw().getChannel(WritableByteChannel.class, StandardOpenOption.WRITE)) {
339+
final SeekableByteChannel seekable = channel instanceof SeekableByteChannel ? (SeekableByteChannel) channel : null;
347340
assertNotNull(channel);
348341
assertTrue(channel.isOpen());
349342
if (seekable != null) {

src/test/java/org/apache/commons/io/build/AbstractStreamBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ public char[] get() {
5959
}
6060

6161
private static Stream<IOConsumer<Builder>> fileBasedConfigurers() throws URISyntaxException {
62-
final URI uri = Objects.requireNonNull(
63-
AbstractStreamBuilderTest.class.getResource(AbstractOriginTest.FILE_RES_RO))
64-
.toURI();
62+
final URI uri = Objects.requireNonNull(AbstractStreamBuilderTest.class.getResource(AbstractOriginTest.FILE_RES_RO)).toURI();
6563
final Path path = Paths.get(AbstractOriginTest.FILE_NAME_RO);
64+
// @formatter:off
6665
return Stream.of(
6766
b -> b.setByteArray(ArrayUtils.EMPTY_BYTE_ARRAY),
6867
b -> b.setFile(AbstractOriginTest.FILE_NAME_RO),
@@ -75,6 +74,7 @@ private static Stream<IOConsumer<Builder>> fileBasedConfigurers() throws URISynt
7574
b -> b.setInputStream(new FileInputStream(AbstractOriginTest.FILE_NAME_RO)),
7675
b -> b.setChannel(Files.newByteChannel(path)),
7776
b -> b.setURI(uri));
77+
// @formatter:on
7878
}
7979

8080
private void assertResult(final char[] arr, final int size) {
@@ -126,7 +126,7 @@ void testBufferSizeChecker() {
126126
@MethodSource("fileBasedConfigurers")
127127
void testGetInputStream(final IOConsumer<Builder> configurer) throws Exception {
128128
final Builder builder = builder();
129-
configurer.accept(builder);
129+
configurer.accept(builder);
130130
assertNotNull(builder.getInputStream());
131131
}
132132
}

src/test/java/org/apache/commons/io/channels/ByteArraySeekableByteChannelTest.java

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,11 @@ public class ByteArraySeekableByteChannelTest extends AbstractSeekableByteChanne
4545

4646
static Stream<Arguments> testConstructor() {
4747
return Stream.of(
48-
Arguments.of(
49-
(IOSupplier<ByteArraySeekableByteChannel>) ByteArraySeekableByteChannel::new,
50-
EMPTY_BYTE_ARRAY,
51-
IOUtils.DEFAULT_BUFFER_SIZE),
52-
Arguments.of(
53-
(IOSupplier<ByteArraySeekableByteChannel>) () -> new ByteArraySeekableByteChannel(8),
54-
EMPTY_BYTE_ARRAY,
55-
8),
56-
Arguments.of(
57-
(IOSupplier<ByteArraySeekableByteChannel>) () -> new ByteArraySeekableByteChannel(16),
58-
EMPTY_BYTE_ARRAY,
59-
16),
60-
Arguments.of(
61-
(IOSupplier<ByteArraySeekableByteChannel>)
62-
() -> ByteArraySeekableByteChannel.wrap(EMPTY_BYTE_ARRAY),
63-
EMPTY_BYTE_ARRAY,
64-
0),
65-
Arguments.of(
66-
(IOSupplier<ByteArraySeekableByteChannel>)
67-
() -> ByteArraySeekableByteChannel.wrap(testData),
68-
testData,
69-
testData.length));
48+
Arguments.of((IOSupplier<ByteArraySeekableByteChannel>) ByteArraySeekableByteChannel::new, EMPTY_BYTE_ARRAY, IOUtils.DEFAULT_BUFFER_SIZE),
49+
Arguments.of((IOSupplier<ByteArraySeekableByteChannel>) () -> new ByteArraySeekableByteChannel(8), EMPTY_BYTE_ARRAY, 8),
50+
Arguments.of((IOSupplier<ByteArraySeekableByteChannel>) () -> new ByteArraySeekableByteChannel(16), EMPTY_BYTE_ARRAY, 16),
51+
Arguments.of((IOSupplier<ByteArraySeekableByteChannel>) () -> ByteArraySeekableByteChannel.wrap(EMPTY_BYTE_ARRAY), EMPTY_BYTE_ARRAY, 0),
52+
Arguments.of((IOSupplier<ByteArraySeekableByteChannel>) () -> ByteArraySeekableByteChannel.wrap(testData), testData, testData.length));
7053
}
7154

7255
static Stream<Arguments> testShouldResizeWhenWritingMoreDataThanCapacity() {

0 commit comments

Comments
 (0)