aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/healthmarketscience/jackcess
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess')
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java6
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java12
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java4
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java2
4 files changed, 9 insertions, 15 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java b/src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java
index 8e3802b..0ded048 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java
@@ -423,10 +423,8 @@ class CalculatedColumnUtil
buffer.put(intValBytes);
} catch(ArithmeticException e) {
- throw (IOException)
- new IOException(withErrorContext(
- "Numeric value '" + inValue + "' out of range"))
- .initCause(e);
+ throw new IOException(
+ withErrorContext("Numeric value '" + inValue + "' out of range"), e);
}
}
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
index de4d8e7..ff221a7 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
@@ -857,10 +857,8 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl>, DateTimeConte
// too big)
buffer.putLong(decVal.movePointRight(4).longValueExact());
} catch(ArithmeticException e) {
- throw (IOException)
- new IOException(withErrorContext(
- "Currency value '" + inValue + "' out of range"))
- .initCause(e);
+ throw new IOException(
+ withErrorContext("Currency value '" + inValue + "' out of range"), e);
}
}
@@ -933,10 +931,8 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl>, DateTimeConte
}
buffer.put(intValBytes);
} catch(ArithmeticException e) {
- throw (IOException)
- new IOException(withErrorContext(
- "Numeric value '" + inValue + "' out of range"))
- .initCause(e);
+ throw new IOException(
+ withErrorContext("Numeric value '" + inValue + "' out of range"), e);
}
}
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java
index 142fb1f..079613f 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java
@@ -45,7 +45,7 @@ public class SqlHelperImpl extends SqlHelper {
// note, start pos is 1-based
return b.getBytes(1L, (int)b.length());
} catch(SQLException e) {
- throw (IOException)(new IOException(e.getMessage())).initCause(e);
+ throw new IOException(e.getMessage(), e);
}
}
@@ -61,7 +61,7 @@ public class SqlHelperImpl extends SqlHelper {
// note, start pos is 1-based
return c.getSubString(1L, (int)c.length());
} catch(SQLException e) {
- throw (IOException)(new IOException(e.getMessage())).initCause(e);
+ throw new IOException(e.getMessage(), e);
}
}
diff --git a/src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java b/src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java
index b68e448..c4c3625 100644
--- a/src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java
+++ b/src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java
@@ -493,7 +493,7 @@ public class ImportUtil
return table.getName();
} catch(SQLException e) {
- throw (IOException)new IOException(e.getMessage()).initCause(e);
+ throw new IOException(e.getMessage(), e);
}
}