gnodet-bot commented on code in PR #31185:
URL: https://github.com/apache/camel/pull/31185#discussion_r4755623679
##########
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:
🔎 **Low — Javadoc omits its primary call site**
The Javadoc says *"Used by `BeanValidatorProducer#doStart()`"* but
`createProducer()` (the same file, a few lines above) also calls this method on
the happy path — it is in fact the **primary** call site. `doStart()` is only
the rebuild path after a stop/start cycle.
Suggested fix:
```suggestion
/**
* Builds a new {@link ValidatorFactory} from this endpoint's
configuration options. Called by
* {@link #createProducer()} when no user-supplied factory is
configured, and again by
* {@link BeanValidatorProducer#doStart()} to rebuild the factory after
a stop/start cycle.
*/
```
--
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]