From cb9c8e3d8e67c2cc735a514d17fe07f8fea4624b Mon Sep 17 00:00:00 2001 From: Markus Spann Date: Fri, 16 Feb 2024 12:19:54 +0100 Subject: [PATCH] Remove redundant throws --- .../java/io/github/spannm/jackcess/Row.java | 2 +- .../jackcess/impl/CalculatedColumnUtil.java | 6 +- .../spannm/jackcess/impl/ColumnImpl.java | 6 +- .../impl/GeneralLegacyIndexCodes.java | 3 +- .../spannm/jackcess/impl/IndexData.java | 28 +++---- .../spannm/jackcess/impl/IndexImpl.java | 3 +- .../jackcess/impl/LongValueColumnImpl.java | 2 +- .../jackcess/impl/NumericColumnImpl.java | 2 +- .../github/spannm/jackcess/impl/RowImpl.java | 2 +- .../spannm/jackcess/impl/TableImpl.java | 5 +- .../spannm/jackcess/impl/TextColumnImpl.java | 2 +- .../jackcess/impl/UnsupportedColumnImpl.java | 2 +- .../github/spannm/jackcess/impl/UsageMap.java | 4 +- .../spannm/jackcess/util/ImportUtil.java | 81 +++++++++---------- .../github/spannm/jackcess/util/Joiner.java | 4 +- .../spannm/jackcess/util/MemFileChannel.java | 4 +- .../io/github/spannm/jackcess/CursorTest.java | 12 +-- .../io/github/spannm/jackcess/TableTest.java | 2 +- .../spannm/jackcess/impl/IndexCodesTest.java | 2 +- .../impl/expr/ExpressionatorTest.java | 2 +- .../spannm/jackcess/query/QueryTest.java | 2 +- 21 files changed, 81 insertions(+), 95 deletions(-) diff --git a/src/main/java/io/github/spannm/jackcess/Row.java b/src/main/java/io/github/spannm/jackcess/Row.java index 22a725b..00fe5aa 100644 --- a/src/main/java/io/github/spannm/jackcess/Row.java +++ b/src/main/java/io/github/spannm/jackcess/Row.java @@ -116,5 +116,5 @@ public interface Row extends Map { *

* Note, the OleBlob should be closed after use. */ - OleBlob getBlob(String name) throws IOException; + OleBlob getBlob(String name); } 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 ba8dedd..7307e0a 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java +++ b/src/main/java/io/github/spannm/jackcess/impl/CalculatedColumnUtil.java @@ -133,7 +133,7 @@ private static ByteBuffer prepareWrappedCalcValue(int dataLen, ByteOrder order) private static class CalcColImpl extends ColumnImpl { private CalcColEvalContext _calcCol; - CalcColImpl(InitArgs args) throws IOException { + CalcColImpl(InitArgs args) { super(args); } @@ -175,7 +175,7 @@ protected ByteBuffer writeRealData(Object obj, int remainingRowLength, private static class CalcBooleanColImpl extends ColumnImpl { private CalcColEvalContext _calcCol; - CalcBooleanColImpl(InitArgs args) throws IOException { + CalcBooleanColImpl(InitArgs args) { super(args); } @@ -241,7 +241,7 @@ protected int calcLengthInUnits() { } @Override - public Object read(byte[] data, ByteOrder order) throws IOException { + public Object read(byte[] data, ByteOrder order) { return decodeTextValue(unwrapCalculatedValue(data)); } diff --git a/src/main/java/io/github/spannm/jackcess/impl/ColumnImpl.java b/src/main/java/io/github/spannm/jackcess/impl/ColumnImpl.java index b59ec29..b15ad8e 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/ColumnImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/ColumnImpl.java @@ -1875,8 +1875,7 @@ public static boolean isRawData(Object value) { * * @param buffer Buffer to write to */ - protected static void writeDefinitions(TableCreator creator, ByteBuffer buffer) - throws IOException { + protected static void writeDefinitions(TableCreator creator, ByteBuffer buffer) { // we specifically put the "long variable" values after the normal // variable length values so that we have a better chance of fitting it // all (because "long variable" values can go in separate pages) @@ -1961,8 +1960,7 @@ protected static void writeDefinition( } protected static void writeColUsageMapDefinitions( - TableCreator creator, ByteBuffer buffer) - throws IOException { + TableCreator creator, ByteBuffer buffer) { // write long value column usage map references for (ColumnBuilder lvalCol : creator.getLongValueColumns()) { writeColUsageMapDefinition(creator, lvalCol, buffer); diff --git a/src/main/java/io/github/spannm/jackcess/impl/GeneralLegacyIndexCodes.java b/src/main/java/io/github/spannm/jackcess/impl/GeneralLegacyIndexCodes.java index b551fe8..f1e7880 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/GeneralLegacyIndexCodes.java +++ b/src/main/java/io/github/spannm/jackcess/impl/GeneralLegacyIndexCodes.java @@ -770,8 +770,7 @@ private static void writeUnprintableCodes( /** * Encode the given crazy code bytes into the given byte stream. */ - private static void writeCrazyCodes(ByteStream crazyCodes, ByteStream bout) - throws IOException { + private static void writeCrazyCodes(ByteStream crazyCodes, ByteStream bout) { // CRAZY_CODE_2 flags at the end are ignored, so ditch them trimExtraCodes(crazyCodes, CRAZY_CODE_2, CRAZY_CODE_2); diff --git a/src/main/java/io/github/spannm/jackcess/impl/IndexData.java b/src/main/java/io/github/spannm/jackcess/impl/IndexData.java index 4a334da..a220250 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/IndexData.java +++ b/src/main/java/io/github/spannm/jackcess/impl/IndexData.java @@ -1467,7 +1467,7 @@ public String toString() { * ColumnDescriptor for integer based columns. */ private static final class IntegerColumnDescriptor extends ColumnDescriptor { - private IntegerColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private IntegerColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1492,7 +1492,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for floating point based columns. */ private static final class FloatingPointColumnDescriptor extends ColumnDescriptor { - private FloatingPointColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private FloatingPointColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1525,7 +1525,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for fixed point based columns (legacy sort order). */ private static class LegacyFixedPointColumnDescriptor extends ColumnDescriptor { - private LegacyFixedPointColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private LegacyFixedPointColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1588,7 +1588,7 @@ protected void handleNegationAndOrder(boolean isNegative, byte[] valueBytes) { * ColumnDescriptor for byte based columns. */ private static final class ByteColumnDescriptor extends ColumnDescriptor { - private ByteColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private ByteColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1611,7 +1611,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for boolean columns. */ private static final class BooleanColumnDescriptor extends ColumnDescriptor { - private BooleanColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private BooleanColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1631,7 +1631,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) { * ColumnDescriptor for "general legacy" sort order text based columns. */ private static final class GenLegTextColumnDescriptor extends ColumnDescriptor { - private GenLegTextColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private GenLegTextColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1645,7 +1645,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for "general" sort order (2010+) text based columns. */ private static final class GenTextColumnDescriptor extends ColumnDescriptor { - private GenTextColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private GenTextColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1659,7 +1659,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for "general 97" sort order text based columns. */ private static final class Gen97TextColumnDescriptor extends ColumnDescriptor { - private Gen97TextColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private Gen97TextColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1673,7 +1673,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for guid columns. */ private static final class GuidColumnDescriptor extends ColumnDescriptor { - private GuidColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private GuidColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1687,7 +1687,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for BINARY columns. */ private static final class BinaryColumnDescriptor extends ColumnDescriptor { - private BinaryColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private BinaryColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1701,7 +1701,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for extended date/time based columns. */ private static final class ExtDateColumnDescriptor extends ColumnDescriptor { - private ExtDateColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private ExtDateColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1737,7 +1737,7 @@ protected void writeNonNullValue(Object value, ByteStream bout) throws IOExcepti * ColumnDescriptor for columns which we cannot currently write. */ private final class ReadOnlyColumnDescriptor extends ColumnDescriptor { - private ReadOnlyColumnDescriptor(ColumnImpl column, byte flags) throws IOException { + private ReadOnlyColumnDescriptor(ColumnImpl column, byte flags) { super(column, flags); } @@ -1784,7 +1784,7 @@ private Entry(byte[] entryBytes, RowIdImpl rowId) { /** * Read an existing entry in from a buffer */ - private Entry(ByteBuffer buffer, int entryLen) throws IOException { + private Entry(ByteBuffer buffer, int entryLen) { this(buffer, entryLen, 0); } @@ -1961,7 +1961,7 @@ private NodeEntry(byte[] entryBytes, RowIdImpl rowId, EntryType type, Integer su /** * Read an existing node entry in from a buffer */ - private NodeEntry(ByteBuffer buffer, int entryLen) throws IOException { + private NodeEntry(ByteBuffer buffer, int entryLen) { // we need 4 trailing bytes for the sub-page number super(buffer, entryLen, 4); diff --git a/src/main/java/io/github/spannm/jackcess/impl/IndexImpl.java b/src/main/java/io/github/spannm/jackcess/impl/IndexImpl.java index 9061c6a..8097470 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/IndexImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/IndexImpl.java @@ -364,8 +364,7 @@ public int compareTo(IndexImpl other) { * @param buffer Buffer to write to */ protected static void writeDefinitions( - TableCreator creator, ByteBuffer buffer) - throws IOException { + TableCreator creator, ByteBuffer buffer) { // write logical index information for (IndexBuilder idx : creator.getIndexes()) { writeDefinition(creator, idx, buffer); diff --git a/src/main/java/io/github/spannm/jackcess/impl/LongValueColumnImpl.java b/src/main/java/io/github/spannm/jackcess/impl/LongValueColumnImpl.java index 23986b6..7450e0b 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/LongValueColumnImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/LongValueColumnImpl.java @@ -50,7 +50,7 @@ class LongValueColumnImpl extends ColumnImpl { private LongValueBufferHolder _lvalBufferH; private int _maxLenInUnits = INVALID_LENGTH; - LongValueColumnImpl(InitArgs args) throws IOException { + LongValueColumnImpl(InitArgs args) { super(args); } diff --git a/src/main/java/io/github/spannm/jackcess/impl/NumericColumnImpl.java b/src/main/java/io/github/spannm/jackcess/impl/NumericColumnImpl.java index 690b68e..569ae57 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/NumericColumnImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/NumericColumnImpl.java @@ -29,7 +29,7 @@ class NumericColumnImpl extends ColumnImpl { /** Numeric scale */ private final byte _scale; - NumericColumnImpl(InitArgs args) throws IOException { + NumericColumnImpl(InitArgs args) { super(args); _precision = args.buffer.get( diff --git a/src/main/java/io/github/spannm/jackcess/impl/RowImpl.java b/src/main/java/io/github/spannm/jackcess/impl/RowImpl.java index f380eb3..bc8f7ab 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/RowImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/RowImpl.java @@ -121,7 +121,7 @@ public ComplexValueForeignKey getForeignKey(String name) { } @Override - public OleBlob getBlob(String name) throws IOException { + public OleBlob getBlob(String name) { byte[] bytes = getBytes(name); return bytes != null ? OleBlob.Builder.fromInternalData(bytes) : null; } diff --git a/src/main/java/io/github/spannm/jackcess/impl/TableImpl.java b/src/main/java/io/github/spannm/jackcess/impl/TableImpl.java index 5890d3f..6f849b9 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/TableImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/TableImpl.java @@ -3079,8 +3079,7 @@ boolean isThisTable(Identifier identifier) { * Returns {@code true} if a row of the given size will fit on the given data page, {@code false} otherwise. */ public static boolean rowFitsOnDataPage( - int rowLength, ByteBuffer dataPage, JetFormat format) - throws IOException { + int rowLength, ByteBuffer dataPage, JetFormat format) { int rowSpaceUsage = getRowSpaceUsage(rowLength, format); short freeSpaceInPage = dataPage.getShort(format.OFFSET_FREE_SPACE); int rowsOnPage = getRowsOnDataPage(dataPage, format); @@ -3305,7 +3304,7 @@ public Object[] getRowCacheValues() { return dupeRow(_rowValues, _rowValues.length); } - public NullMask getNullMask(ByteBuffer rowBuffer) throws IOException { + public NullMask getNullMask(ByteBuffer rowBuffer) { if (_nullMask == null) { _nullMask = getRowNullMask(rowBuffer); } diff --git a/src/main/java/io/github/spannm/jackcess/impl/TextColumnImpl.java b/src/main/java/io/github/spannm/jackcess/impl/TextColumnImpl.java index 723b08e..d974f8e 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/TextColumnImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/TextColumnImpl.java @@ -31,7 +31,7 @@ class TextColumnImpl extends ColumnImpl { /** the code page for a text field (for certain db versions) */ private final short _codePage; - TextColumnImpl(InitArgs args) throws IOException { + TextColumnImpl(InitArgs args) { super(args); // co-located w/ precision/scale diff --git a/src/main/java/io/github/spannm/jackcess/impl/UnsupportedColumnImpl.java b/src/main/java/io/github/spannm/jackcess/impl/UnsupportedColumnImpl.java index d13a784..2f93b15 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/UnsupportedColumnImpl.java +++ b/src/main/java/io/github/spannm/jackcess/impl/UnsupportedColumnImpl.java @@ -27,7 +27,7 @@ class UnsupportedColumnImpl extends ColumnImpl { private final byte _originalType; - UnsupportedColumnImpl(InitArgs args) throws IOException { + UnsupportedColumnImpl(InitArgs args) { super(args); _originalType = args.colType; } 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 a420461..7507c48 100644 --- a/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java +++ b/src/main/java/io/github/spannm/jackcess/impl/UsageMap.java @@ -584,7 +584,7 @@ protected final void moveToNewStartPage(int newStartPage, int newPageNumber) * should be called by PageChannel. */ private class GlobalInlineHandler extends InlineHandler { - private GlobalInlineHandler() throws IOException { + private GlobalInlineHandler() { } @Override @@ -774,7 +774,7 @@ private class GlobalReferenceHandler extends ReferenceHandler { private boolean _allocatingPage; private Integer _pendingPage; - private GlobalReferenceHandler() throws IOException { + private GlobalReferenceHandler() { } @Override diff --git a/src/main/java/io/github/spannm/jackcess/util/ImportUtil.java b/src/main/java/io/github/spannm/jackcess/util/ImportUtil.java index 4f41af0..3bf0cfa 100644 --- a/src/main/java/io/github/spannm/jackcess/util/ImportUtil.java +++ b/src/main/java/io/github/spannm/jackcess/util/ImportUtil.java @@ -388,60 +388,55 @@ public static String importReader(BufferedReader in, Database db, Pattern delimPat = Pattern.compile(delim); - try { - name = TableBuilder.escapeIdentifier(name); - Table table = null; - if (!useExistingTable || (table = db.getTable(name)) == null) { - - List columns = new ArrayList<>(); - Object[] columnNames = splitLine(line, delimPat, quote, in, 0); - - for (Object columnName : columnNames) { - columns.add(new ColumnBuilder((String) columnName, DataType.TEXT) - .escapeName() - .withLength((short) DataType.TEXT.getMaxSize()) - .toColumn()); - } + name = TableBuilder.escapeIdentifier(name); + Table table = null; + if (!useExistingTable || (table = db.getTable(name)) == null) { - table = createUniqueTable(db, name, columns, null, filter); + List columns = new ArrayList<>(); + Object[] columnNames = splitLine(line, delimPat, quote, in, 0); - // the first row was a header row - header = true; + for (Object columnName : columnNames) { + columns.add(new ColumnBuilder((String) columnName, DataType.TEXT) + .escapeName() + .withLength((short) DataType.TEXT.getMaxSize()) + .toColumn()); } - List rows = new ArrayList<>(COPY_TABLE_BATCH_SIZE); - int numColumns = table.getColumnCount(); + table = createUniqueTable(db, name, columns, null, filter); - if (!header) { - // first line is _not_ a header line - Object[] data = splitLine(line, delimPat, quote, in, numColumns); - data = filter.filterRow(data); - if (data != null) { - rows.add(data); - } - } + // the first row was a header row + header = true; + } - while ((line = in.readLine()) != null) { - Object[] data = splitLine(line, delimPat, quote, in, numColumns); - data = filter.filterRow(data); - if (data == null) { - continue; - } + List rows = new ArrayList<>(COPY_TABLE_BATCH_SIZE); + int numColumns = table.getColumnCount(); + + if (!header) { + // first line is _not_ a header line + Object[] data = splitLine(line, delimPat, quote, in, numColumns); + data = filter.filterRow(data); + if (data != null) { rows.add(data); - if (rows.size() == COPY_TABLE_BATCH_SIZE) { - table.addRows(rows); - rows.clear(); - } } - if (!rows.isEmpty()) { + } + + while ((line = in.readLine()) != null) { + Object[] data = splitLine(line, delimPat, quote, in, numColumns); + data = filter.filterRow(data); + if (data == null) { + continue; + } + rows.add(data); + if (rows.size() == COPY_TABLE_BATCH_SIZE) { table.addRows(rows); + rows.clear(); } - - return table.getName(); - - } catch (SQLException e) { - throw new IOException(e.getMessage(), e); } + if (!rows.isEmpty()) { + table.addRows(rows); + } + + return table.getName(); } /** diff --git a/src/main/java/io/github/spannm/jackcess/util/Joiner.java b/src/main/java/io/github/spannm/jackcess/util/Joiner.java index 92df244..a9a3c4d 100644 --- a/src/main/java/io/github/spannm/jackcess/util/Joiner.java +++ b/src/main/java/io/github/spannm/jackcess/util/Joiner.java @@ -170,7 +170,7 @@ public EntryIterableBuilder findRows(Object[] fromRow) { * @param fromRow row from the "from" table (which must include the relevant columns for this join relationship) * @return {@code true} if any "to" rows were deleted, {@code false} otherwise */ - public boolean deleteRows(Map fromRow) throws IOException { + public boolean deleteRows(Map fromRow) { return deleteRowsImpl(findRows(fromRow).withColumnNames(Set.of()).iterator()); } @@ -180,7 +180,7 @@ public boolean deleteRows(Map fromRow) throws IOException { * @param fromRow row from the "from" table (which must include the relevant columns for this join relationship) * @return {@code true} if any "to" rows were deleted, {@code false} otherwise */ - public boolean deleteRows(Object[] fromRow) throws IOException { + public boolean deleteRows(Object[] fromRow) { return deleteRowsImpl(findRows(fromRow).withColumnNames(Set.of()).iterator()); } diff --git a/src/main/java/io/github/spannm/jackcess/util/MemFileChannel.java b/src/main/java/io/github/spannm/jackcess/util/MemFileChannel.java index 0bb0eac..9ccbe86 100644 --- a/src/main/java/io/github/spannm/jackcess/util/MemFileChannel.java +++ b/src/main/java/io/github/spannm/jackcess/util/MemFileChannel.java @@ -164,7 +164,7 @@ public static MemFileChannel newChannel(ReadableByteChannel in, String mode) thr } @Override - public int read(ByteBuffer dst) throws IOException { + public int read(ByteBuffer dst) { int bytesRead = read(dst, _position); if (bytesRead > 0) { _position += bytesRead; @@ -194,7 +194,7 @@ public int read(ByteBuffer dst, long position) { } @Override - public int write(ByteBuffer src) throws IOException { + public int write(ByteBuffer src) { int bytesWritten = write(src, _position); _position += bytesWritten; return bytesWritten; diff --git a/src/test/java/io/github/spannm/jackcess/CursorTest.java b/src/test/java/io/github/spannm/jackcess/CursorTest.java index a2dc609..cabdeb7 100644 --- a/src/test/java/io/github/spannm/jackcess/CursorTest.java +++ b/src/test/java/io/github/spannm/jackcess/CursorTest.java @@ -68,8 +68,7 @@ private static List> createTestTableData() { private static List> createTestTableData( int startIdx, - int endIdx) - throws Exception { + int endIdx) { List> expectedRows = createTestTableData(); expectedRows.subList(endIdx, expectedRows.size()).clear(); expectedRows.subList(0, startIdx).clear(); @@ -197,8 +196,7 @@ public void testSimple() throws Exception { } private static void doTestSimple(Cursor cursor, - List> expectedRows) - throws Exception { + List> expectedRows) { if (expectedRows == null) { expectedRows = createTestTableData(); } @@ -281,8 +279,7 @@ public void testMoveNoReset() throws Exception { } } - private static void doTestMoveNoReset(Cursor cursor) - throws Exception { + private static void doTestMoveNoReset(Cursor cursor) { List> expectedRows = createTestTableData(); List> foundRows = new ArrayList<>(); @@ -407,8 +404,7 @@ public void testReverse() throws Exception { } private static void doTestReverse(Cursor cursor, - List> expectedRows) - throws Exception { + List> expectedRows) { if (expectedRows == null) { expectedRows = createTestTableData(); } diff --git a/src/test/java/io/github/spannm/jackcess/TableTest.java b/src/test/java/io/github/spannm/jackcess/TableTest.java index e0d10f2..1652826 100644 --- a/src/test/java/io/github/spannm/jackcess/TableTest.java +++ b/src/test/java/io/github/spannm/jackcess/TableTest.java @@ -199,7 +199,7 @@ public boolean isCompressedUnicode() { } private class TestTable extends TableImpl { - private TestTable() throws IOException { + private TestTable() { super(true, _columns); } diff --git a/src/test/java/io/github/spannm/jackcess/impl/IndexCodesTest.java b/src/test/java/io/github/spannm/jackcess/impl/IndexCodesTest.java index 38b3518..f0b257e 100644 --- a/src/test/java/io/github/spannm/jackcess/impl/IndexCodesTest.java +++ b/src/test/java/io/github/spannm/jackcess/impl/IndexCodesTest.java @@ -672,7 +672,7 @@ private static void handleInternational2Entry(String inlineCodes, String entryCo } } - public static String toUnicodeStr(Object obj) throws Exception { + public static String toUnicodeStr(Object obj) { StringBuilder sb = new StringBuilder(); for (char c : obj.toString().toCharArray()) { sb.append(toUnicodeStr(c)).append(' '); 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 68608af..74b734e 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 @@ -48,7 +48,7 @@ public ExpressionatorTest(String name) { super(name); } - public void testParseSimpleExprs() throws Exception { + public void testParseSimpleExprs() { validateExpr("\"A\"", "{\"A\"}"); validateExpr("13", "{13}"); 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 9a123e2..8eefc61 100644 --- a/src/test/java/io/github/spannm/jackcess/query/QueryTest.java +++ b/src/test/java/io/github/spannm/jackcess/query/QueryTest.java @@ -120,7 +120,7 @@ public void testUpdateQuery() { query.toSQLString()); } - public void testSelectQuery() throws Exception { + public void testSelectQuery() { SelectQuery query = (SelectQuery) newQuery( Query.Type.SELECT, newRow(TABLE_ATTRIBUTE, null, "Table1", null));