Skip to content

Commit 0f24a9e

Browse files
authored
Update dependencies and add null safety assertions
- Upgrade Kotlin from 2.1.21 to 2.2.0 - Update Hibernate Validation from 8.0.2.Final to 9.0.1.Final - Bump Micrometer from 1.15.2 to 1.16.0-M1 - Update Micrometer Tracing from 1.5.2 to 1.6.0-M1 - Upgrade Reactor from 2025.0.0-SNAPSHOT to 2025.0.0-M5 - Update Spring Data from 2025.1.0-SNAPSHOT to 2025.1.0-M4 - Upgrade Spring from 7.0.0-SNAPSHOT to 7.0.0-M7 - Add null checks for cause and registry in micrometer components Signed-off-by: Soby Chacko <[email protected]>
1 parent b52f444 commit 0f24a9e

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlinVersion = '2.1.21'
2+
ext.kotlinVersion = '2.2.0'
33
ext.isCI = System.getenv('GITHUB_ACTION')
44
repositories {
55
gradlePluginPortal()
@@ -54,7 +54,7 @@ ext {
5454
assertjVersion = '3.27.3'
5555
awaitilityVersion = '4.3.0'
5656
hamcrestVersion = '3.0'
57-
hibernateValidationVersion = '8.0.2.Final'
57+
hibernateValidationVersion = '9.0.1.Final'
5858
jacksonBomVersion = '2.19.2'
5959
jaywayJsonPathVersion = '2.9.0'
6060
junit4Version = '4.13.2'
@@ -63,15 +63,15 @@ ext {
6363
kotlinCoroutinesVersion = '1.10.2'
6464
log4jVersion = '2.24.3'
6565
micrometerDocsVersion = '1.0.4'
66-
micrometerVersion = '1.15.2'
67-
micrometerTracingVersion = '1.5.2'
66+
micrometerVersion = '1.16.0-M1'
67+
micrometerTracingVersion = '1.6.0-M1'
6868
mockitoVersion = '5.18.0'
69-
reactorVersion = '2025.0.0-SNAPSHOT'
69+
reactorVersion = '2025.0.0-M5'
7070
scalaVersion = '2.13'
7171
springBootVersion = '3.5.0' // docs module
72-
springDataVersion = '2025.1.0-SNAPSHOT'
72+
springDataVersion = '2025.1.0-M4'
7373
springRetryVersion = '2.0.12'
74-
springVersion = '7.0.0-SNAPSHOT'
74+
springVersion = '7.0.0-M7'
7575

7676
idPrefix = 'kafka'
7777

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ else if (!(result instanceof CompletableFuture<?>)) {
559559
}
560560
else {
561561
Throwable cause = t instanceof CompletionException ? t.getCause() : t;
562+
cause = cause == null ? t : cause;
562563
observation.error(cause);
563564
asyncFailure(request, acknowledgment, consumer, cause, source);
564565
}

spring-kafka/src/main/java/org/springframework/kafka/support/micrometer/MicrometerHolder.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public final class MicrometerHolder {
4343

4444
private final Map<String, Timer> meters = new ConcurrentHashMap<>();
4545

46-
private final @Nullable MeterRegistry registry;
46+
@SuppressWarnings("NullAway.Init")
47+
private final MeterRegistry registry;
4748

4849
private final String timerName;
4950

@@ -69,13 +70,15 @@ public MicrometerHolder(@Nullable ApplicationContext context, String name,
6970
if (context == null) {
7071
throw new IllegalStateException("No micrometer registry present");
7172
}
73+
MeterRegistry meterRegistry;
7274
try {
73-
this.registry = context.getBeanProvider(MeterRegistry.class).getIfUnique();
75+
meterRegistry = context.getBeanProvider(MeterRegistry.class).getIfUnique();
7476
}
7577
catch (NoUniqueBeanDefinitionException ex) {
7678
throw new IllegalStateException(ex);
7779
}
78-
if (this.registry != null) {
80+
if (meterRegistry != null) {
81+
this.registry = meterRegistry;
7982
this.timerName = timerName;
8083
this.timerDesc = timerDesc;
8184
this.name = name;

0 commit comments

Comments
 (0)