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


##########
core/camel-base/src/main/java/org/apache/camel/impl/converter/CoreTypeConverterRegistry.java:
##########
@@ -64,7 +64,8 @@ public <T> T convertTo(Class<T> type, Exchange exchange, 
Object value) throws Ty
     // special enum converter for optional performance
     protected final TypeConverter enumTypeConverter = new EnumTypeConverter();
 
-    private final ConverterStatistics statistics;
+    // not final: the registry is created when the CamelContext is built, 
which can be before the option is set
+    private volatile ConverterStatistics statistics;

Review Comment:
   This reverses the Camel 4.7 decision to make the statistics collector 
immutable (4.7 upgrade guide; NOTE in 
`docs/user-manual/modules/ROOT/pages/type-converter.adoc`). The statistics are 
chosen when the registry is created so that the conversions done while Camel 
bootstraps are counted as well; switching them on later would miss those. 
Please keep the field `final` and fix this in Camel Main instead, by applying 
the option before `camelContext.build()` (see the review summary).



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