Browse Source

Polishing

pull/31113/head
Juergen Hoeller 2 years ago
parent
commit
3c5dc19da3
  1. 16
      spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java
  2. 4
      spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java

16
spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java

@ -45,8 +45,14 @@ public class NamedThreadLocal<T> extends ThreadLocal<T> { @@ -45,8 +45,14 @@ public class NamedThreadLocal<T> extends ThreadLocal<T> {
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 <S> 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<T> extends ThreadLocal<T> { @@ -58,18 +64,13 @@ public class NamedThreadLocal<T> extends ThreadLocal<T> {
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 <T> the type of the named thread local's value
*/
static final class SuppliedNamedThreadLocal<T> extends NamedThreadLocal<T> {
private static final class SuppliedNamedThreadLocal<T> extends NamedThreadLocal<T> {
private final Supplier<? extends T> supplier;
@ -82,7 +83,6 @@ public class NamedThreadLocal<T> extends ThreadLocal<T> { @@ -82,7 +83,6 @@ public class NamedThreadLocal<T> extends ThreadLocal<T> {
protected T initialValue() {
return this.supplier.get();
}
}
}

4
spring-core/src/main/java/org/springframework/core/convert/support/StringToRegexConverter.java

@ -1,5 +1,5 @@ @@ -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; @@ -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

Loading…
Cancel
Save