Author: davsclaus
Date: Sat Feb 14 09:35:44 2009
New Revision: 744442
URL: http://svn.apache.org/viewvc?rev=744442&view=rev
Log:
Polished code
Removed:
camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/builder/
Modified:
camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
Modified:
camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java?rev=744442&r1=744441&r2=744442&view=diff
==============================================================================
---
camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
(original)
+++
camel/trunk/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
Sat Feb 14 09:35:44 2009
@@ -101,7 +101,7 @@
ObjectHelper.notNull(type, "type");
try {
if (LOG.isDebugEnabled()) {
- LOG.debug("Evaluation " + expression + " for exchange: " +
exchange);
+ LOG.debug("Evaluation: " + expression + " for exchange: " +
exchange);
}
if (type.equals(String.class)) {
return (T) evaluateAsString(exchange);
@@ -120,7 +120,7 @@
public Object evaluate(Exchange exchange) {
try {
if (LOG.isDebugEnabled()) {
- LOG.debug("Evaluation " + expression + " for exchange: " +
exchange);
+ LOG.debug("Evaluation: " + expression + " for exchange: " +
exchange);
}
if (resultType != null) {
@@ -215,14 +215,17 @@
}
public void assertMatches(String text, Exchange exchange) throws
AssertionError {
+ List list;
+
try {
- List list = evaluateAsList(exchange);
- if (!matches(exchange, list)) {
- throw new AssertionError(this + " failed on " + exchange + "
as evaluated: " + list);
- }
+ list = evaluateAsList(exchange);
} catch (Exception e) {
throw new AssertionError(e);
}
+
+ if (!matches(exchange, list)) {
+ throw new AssertionError(this + " failed on " + exchange + " as
evaluated: " + list);
+ }
}
// Static helper methods
@@ -485,8 +488,8 @@
initialized.set(true);
}
- // let the configuration be accessible on the exchange as its shared
for this evaulation
- // and can be needed for 3rd part type converters or in some other
situations
+ // let the configuration be accessible on the exchange as its shared
for this evaluation
+ // and can be needed by 3rd party type converters or other situations
(camel-artixds)
exchange.setProperty("CamelSaxonConfiguration", configuration);
}