Updated Branches: refs/heads/master 46a43b371 -> b5902106e
Polished the code base of the new Camel Weather component. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b5902106 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b5902106 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b5902106 Branch: refs/heads/master Commit: b5902106e9b6f85c216e9e788845b2ab4941d5ee Parents: 46a43b3 Author: Babak Vahdat <bvah...@apache.org> Authored: Tue May 28 07:55:12 2013 +0200 Committer: Babak Vahdat <bvah...@apache.org> Committed: Tue May 28 07:55:12 2013 +0200 ---------------------------------------------------------------------- .../camel/component/weather/WeatherConsumer.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b5902106/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConsumer.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConsumer.java index d8a906f..d4a36cb 100644 --- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConsumer.java +++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConsumer.java @@ -38,14 +38,14 @@ public class WeatherConsumer extends ScheduledPollConsumer { @Override protected int poll() throws Exception { LOG.debug("Going to execute the query '{}'", query); - String answer = getEndpoint().getCamelContext().getTypeConverter().mandatoryConvertTo(String.class, new URL(query)); - LOG.debug("Got back the answer '{}'", answer); - if (ObjectHelper.isEmpty(answer)) { - throw new IllegalStateException("Got the empty string '" + answer + "' as the result of the query '" + query + "'"); + String weather = getEndpoint().getCamelContext().getTypeConverter().mandatoryConvertTo(String.class, new URL(query)); + LOG.debug("Got back the answer '{}'", weather); + if (ObjectHelper.isEmpty(weather)) { + throw new IllegalStateException("Got the empty string '" + weather + "' as the result of the query '" + query + "'"); } Exchange exchange = getEndpoint().createExchange(); - exchange.getIn().setBody(answer); + exchange.getIn().setBody(weather); exchange.getIn().setHeader(WeatherConstants.WEATHER_QUERY, query); getProcessor().process(exchange);