]> source.dussan.org Git - jackcess.git/commitdiff
no longer need to use initCause modules
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 20 Jan 2021 22:22:21 +0000 (22:22 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 20 Jan 2021 22:22:21 +0000 (22:22 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/modules@1355 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/CalculatedColumnUtil.java
src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java
src/main/java/com/healthmarketscience/jackcess/impl/SqlHelperImpl.java
src/main/java/com/healthmarketscience/jackcess/util/ImportUtil.java

index 8e3802bef298be9ed576f3ebb36b8165788690c4..0ded048239375d2317724ad0ea2a007fdaebc1ef 100644 (file)
@@ -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);
       }
     }
 
index de4d8e7bb676c15a23f8823be6bb91877826754f..ff221a7379722883b39951b7876db76a00627b70 100644 (file)
@@ -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);
     }
   }
 
index 142fb1fe9df6ff1d5e64575945e0bfb8483c1624..079613f20f1c4bd6e9eb3cb7b12a4229d9e0ba69 100644 (file)
@@ -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);
     }
   }
 
index b68e448864d240e68add517ad1b028526bc1c16d..c4c36255a87d7b0ca18b60bc9bbf2b72bd78d6b9 100644 (file)
@@ -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);
     }
   }