Deprecate JdkVersion (for optimistic compatibility with newer JDK generations)
Issue: SPR-13312
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.core;
|
||||
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link ParameterNameDiscoverer} strategy interface,
|
||||
* using the Java 8 standard reflection mechanism (if available), and falling back
|
||||
@@ -31,8 +33,8 @@ package org.springframework.core;
|
||||
*/
|
||||
public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDiscoverer {
|
||||
|
||||
private static final boolean standardReflectionAvailable =
|
||||
(JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_18);
|
||||
private static final boolean standardReflectionAvailable = ClassUtils.isPresent(
|
||||
"java.lang.reflect.Executable", DefaultParameterNameDiscoverer.class.getClassLoader());
|
||||
|
||||
|
||||
public DefaultParameterNameDiscoverer() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -27,7 +27,10 @@ package org.springframework.core;
|
||||
* @author Juergen Hoeller
|
||||
* @author Rick Evans
|
||||
* @author Sam Brannen
|
||||
* @deprecated as of Spring 4.2.1, in favor of direct checks for the desired
|
||||
* JDK API variants via reflection
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class JdkVersion {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user