davsclaus commented on code in PR #31185:
URL: https://github.com/apache/camel/pull/31185#discussion_r4756588789


##########
components/camel-bean-validator/src/main/java/org/apache/camel/component/bean/validator/BeanValidatorEndpoint.java:
##########
@@ -80,14 +80,23 @@ public Producer createProducer() throws Exception {
 
         ValidatorFactory validatorFactory = this.validatorFactory;
         if (validatorFactory == null) {
-            validatorFactory = buildValidatorFactory(getCamelContext(), 
isIgnoreXmlConfiguration(),
-                    validationProviderResolver, messageInterpolator, 
traversableResolver, constraintValidatorFactory);
+            validatorFactory = buildOwnedValidatorFactory();
+            producer.setOwnedValidatorFactory(true);
         }
 
         producer.setValidatorFactory(validatorFactory);
         return producer;
     }
 
+    /**
+     * Builds a new {@link ValidatorFactory} from this endpoint's 
configuration options. Used by
+     * {@link BeanValidatorProducer#doStart()} to rebuild the factory after a 
stop/start cycle.
+     */
+    ValidatorFactory buildOwnedValidatorFactory() {

Review Comment:
   Valid Javadoc nit, but this is a straight cherry-pick of #31153 (already 
merged on main), so the backport keeps the text as it is on main. If the 
Javadoc gets reworded, that belongs on main.
   
   _Claude Code on behalf of davsclaus_



-- 
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