db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r531825 - /db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
Date Tue, 24 Apr 2007 08:18:20 GMT
Author: kahatlen
Date: Tue Apr 24 01:18:19 2007
New Revision: 531825

URL: http://svn.apache.org/viewvc?view=rev&rev=531825
Log:
DERBY-2580: SanityManager.THROWASSERT(String,Throwable) ignores message argument

Use message argument and rewrite the one-arg THROWASSERT methods to use
the 2-arg method.

Modified:
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java?view=diff&rev=531825&r1=531824&r2=531825
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/sanity/SanityManager.java
Tue Apr 24 01:18:19 2007
@@ -144,16 +144,7 @@
 		// XXX (nat) Hmm, should we check ASSERT here?  The caller is
 		// not expecting this function to return, whether assertions
 		// are compiled in or not.
-
-		if (DEBUG) {
-			AssertFailure af = new AssertFailure("ASSERT FAILED " + msgIfFail);
-			if (DEBUG_ON("AssertFailureTrace")) {
-				showTrace(af);
-			}
-			throw af;
-		}
-		else
-			throw new AssertFailure("ASSERT FAILED " + msgIfFail);
+		THROWASSERT(msgIfFail, null);
 	}
 
 	/**
@@ -168,19 +159,16 @@
 	 * @see org.apache.derby.iapi.services.sanity.AssertFailure
 	 */
 	public static final void THROWASSERT(String msg, Throwable t) {
-
+		AssertFailure af = new AssertFailure("ASSERT FAILED " + msg, t);
 		if (DEBUG) {
-			AssertFailure af = new AssertFailure("ASSERT FAILED " + t.toString(), t);
 			if (DEBUG_ON("AssertFailureTrace")) {
 				showTrace(af);
 			}
-			showTrace(t);
-			throw af;
 		}
-		else {
+		if (t != null) {
 			showTrace(t);
-			throw new AssertFailure("ASSERT FAILED " + t.toString(), t);
 		}
+		throw af;
 	}
 
 	/**
@@ -192,19 +180,7 @@
 	 * @see org.apache.derby.iapi.services.sanity.AssertFailure
 	 */
 	public static final void THROWASSERT(Throwable t) {
-
-		if (DEBUG) {
-			AssertFailure af = new AssertFailure("ASSERT FAILED " + t.toString(), t);
-			if (DEBUG_ON("AssertFailureTrace")) {
-				showTrace(af);
-			}
-			showTrace(t);
-			throw af;
-		}
-		else {
-			showTrace(t);
-			throw new AssertFailure("ASSERT FAILED " + t.toString(), t);
-		}
+		THROWASSERT(t.toString(), t);
 	}
 
 	/**



Mime
View raw message