jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/3] jena git commit: Added suppressed exception.
Date Thu, 21 Jul 2016 12:43:25 GMT
Repository: jena
Updated Branches:
  refs/heads/master 902ddc074 -> 9d7e822ba


Added suppressed exception.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8cf096c2
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8cf096c2
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8cf096c2

Branch: refs/heads/master
Commit: 8cf096c2f9ca7bb0c03df5b97281264bf4193744
Parents: 902ddc0
Author: Andy Seaborne <andy@apache.org>
Authored: Thu Jul 21 12:37:44 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu Jul 21 12:38:21 2016 +0100

----------------------------------------------------------------------
 jena-arq/src/main/java/org/apache/jena/system/Txn.java | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/8cf096c2/jena-arq/src/main/java/org/apache/jena/system/Txn.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/system/Txn.java b/jena-arq/src/main/java/org/apache/jena/system/Txn.java
index c422fc4..5db5e6c 100644
--- a/jena-arq/src/main/java/org/apache/jena/system/Txn.java
+++ b/jena-arq/src/main/java/org/apache/jena/system/Txn.java
@@ -21,7 +21,6 @@ package org.apache.jena.system;
 import java.util.function.Supplier ;
 
 import org.apache.jena.query.ReadWrite ;
-import org.apache.jena.sparql.JenaTransactionException ;
 import org.apache.jena.sparql.core.Transactional ;
 
 /** Application utilities for transactions.
@@ -41,7 +40,7 @@ public class Txn {
             txn.begin(ReadWrite.READ) ;
         try { r.run() ; }
         catch (Throwable th) {
-            onThrowable(txn);
+            onThrowable(th, txn);
             throw th ;
         }
         if ( ! b )
@@ -59,7 +58,7 @@ public class Txn {
                 txn.end() ;
             return x ;
         } catch (Throwable th) {
-            onThrowable(txn);
+            onThrowable(th, txn);
             throw th ;
         }
     }
@@ -71,7 +70,7 @@ public class Txn {
             txn.begin(ReadWrite.WRITE) ;
         try { r.run() ; }
         catch (Throwable th) {
-            onThrowable(txn);
+            onThrowable(th, txn);
             throw th ;
         }
         if ( !b ) {
@@ -90,7 +89,7 @@ public class Txn {
         X x = null ;
         try { x = r.get() ; } 
         catch (Throwable th) {
-            onThrowable(txn);
+            onThrowable(th, txn);
             throw th ;
         }
         if ( !b ) {
@@ -103,10 +102,10 @@ public class Txn {
     }
     
     // Attempt some kind of cleanup.
-    private static <T extends Transactional> void onThrowable(T txn) {
+    private static <T extends Transactional> void onThrowable(Throwable th, T txn)
{
         try {
             txn.abort() ;
             txn.end() ;
-        } catch (JenaTransactionException ex) { }
+        } catch (Throwable th2) { th.addSuppressed(th2); }
     }
 }


Mime
View raw message