gnodet-bot commented on code in PR #30238:
URL: https://github.com/apache/camel/pull/30238#discussion_r4591607254


##########
core/camel-core-model/src/main/java/org/apache/camel/model/RemoveHeadersDefinition.java:
##########
@@ -108,6 +110,8 @@ public String[] getExcludePatterns() {
 
     public void setExcludePatterns(String[] excludePatterns) {
         this.excludePatterns = excludePatterns;
+        // XML and YAML have only the excludePattern option: it holds them 
too, so a dumped route keeps them
+        this.excludePattern = PatternHelper.combinePatterns(excludePatterns);

Review Comment:
   After this change, `setExcludePatterns` always sets both `excludePatterns` 
and `excludePattern`. This makes 
`JavaDslModelWriterSupport.rewriteFromJavaForms` (the guard 
`r.getExcludePattern() == null && r.getExcludePatterns() != null`) permanently 
unreachable — that check can never be true anymore. The Java-DSL-to-Java-dump 
round-trip now always produces the single-string form (`removeHeaders("*", 
"h1|Camel.*")`) rather than the original varargs form. Functionally correct, 
but the dead branch in `JavaDslModelWriterSupport` should be removed or updated 
to reflect the new invariant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to