Stop referring to "Java 8" features in documentation

Closes gh-36310
This commit is contained in:
Sam Brannen
2026-02-12 12:11:02 +01:00
parent 6f03c186b9
commit d84c4a39e2
37 changed files with 90 additions and 85 deletions
@@ -20,7 +20,7 @@ import org.jspecify.annotations.Nullable;
/**
* Default implementation of the {@link ParameterNameDiscoverer} strategy interface,
* delegating to the Java 8 standard reflection mechanism.
* delegating to Java's standard reflection mechanism.
*
* <p>If a Kotlin reflection implementation is present,
* {@link KotlinReflectionParameterNameDiscoverer} is added first in the list and
@@ -47,7 +47,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());
}
// Recommended approach on Java 8+: compilation with -parameters.
// Recommended approach on Java: compilation with -parameters.
addDiscoverer(new StandardReflectionParameterNameDiscoverer());
}
@@ -26,11 +26,12 @@ import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jspecify.annotations.Nullable;
/**
* {@link ParameterNameDiscoverer} implementation which uses Kotlin's reflection facilities
* for introspecting parameter names.
* {@link ParameterNameDiscoverer} implementation which uses Kotlin's reflection
* facilities for introspecting parameter names.
*
* <p>Compared to {@link StandardReflectionParameterNameDiscoverer}, it allows in addition to
* determine interface parameter names without requiring Java 8 -parameters compiler flag.
* <p>In contrast to {@link StandardReflectionParameterNameDiscoverer}, this
* discoverer can also determine interface parameter names without requiring Java's
* {@code -parameters} compiler flag.
*
* @author Sebastien Deleuze
* @since 5.0
@@ -24,8 +24,8 @@ import org.springframework.util.ObjectUtils;
/**
* A common key class for a method against a specific target class,
* including {@link #toString()} representation and {@link Comparable}
* support (as suggested for custom {@code HashMap} keys as of Java 8).
* including a {@link #toString()} representation and {@link Comparable}
* support (as suggested for custom {@code HashMap} keys in Java).
*
* @author Juergen Hoeller
* @since 4.3
@@ -393,10 +393,10 @@ public class MethodParameter {
/**
* Return whether this method indicates a parameter which is not required:
* either in the form of Java 8's {@link java.util.Optional}, JSpecify annotations,
* any variant of a parameter-level {@code @Nullable} annotation (such as from Spring,
* JSR-305 or Jakarta set of annotations), a language-level nullable type
* declaration or {@code Continuation} parameter in Kotlin.
* either in the form of {@link java.util.Optional}, JSpecify annotations,
* any variant of a parameter-level {@code @Nullable} annotation (such as
* from Spring, JSR-305, or Jakarta annotations), or a language-level
* nullable type declaration or {@code Continuation} parameter in Kotlin.
* @since 4.3
* @see Nullness#forMethodParameter(MethodParameter)
*/
@@ -23,7 +23,7 @@ import java.lang.reflect.Parameter;
import org.jspecify.annotations.Nullable;
/**
* {@link ParameterNameDiscoverer} implementation which uses JDK 8's reflection facilities
* {@link ParameterNameDiscoverer} implementation which uses Java's reflection facilities
* for introspecting parameter names (based on the "-parameters" compiler flag).
*
* <p>This is a key element of {@link DefaultParameterNameDiscoverer} where it is being
@@ -134,9 +134,10 @@ public class SynthesizingMethodParameter extends MethodParameter {
}
/**
* Create a new SynthesizingMethodParameter for the given parameter descriptor.
* <p>This is a convenience factory method for scenarios where a
* Java 8 {@link Parameter} descriptor is already available.
* Create a new {@code SynthesizingMethodParameter} for the given parameter
* descriptor.
* <p>This is a convenience factory method for scenarios where a Java
* {@link Parameter} descriptor is already available.
* @param parameter the parameter descriptor
* @return the corresponding {@code SynthesizingMethodParameter} instance
* @since 5.0
@@ -194,10 +194,11 @@ public class GenericConversionService implements ConfigurableConversionService {
/**
* Template method to convert a {@code null} source.
* <p>The default implementation returns {@code null} or the Java 8
* {@link java.util.Optional#empty()} instance if the target type is
* {@code java.util.Optional}. Subclasses may override this to return
* custom {@code null} objects for specific target types.
* <p>The default implementation returns {@code null} or the
* {@link Optional#empty()} instance if the target type is
* {@code java.util.Optional}.
* <p>Subclasses may override this to return custom {@code null} objects for
* specific target types.
* @param sourceType the source type to convert from
* @param targetType the target type to convert to
* @return the converted null object
@@ -22,7 +22,7 @@ import java.util.TimeZone;
import org.springframework.core.convert.converter.Converter;
/**
* Simple converter from Java 8's {@link java.time.ZoneId} to {@link java.util.TimeZone}.
* Simple converter from Java's {@link java.time.ZoneId} to {@link java.util.TimeZone}.
*
* <p>Note that Spring's default ConversionService setup understands the 'from'/'to' convention
* that the JSR-310 {@code java.time} package consistently uses. That convention is implemented
@@ -23,7 +23,7 @@ import java.util.GregorianCalendar;
import org.springframework.core.convert.converter.Converter;
/**
* Simple converter from Java 8's {@link java.time.ZonedDateTime} to {@link java.util.Calendar}.
* Simple converter from Java's {@link java.time.ZonedDateTime} to {@link java.util.Calendar}.
*
* <p>Note that Spring's default ConversionService setup understands the 'from'/'to' convention
* that the JSR-310 {@code java.time} package consistently uses. That convention is implemented
@@ -24,7 +24,7 @@ import org.apache.commons.logging.LogFactory;
/**
* A convenient accessor for Commons Logging, providing not only
* {@code CharSequence} based log methods but also {@code Supplier}
* based variants for use with Java 8 lambda expressions.
* based variants for use with Java lambda expressions.
*
* @author Juergen Hoeller
* @since 5.2
@@ -78,8 +78,8 @@ public abstract class ReflectionUtils {
/**
* Cache for {@link Class#getDeclaredMethods()} plus equivalent default methods
* from Java 8 based interfaces, allowing for fast iteration.
* Cache for {@link Class#getDeclaredMethods()} plus equivalent interface
* default methods, allowing for fast iteration.
*/
private static final Map<Class<?>, Method[]> declaredMethodsCache = new ConcurrentReferenceHashMap<>(256);
@@ -309,7 +309,7 @@ public abstract class ReflectionUtils {
/**
* Perform the given callback operation on all matching methods of the given
* class, as locally declared or equivalent thereof (such as default methods
* on Java 8 based interfaces that the given class implements).
* from interfaces that the given class implements).
* @param clazz the class to introspect
* @param mc the callback to invoke for each method
* @throws IllegalStateException if introspection fails
@@ -444,7 +444,7 @@ public abstract class ReflectionUtils {
/**
* Variant of {@link Class#getDeclaredMethods()} that uses a local cache in
* order to avoid new Method instances. In addition, it also includes Java 8
* order to avoid new {@link Method} instances. In addition, it also includes
* default methods from locally implemented interfaces, since those are
* effectively to be treated just like declared methods.
* @param clazz the class to introspect
@@ -576,7 +576,7 @@ class AnnotationUtilsTests {
final List<String> expectedValuesJava = asList("A", "B", "C");
final List<String> expectedValuesSpring = asList("A", "B", "C", "meta1");
// Java 8
// Java
MyRepeatable[] array = MyRepeatableClass.class.getAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
List<String> values = stream(array).map(MyRepeatable::value).collect(toList());
@@ -601,7 +601,7 @@ class AnnotationUtilsTests {
final List<String> expectedValuesJava = asList("A", "B", "C");
final List<String> expectedValuesSpring = asList("A", "B", "C", "meta1");
// Java 8
// Java
MyRepeatable[] array = clazz.getAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
List<String> values = stream(array).map(MyRepeatable::value).collect(toList());
@@ -626,7 +626,7 @@ class AnnotationUtilsTests {
final List<String> expectedValuesJava = asList("X", "Y", "Z");
final List<String> expectedValuesSpring = asList("X", "Y", "Z", "meta2");
// Java 8
// Java
MyRepeatable[] array = clazz.getAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
List<String> values = stream(array).map(MyRepeatable::value).collect(toList());
@@ -651,7 +651,7 @@ class AnnotationUtilsTests {
final List<String> expectedValuesJava = asList("X", "Y", "Z");
final List<String> expectedValuesSpring = asList("X", "Y", "Z", "meta2");
// Java 8
// Java
MyRepeatable[] array = clazz.getAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
List<String> values = stream(array).map(MyRepeatable::value).collect(toList());
@@ -675,7 +675,7 @@ class AnnotationUtilsTests {
final List<String> expectedValuesJava = asList("A", "B", "C");
final List<String> expectedValuesSpring = asList("A", "B", "C", "meta1");
// Java 8
// Java
MyRepeatable[] array = MyRepeatableClass.class.getDeclaredAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
List<String> values = stream(array).map(MyRepeatable::value).collect(toList());
@@ -699,7 +699,7 @@ class AnnotationUtilsTests {
void getDeclaredRepeatableAnnotationsDeclaredOnSuperclass() {
final Class<?> clazz = SubMyRepeatableClass.class;
// Java 8
// Java
MyRepeatable[] array = clazz.getDeclaredAnnotationsByType(MyRepeatable.class);
assertThat(array).isNotNull();
assertThat(array).isEmpty();
@@ -105,7 +105,7 @@ class MultipleComposedAnnotationsOnSingleAnnotatedElementTests {
}
@Test
@Disabled("Disabled since some Java 8 updates handle the bridge method differently")
@Disabled("Disabled since some Java versions/compilers handle the bridge method differently")
void getMultipleComposedAnnotationsOnBridgeMethod() {
Set<Cacheable> cacheables = getAllMergedAnnotations(getBridgeMethod(), Cacheable.class);
assertThat(cacheables).isNotNull();