shashank created CAMEL-26867:
--------------------------------

             Summary: camel-util - TimeSource: log the install of each provider 
class once at INFO, and check every core module and more clock calls
                 Key: CAMEL-26867
                 URL: https://issues.apache.org/jira/browse/CAMEL-26867
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: shashank
            Assignee: shashank


Follow-up of CAMEL-26752 (apache/camel#29526), with the optional ideas of its 
review:

* {{TimeSource.install}} logs the install of a provider other than the default, 
and putting the default back, at INFO. camel-test-dst installs a provider for 
each seed, so a test of 1000 seeds writes about 2000 INFO lines. Logging the 
first install of each provider class at INFO and the repeats at DEBUG keeps the 
signal for a shared runtime (such as Karaf) with less noise. A swap from one 
provider other than the default to another could also say which one it replaced.
* {{TimeSourceDirectClockCallsTest}} looks for classes that use {{TimeSource}} 
without being in its list only in four hard-coded core modules ({{MODULES}}). 
Walking every {{core/*/src/main/java}} would also find a future user in 
camel-core-engine or camel-management.
* The test does not find {{Calendar.getInstance()}}, {{new 
GregorianCalendar()}} and {{Year.now()}} / {{YearMonth.now()}}: one more rule, 
or a mention in the Javadoc of what it does not find.
* test-dst.adoc (around line 140) still names only the three original calls the 
test finds.

None of the listed classes makes such a call today; this is about keeping the 
check and the log useful.

_Filed with Claude Code on behalf of allthingssecurity._



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to