diff --git a/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java b/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java index 2a184f9..ec7b46b 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java +++ b/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java @@ -57,7 +57,7 @@ private CalculatedColumnUtil() { * * @param args column construction info */ - static ColumnImpl create(ColumnImpl.InitArgs args) throws IOException { + static ColumnImpl create(ColumnImpl.InitArgs args) { switch (args.type) { case BOOLEAN: return new CalcBooleanColImpl(args); diff --git a/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java b/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java index 5c05734..2aecdc8 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java +++ b/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java @@ -678,11 +678,9 @@ private ReferenceHandler() throws IOException { // extra page reference on top of the number of page references that fit // in the table for (int i = 0; i < numUsagePages; i++) { - int mapPageNum = getTableBuffer().getInt( - calculateMapPagePointerOffset(i)); + int mapPageNum = getTableBuffer().getInt(calculateMapPagePointerOffset(i)); if (mapPageNum > 0) { - ByteBuffer mapPageBuffer = - _mapPageHolder.withPage(getPageChannel(), mapPageNum); + ByteBuffer mapPageBuffer = _mapPageHolder.withPage(getPageChannel(), mapPageNum); byte pageType = mapPageBuffer.get(); if (pageType != PageTypes.USAGE_MAP) { throw new IOException("Looking for usage map at page " + mapPageNum + ", but page type is " + pageType); diff --git a/src/test/java/io/github/spannm/jackcess/DatabaseTest.java b/src/test/java/io/github/spannm/jackcess/DatabaseTest.java index 6b427ea..9a1acce 100644 --- a/src/test/java/io/github/spannm/jackcess/DatabaseTest.java +++ b/src/test/java/io/github/spannm/jackcess/DatabaseTest.java @@ -267,7 +267,7 @@ void testDeleteRow(FileFormat fileFormat) throws Exception { } @Test - void testMissingFile() throws Exception { + void testMissingFile() { File bogusFile = new File("fooby-dooby.mdb"); assertFalse(bogusFile.exists()); DatabaseBuilder dbb = DatabaseBuilder.newDatabase(bogusFile).withReadOnly(true).withAutoSync(getTestAutoSync()); diff --git a/src/test/java/io/github/spannm/jackcess/impl/FKEnforcerTest.java b/src/test/java/io/github/spannm/jackcess/impl/FKEnforcerTest.java index a1f7f20..0d9855a 100644 --- a/src/test/java/io/github/spannm/jackcess/impl/FKEnforcerTest.java +++ b/src/test/java/io/github/spannm/jackcess/impl/FKEnforcerTest.java @@ -78,9 +78,9 @@ void testEnforceForeignKeys(TestDb testDb) throws Exception { c.moveToNextRow(); c.deleteCurrentRow(); }, "Table3[id]"); - tests.entrySet().forEach(e -> { - IOException ex = assertThrows(IOException.class, e.getKey()); - assertTrue(ex.getMessage().contains(e.getValue())); + tests.forEach((key, value) -> { + IOException ex = assertThrows(IOException.class, key); + assertTrue(ex.getMessage().contains(value)); }); diff --git a/src/test/java/io/github/spannm/jackcess/impl/expr/DefaultFunctionsTest.java b/src/test/java/io/github/spannm/jackcess/impl/expr/DefaultFunctionsTest.java index 722669f..7bcaf55 100644 --- a/src/test/java/io/github/spannm/jackcess/impl/expr/DefaultFunctionsTest.java +++ b/src/test/java/io/github/spannm/jackcess/impl/expr/DefaultFunctionsTest.java @@ -926,7 +926,7 @@ static Object eval(String _expr) { String[] testValues() default {}; - static class CustomFormatArgumentsProvider implements ArgumentsProvider { + class CustomFormatArgumentsProvider implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext context) { return context.getElement().map(elem -> AnnotationSupport.findRepeatableAnnotations(elem, CustomFormatSource.class)).orElse(List.of()).stream() diff --git a/src/test/java/io/github/spannm/jackcess/impl/expr/ExpressionatorTest.java b/src/test/java/io/github/spannm/jackcess/impl/expr/ExpressionatorTest.java index 3edd8eb..49f49e2 100644 --- a/src/test/java/io/github/spannm/jackcess/impl/expr/ExpressionatorTest.java +++ b/src/test/java/io/github/spannm/jackcess/impl/expr/ExpressionatorTest.java @@ -501,7 +501,7 @@ void testLiteralDefaultValue() { "DEFAULT_VALUE; TEXT; '+P-E'", "FIELD_VALIDATOR; TEXT; Is Not Null" }) - void testParseSomeExprs(Expressionator.Type _type, DataType _dType, String _exprStr) throws Exception { + void testParseSomeExprs(Expressionator.Type _type, DataType _dType, String _exprStr) { TestContext tc = new TestContext() { @Override public Value getThisColumnValue() { diff --git a/src/test/java/io/github/spannm/jackcess/query/QueryTest.java b/src/test/java/io/github/spannm/jackcess/query/QueryTest.java index b5573e0..80f1f8f 100644 --- a/src/test/java/io/github/spannm/jackcess/query/QueryTest.java +++ b/src/test/java/io/github/spannm/jackcess/query/QueryTest.java @@ -68,7 +68,7 @@ void testUnionQuery() { removeRows(query, TABLE_ATTRIBUTE); - assertThrows(IllegalStateException.class, () -> query.toSQLString()); + assertThrows(IllegalStateException.class, query::toSQLString); } @Test diff --git a/src/test/java/io/github/spannm/jackcess/test/TestUtil.java b/src/test/java/io/github/spannm/jackcess/test/TestUtil.java index 87c6cd1..475a3e7 100644 --- a/src/test/java/io/github/spannm/jackcess/test/TestUtil.java +++ b/src/test/java/io/github/spannm/jackcess/test/TestUtil.java @@ -338,7 +338,7 @@ static String getCurrentUser() { .findFirst().orElse(null); } - public static final File getTestTempDir() { + public static File getTestTempDir() { return TEST_TEMP_DIR; } diff --git a/src/test/java/io/github/spannm/jackcess/test/source/FileFormatSource.java b/src/test/java/io/github/spannm/jackcess/test/source/FileFormatSource.java index 1878018..9617a2a 100644 --- a/src/test/java/io/github/spannm/jackcess/test/source/FileFormatSource.java +++ b/src/test/java/io/github/spannm/jackcess/test/source/FileFormatSource.java @@ -39,7 +39,7 @@ */ String[] exclude() default {}; - static class FileFormatArgumentsProvider implements ArgumentsProvider { + class FileFormatArgumentsProvider implements ArgumentsProvider { /** * Defines currently supported database file formats that are neither read-only nor {@value FileFormat#MSISAM} (MS Money). diff --git a/src/test/java/io/github/spannm/jackcess/test/source/IntMatrixSource.java b/src/test/java/io/github/spannm/jackcess/test/source/IntMatrixSource.java index 77f8c79..09693a1 100644 --- a/src/test/java/io/github/spannm/jackcess/test/source/IntMatrixSource.java +++ b/src/test/java/io/github/spannm/jackcess/test/source/IntMatrixSource.java @@ -42,7 +42,7 @@ */ boolean endInclusive() default false; - static class IntMatrixArgumentsProvider implements ArgumentsProvider { + class IntMatrixArgumentsProvider implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext context) { diff --git a/src/test/java/io/github/spannm/jackcess/test/source/IntRangeSource.java b/src/test/java/io/github/spannm/jackcess/test/source/IntRangeSource.java index 47a48c5..deb4322 100644 --- a/src/test/java/io/github/spannm/jackcess/test/source/IntRangeSource.java +++ b/src/test/java/io/github/spannm/jackcess/test/source/IntRangeSource.java @@ -41,7 +41,7 @@ */ boolean endInclusive() default false; - static class IntRangeArgumentsProvider implements ArgumentsProvider { + class IntRangeArgumentsProvider implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext context) { diff --git a/src/test/java/io/github/spannm/jackcess/test/source/TestDbReadOnlySource.java b/src/test/java/io/github/spannm/jackcess/test/source/TestDbReadOnlySource.java index 52e26f8..9d0a6be 100644 --- a/src/test/java/io/github/spannm/jackcess/test/source/TestDbReadOnlySource.java +++ b/src/test/java/io/github/spannm/jackcess/test/source/TestDbReadOnlySource.java @@ -30,9 +30,9 @@ */ Basename value(); - static class ReadOnlyTestDbArgumentsProvider implements ArgumentsProvider { + class ReadOnlyTestDbArgumentsProvider implements ArgumentsProvider { @Override - public Stream provideArguments(ExtensionContext _context) throws Exception { + public Stream provideArguments(ExtensionContext _context) { TestDbReadOnlySource src = _context.getElement().map(elem -> AnnotationSupport.findAnnotation(elem, TestDbReadOnlySource.class).get()).orElse(null); return src == null ? Stream.empty() : TestDbArgumentsProvider.getDbs(src.value(), FileFormat.values()).stream().map(Arguments::of); } diff --git a/src/test/java/io/github/spannm/jackcess/test/source/TestDbSource.java b/src/test/java/io/github/spannm/jackcess/test/source/TestDbSource.java index 2999c9d..aeeff8f 100644 --- a/src/test/java/io/github/spannm/jackcess/test/source/TestDbSource.java +++ b/src/test/java/io/github/spannm/jackcess/test/source/TestDbSource.java @@ -40,7 +40,7 @@ */ Basename value(); - static class TestDbArgumentsProvider implements ArgumentsProvider { + class TestDbArgumentsProvider implements ArgumentsProvider { /** Charset for access 97 databases. */ private static final Charset ACC97_CHARSET = Charset.forName("windows-1252"); @@ -92,7 +92,7 @@ static List getDbs(Basename _basename, FileFormat[] _fileFormats) { } @Override - public Stream provideArguments(ExtensionContext _context) throws Exception { + public Stream provideArguments(ExtensionContext _context) { TestDbSource src = _context.getElement().map(elem -> AnnotationSupport.findAnnotation(elem, TestDbSource.class).get()).orElse(null); return src == null ? Stream.empty() : getDbs(src.value(), FILE_FORMATS_WRITE).stream().map(Arguments::of); }