diff --git a/spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java b/spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java index 63377639e60..ada54b51742 100644 --- a/spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java +++ b/spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java @@ -45,8 +45,14 @@ public class NamedThreadLocal extends ThreadLocal { this.name = name; } + @Override + public String toString() { + return this.name; + } + + /** - * Creates a named thread local variable. The initial value of the variable is + * Create a named thread local variable. The initial value of the variable is * determined by invoking the {@code get} method on the {@code Supplier}. * @param the type of the named thread local's value * @param name a descriptive name for the thread local @@ -58,18 +64,13 @@ public class NamedThreadLocal extends ThreadLocal { return new SuppliedNamedThreadLocal<>(name, supplier); } - @Override - public String toString() { - return this.name; - } - /** * An extension of NamedThreadLocal that obtains its initial value from * the specified {@code Supplier}. * @param the type of the named thread local's value */ - static final class SuppliedNamedThreadLocal extends NamedThreadLocal { + private static final class SuppliedNamedThreadLocal extends NamedThreadLocal { private final Supplier supplier; @@ -82,7 +83,6 @@ public class NamedThreadLocal extends ThreadLocal { protected T initialValue() { return this.supplier.get(); } - } } diff --git a/spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java b/spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java index 6092ec35829..96e49c71071 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import kotlin.text.Regex; import org.springframework.core.convert.converter.Converter; /** - * Converts from a String to a {@link Regex}. + * Converts from a String to a Kotlin {@link Regex}. * * @author Stephane Nicoll * @author Sebastien Deleuze