db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r736017 - in /db/derby/code/trunk/java/engine/org/apache/derby/iapi: error/PassThroughException.java services/context/ContextManager.java
Date Tue, 20 Jan 2009 13:26:31 GMT
Author: kahatlen
Date: Tue Jan 20 05:26:31 2009
New Revision: 736017

URL: http://svn.apache.org/viewvc?rev=736017&view=rev
Log:
DERBY-4010: PassThroughException should not reimplement initCause()/getCause()

Removed getException() method in PassThroughException and let the
callers use getCause() instead.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PassThroughException.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PassThroughException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PassThroughException.java?rev=736017&r1=736016&r2=736017&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PassThroughException.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PassThroughException.java
Tue Jan 20 05:26:31 2009
@@ -21,16 +21,21 @@
 
 package org.apache.derby.iapi.error;
 
+/**
+ * Unchecked exception class that can be used to pass checked exceptions out
+ * of methods that are not declared to throw any checked exception.
+ */
 public final class PassThroughException extends RuntimeException {
 
-	private final Exception nested;
+    /**
+     * Wrap a {@code Throwable} in this unchecked exception to allow it
+     * to pass through methods that are not declared to raise this kind of
+     * condition.
+     *
+     * @param cause the {@code Throwable} to pass through
+     */
+    public PassThroughException(Throwable cause) {
+        super(cause);
+    }
 
-	public PassThroughException(Exception e) {
-		super(e.getMessage());
-		nested = e;
-	}
-
-	public Exception getException() {
-		return nested;
-	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java?rev=736017&r1=736016&r2=736017&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
Tue Jan 20 05:26:31 2009
@@ -251,8 +251,9 @@
 		if (error instanceof ThreadDeath)
 			seenThreadDeath = (ThreadDeath) error;
 
-		if (error instanceof PassThroughException)
-			error = ((PassThroughException) error).getException();
+        if (error instanceof PassThroughException) {
+            error = error.getCause();
+        }
 
 		boolean reportError = reportError(error);
 



Mime
View raw message