This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 b709779c8533 CAMEL-24296: document the setObjectInputFilter
IllegalStateException gotcha in the upgrade guide (#25401)
b709779c8533 is described below
commit b709779c85335374cc535c9463c7e2138479ea2e
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri Aug 7 11:17:07 2026 +0200
CAMEL-24296: document the setObjectInputFilter IllegalStateException gotcha
in the upgrade guide (#25401)
Per review: the 2-arg CamelObjectInputStream constructor now always
installs a
filter, so a subsequent setObjectInputFilter() call throws
IllegalStateException
on JDK 17+. Note the backward-compat change and recommend the 3-arg
constructor.
Signed-off-by: Andrea Cosentino <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
---
.../user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
index 5a33f71296dc..1c4c03497e19 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
@@ -78,6 +78,12 @@ allow-list must pass an explicit filter pattern to the new
`CamelObjectInputStream(InputStream, CamelContext, String)` constructor (or
configure
`jdk.serialFilter`) to permit them.
+Because the two-argument `CamelObjectInputStream(InputStream, CamelContext)`
constructor now always
+installs a filter, calling `setObjectInputFilter()` on the resulting stream
throws
+`IllegalStateException` ("filter can not be set more than once") on JDK 17+.
Downstream code that
+previously constructed the stream and then set a filter separately should pass
the pattern to the
+new `CamelObjectInputStream(InputStream, CamelContext, String)` constructor
instead.
+
==== Attachments preserved when a producer creates a fresh OUT message
Since Camel 4.10.1, message attachments were silently lost when a producer
(such as `camel-http`)