From fcf6ecd08a0533a9794bf707e20e9873d31887fb Mon Sep 17 00:00:00 2001 From: Peeter Karolin <43540664+tw-peeterkarolin@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:30:53 +0300 Subject: [PATCH] Create BeanPostProcessor beans in static methods (#44) * Create BeanPostProcessor beans in static methods to avoid the autoconfiguration classes to be processed in bean post-processing phase and logging a warning. * Create BeanPostProcessor beans in static methods to avoid the autoconfiguration classes to be processed in bean post-processing phase and logging a warning. --- CHANGELOG.md | 6 ++++++ gradle.properties | 2 +- .../common/entrypoints/EntryPointsAutoConfiguration.java | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9324067..587f936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.16.1] - 2024-04-04 + +### Changed + +* Use static methods to create BeanPostProcessors. + ## [2.16.0] - 2024-02-14 ### Changed diff --git a/gradle.properties b/gradle.properties index 8a42493..b0f924b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.16.0 +version=2.16.1 diff --git a/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java b/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java index 9f5cf0b..0bdac0e 100644 --- a/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java +++ b/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java @@ -56,14 +56,14 @@ public DatabaseAccessStatisticsEntryPointInterceptor twEntryPointsDatabaseAccess @Bean @ConditionalOnProperty(name = "tw-entrypoints.das.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean - public DatabaseAccessStatisticsBeanPostProcessor twEntryPointsDatabaseAccessStatisticsBeanPostProcessor() { + public static DatabaseAccessStatisticsBeanPostProcessor twEntryPointsDatabaseAccessStatisticsBeanPostProcessor() { return new DatabaseAccessStatisticsBeanPostProcessor(); } @Bean @ConditionalOnProperty(name = "tw-entrypoints.tas.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean - public TableAccessStatisticsBeanPostProcessor twEntryPointsTableAccessStatisticsBeanPostProcessor(BeanFactory beanFactory) { + public static TableAccessStatisticsBeanPostProcessor twEntryPointsTableAccessStatisticsBeanPostProcessor(BeanFactory beanFactory) { return new TableAccessStatisticsBeanPostProcessor(beanFactory); } @@ -105,7 +105,7 @@ public TasFlywayConfigurationCustomizer tasFlywayConfigurationCustomizer() { @Bean @ConditionalOnProperty(name = "tw-entrypoints.ts.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean - public TransactionStatisticsBeanPostProcessor twEntryPointsTransactionStatisticsBeanPostProcessor(BeanFactory beanFactory) { + public static TransactionStatisticsBeanPostProcessor twEntryPointsTransactionStatisticsBeanPostProcessor(BeanFactory beanFactory) { return new TransactionStatisticsBeanPostProcessor(beanFactory); }