This is an automated email from the ASF dual-hosted git repository.

Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new fb26c76c7388 CAMEL-24579: DataFormat.marshal graph parameter should be 
@Nullable
fb26c76c7388 is described below

commit fb26c76c73888cc0e3f4abe640634e4615899273
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Sep 1 15:38:55 2026 +0200

    CAMEL-24579: DataFormat.marshal graph parameter should be @Nullable
---
 core/camel-api/src/main/java/org/apache/camel/spi/DataFormat.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/DataFormat.java 
b/core/camel-api/src/main/java/org/apache/camel/spi/DataFormat.java
index 013fa823fcc7..ebf732db125e 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/DataFormat.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/DataFormat.java
@@ -24,6 +24,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Service;
 import org.apache.camel.util.IOHelper;
+import org.jspecify.annotations.Nullable;
 
 /**
  * Pluggable strategy for converting message bodies to and from a serialised 
byte-stream format, as described in the
@@ -48,11 +49,13 @@ public interface DataFormat extends Service {
      * Marshals the object to the given Stream.
      *
      * @param  exchange  the current exchange
-     * @param  graph     the object to be marshalled
+     * @param  graph     the object to be marshalled, can be <tt>null</tt> if 
the message body is null (for example on
+     *                   an error route) or if the implementation marshals 
from the exchange rather than from this
+     *                   parameter
      * @param  stream    the output stream to write the marshalled result to
      * @throws Exception can be thrown
      */
-    void marshal(Exchange exchange, Object graph, OutputStream stream) throws 
Exception;
+    void marshal(Exchange exchange, @Nullable Object graph, OutputStream 
stream) throws Exception;
 
     /**
      * Unmarshals the given stream into an object.

Reply via email to