db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1616807 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode: Conditional.java Type.java
Date Fri, 08 Aug 2014 15:43:53 GMT
Author: dag
Date: Fri Aug  8 15:43:53 2014
New Revision: 1616807

URL: http://svn.apache.org/r1616807
Log:
DERBY-6699 Error in PredicatePushdownTest.test_predicatePushdown

Patch derby-6699-diagnostics makes the sane build print information about the contents
of the two stacks when the ASSERT fails. Since this error is intermittent it may
help debug the issue.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Conditional.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Type.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Conditional.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Conditional.java?rev=1616807&r1=1616806&r2=1616807&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Conditional.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Conditional.java
Fri Aug  8 15:43:53 2014
@@ -206,10 +206,27 @@ class Conditional {
 		
 		if (SanityManager.DEBUG)
 		{
-			if (stackNumber != stack.length)
-				SanityManager.THROWASSERT("ByteCode Conditional then/else stack depths differ then:"
+			if (stackNumber != stack.length) {
+                StringBuilder sb = new StringBuilder();
+                
+                sb.append("ByteCode Conditional then/else stack depths differ then:"
 						+ stack.length + " else: " + stackNumber);
-			
+                sb.append("\nif stack:\n");
+                
+                for (Type t: stack) {
+                    sb.append(t);
+                    sb.append('\n');
+                }
+                sb.append("else stack:\n");
+                
+                for (int i = 0; i < stackNumber; i++) {
+                    Type t = elseStack[i];
+                    sb.append(t);
+                    sb.append('\n');
+                }
+				SanityManager.THROWASSERT(sb.toString());
+            }
+            
 			for (int i = 0; i < stackNumber; i++)
 			{
 				if (stack[i].vmType() != elseStack[i].vmType()) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Type.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Type.java?rev=1616807&r1=1616806&r2=1616807&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Type.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/Type.java Fri
Aug  8 15:43:53 2014
@@ -47,6 +47,21 @@ final class Type {
 		vmNameSimple = ClassHolder.convertToInternalClassName(javaName);
 	}
 
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("[");
+        sb.append(javaName);
+        sb.append(", ");
+        sb.append(vmType);
+        sb.append(", ");
+        sb.append(vmName);
+        sb.append(", ");
+        sb.append(vmNameSimple);
+        sb.append("]");
+        
+        return sb.toString();
+    }
 	/*
 	** Class specific methods.
 	*/



Mime
View raw message