Skip to content

Commit 6eaca99

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924873 13f79535-47bb-0310-9956-ffa450edef68
1 parent ea9724b commit 6eaca99

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

fontbox/src/test/java/org/apache/fontbox/ttf/RandomAccessReadBufferDataStreamTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void testEOFUnsignedShort() throws IOException
6969
randomAccessReadBuffer))
7070
{
7171
dataStream.readUnsignedShort();
72-
assertThrows(EOFException.class, () -> dataStream.readUnsignedShort());
72+
assertThrows(EOFException.class, dataStream::readUnsignedShort);
7373
}
7474
}
7575

@@ -82,7 +82,7 @@ void testEOFUnsignedInt() throws IOException
8282
randomAccessReadBuffer))
8383
{
8484
dataStream.readUnsignedInt();
85-
assertThrows(EOFException.class, () -> dataStream.readUnsignedInt());
85+
assertThrows(EOFException.class, dataStream::readUnsignedInt);
8686
}
8787
}
8888

@@ -96,7 +96,7 @@ void testEOFUnsignedByte() throws IOException
9696
{
9797
dataStream.readUnsignedByte();
9898
dataStream.readUnsignedByte();
99-
assertThrows(EOFException.class, () -> dataStream.readUnsignedByte());
99+
assertThrows(EOFException.class, dataStream::readUnsignedByte);
100100
}
101101
}
102102
/**
@@ -112,7 +112,7 @@ void testDoubleClose() throws IOException
112112
RandomAccessReadDataStream randomAccessReadDataStream = new RandomAccessReadDataStream(
113113
randomAccessRead);
114114
randomAccessReadDataStream.close();
115-
assertDoesNotThrow(() -> randomAccessReadDataStream.close());
115+
assertDoesNotThrow(randomAccessReadDataStream::close);
116116
}
117117

118118
/**

io/src/test/java/org/apache/pdfbox/io/RandomAccessReadBufferTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void testSeekEOF() throws IOException
9595
assertEquals(-1, randomAccessSource.read(new byte[1], 0, 1));
9696

9797
randomAccessSource.close();
98-
Assertions.assertThrows(IOException.class, () -> randomAccessSource.read(),
98+
Assertions.assertThrows(IOException.class, randomAccessSource::read,
9999
"checkClosed should have thrown an IOException");
100100
}
101101

io/src/test/java/org/apache/pdfbox/io/RandomAccessReadBufferedFileTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void testSeekEOF() throws IOException, URISyntaxException
8282
assertEquals(-1, randomAccessSource.read(new byte[1], 0, 1));
8383

8484
randomAccessSource.close();
85-
Assertions.assertThrows(IOException.class, () -> randomAccessSource.read(),
85+
Assertions.assertThrows(IOException.class, randomAccessSource::read,
8686
"checkClosed should have thrown an IOException");
8787
}
8888

io/src/test/java/org/apache/pdfbox/io/RandomAccessReadMemoryMappedFileTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void testSeekEOF() throws IOException, URISyntaxException
9696
assertEquals(-1, randomAccessSource.read(new byte[1], 0, 1));
9797

9898
randomAccessSource.close();
99-
Assertions.assertThrows(IOException.class, () -> randomAccessSource.read(),
99+
Assertions.assertThrows(IOException.class, randomAccessSource::read,
100100
"checkClosed should have thrown an IOException");
101101
}
102102

io/src/test/java/org/apache/pdfbox/io/RandomAccessReadViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void testSeekEOF() throws IOException
9696
assertEquals(-1, randomAccessReadView.read(new byte[1], 0, 1));
9797
randomAccessReadView.close();
9898
}
99-
Assertions.assertThrows(IOException.class, () -> randomAccessReadView.read(),
99+
Assertions.assertThrows(IOException.class, randomAccessReadView::read,
100100
"checkClosed should have thrown an IOException");
101101
}
102102

io/src/test/java/org/apache/pdfbox/io/SequenceRandomAccessReadTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void TestEOF() throws IOException
194194
// closing a SequenceRandomAccessRead twice shouldn't be a problem
195195
sequenceRandomAccessRead.close();
196196

197-
assertThrows(IOException.class, () -> sequenceRandomAccessRead.read(),
197+
assertThrows(IOException.class, sequenceRandomAccessRead::read,
198198
"checkClosed should have thrown an IOException");
199199
}
200200

0 commit comments

Comments
 (0)