Author: bvahdat
Date: Mon Mar 5 08:04:35 2012
New Revision: 1296954
URL: http://svn.apache.org/viewvc?rev=1296954&view=rev
Log:
CAMEL-4797: Relaxed the restriction about DataFormat not being allowed to
return null, as an example SoapJaxbDataFormat does that.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnmarshalProcessor.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/DataFormat.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnmarshalProcessor.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnmarshalProcessor.java?rev=1296954&r1=1296953&r2=1296954&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnmarshalProcessor.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnmarshalProcessor.java
Mon Mar 5 08:04:35 2012
@@ -62,15 +62,9 @@ public class UnmarshalProcessor extends
throw new RuntimeCamelException("The returned exchange " +
result + " is not the same as " + exchange + " provided to the DataFormat");
}
} else if (result instanceof Message) {
- Message message = (Message) result;
-
- // message body should be already set properly by the
dataFormat
- ObjectHelper.notNull(message.getBody(), "body", message);
-
// the dataformat has probably set headers, attachments, etc.
so let's use it as the outbound payload
exchange.setOut((Message) result);
} else {
- ObjectHelper.notNull(result, "result");
out.setBody(result);
}
} catch (Exception e) {
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/DataFormat.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/DataFormat.java?rev=1296954&r1=1296953&r2=1296954&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/DataFormat.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/DataFormat.java
Mon Mar 5 08:04:35 2012
@@ -56,7 +56,7 @@ public interface DataFormat {
* @param exchange the current exchange
* @param stream the input stream with the object to be unmarshalled
* @return the unmarshalled object
- * @throws Exception can be thrown, for example when the body of the OUT
message becomes <tt>null</tt>
+ * @throws Exception can be thrown
*/
Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}