From e45b47565c7b1e0057e7d5b22ae42292295a0b49 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 11 Jan 2023 11:38:48 +0100 Subject: [PATCH] Use Threadlocal.remove instead of .set(null) See https://github.com/spring-cloud/spring-cloud-sleuth/issues/27 for reference. --- .../main/java/org/springframework/boot/SpringApplication.java | 2 +- .../boot/convert/CharSequenceToObjectConverter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 79b57cd648..209dcf00ad 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -1386,7 +1386,7 @@ public class SpringApplication { return action.get(); } finally { - applicationHook.set(null); + applicationHook.remove(); } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CharSequenceToObjectConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CharSequenceToObjectConverter.java index 578e300dbc..c437126a0c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CharSequenceToObjectConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CharSequenceToObjectConverter.java @@ -68,7 +68,7 @@ class CharSequenceToObjectConverter implements ConditionalGenericConverter { return this.conversionService.canConvert(STRING, targetType); } finally { - this.disable.set(null); + this.disable.remove(); } }