brett 2004/02/07 13:48:48
Modified: src/java/org/apache/maven/jelly Tag: MAVEN-1_0-BRANCH
JellyUtils.java
Log:
add back useful debugging function
Revision Changes Path
No revision
No revision
1.16.4.4 +30 -1 maven/src/java/org/apache/maven/jelly/JellyUtils.java
Index: JellyUtils.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/JellyUtils.java,v
retrieving revision 1.16.4.3
retrieving revision 1.16.4.4
diff -u -r1.16.4.3 -r1.16.4.4
--- JellyUtils.java 26 Jan 2004 23:36:08 -0000 1.16.4.3
+++ JellyUtils.java 7 Feb 2004 21:48:48 -0000 1.16.4.4
@@ -71,6 +71,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
+import java.util.Iterator;
/**
* Utilities for Jelly.
@@ -245,4 +246,32 @@
return expression;
}
+
+ /**
+ * Debugging function to show the differences between two Jelly contexts. .
+ * @param ctx1
+ * @param ctx2
+ */
+ public static void compareContexts( MavenJellyContext ctx1, MavenJellyContext
ctx2 )
+ {
+ System.out.println( "======== compare contexts ========" );
+ for ( Iterator i = ctx1.getVariableNames(); i.hasNext(); )
+ {
+ String name = ( String ) i.next();
+ if ( ctx2.getVariable( name ) == null )
+ {
+ System.out.println( name + " not in ctx2" );
+ }
+ else
+ {
+ if ( !ctx2.getVariable( name ).equals( ctx1.getVariable( name ) ) )
+ {
+ System.out.println( name + " doesn't match: '" +
ctx1.getVariable( name ) + "' vs '"
+ + ctx2.getVariable( name ) + "'" );
+ }
+ }
+ }
+ System.out.println( "======== comparison done ========" );
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]