|
28 | 28 | import java.util.stream.Collectors;
|
29 | 29 | import java.util.stream.Stream;
|
30 | 30 |
|
31 |
| -import org.springframework.beans.BeanUtils; |
32 | 31 | import org.springframework.core.KotlinDetector;
|
33 | 32 | import org.springframework.core.MethodParameter;
|
34 | 33 | import org.springframework.core.ResolvableType;
|
@@ -98,27 +97,6 @@ public static int getParameterCount(Method method, Predicate<Class<?>> predicate
|
98 | 97 | return (int) Arrays.stream(method.getParameterTypes()).filter(predicate).count();
|
99 | 98 | }
|
100 | 99 |
|
101 |
| - /** |
102 |
| - * Creates an instance of the class with the given fully qualified name or returns the given default instance if the |
103 |
| - * class cannot be loaded or instantiated. |
104 |
| - * |
105 |
| - * @param classname the fully qualified class name to create an instance for. |
106 |
| - * @param defaultInstance the instance to fall back to in case the given class cannot be loaded or instantiated. |
107 |
| - * @return |
108 |
| - * @deprecated since 3.5 as it is not used within the framework anymore. |
109 |
| - */ |
110 |
| - @SuppressWarnings("unchecked") |
111 |
| - @Deprecated(since = "3.5", forRemoval = true) |
112 |
| - public static <T> T createInstanceIfPresent(String classname, T defaultInstance) { |
113 |
| - |
114 |
| - try { |
115 |
| - Class<?> type = ClassUtils.forName(classname, ClassUtils.getDefaultClassLoader()); |
116 |
| - return (T) BeanUtils.instantiateClass(type); |
117 |
| - } catch (Exception e) { |
118 |
| - return defaultInstance; |
119 |
| - } |
120 |
| - } |
121 |
| - |
122 | 100 | /**
|
123 | 101 | * Check whether the given {@code type} represents a void type such as {@code void}, {@link Void} or Kotlin
|
124 | 102 | * {@code Unit}.
|
@@ -264,20 +242,6 @@ public static Field findField(Class<?> type, DescribedFieldFilter filter, boolea
|
264 | 242 | return foundField;
|
265 | 243 | }
|
266 | 244 |
|
267 |
| - /** |
268 |
| - * Finds the field of the given name on the given type. |
269 |
| - * |
270 |
| - * @param type must not be {@literal null}. |
271 |
| - * @param name must not be {@literal null} or empty. |
272 |
| - * @return the required field. |
273 |
| - * @throws IllegalArgumentException in case the field can't be found. |
274 |
| - * @deprecated use {@link #getRequiredField(Class, String)} instead. |
275 |
| - */ |
276 |
| - @Deprecated(since = "3.5", forRemoval = true) |
277 |
| - public static Field findRequiredField(Class<?> type, String name) { |
278 |
| - return getRequiredField(type, name); |
279 |
| - } |
280 |
| - |
281 | 245 | /**
|
282 | 246 | * Obtains the required field of the given name on the given type or throws {@link IllegalArgumentException} if the
|
283 | 247 | * found could not be found.
|
@@ -411,20 +375,6 @@ public static Stream<Class<?>> returnTypeAndParameters(Method method) {
|
411 | 375 | return Stream.concat(returnType, parameterTypes);
|
412 | 376 | }
|
413 | 377 |
|
414 |
| - /** |
415 |
| - * Returns the {@link Method} with the given name and parameters declared on the given type, if available. |
416 |
| - * |
417 |
| - * @param type must not be {@literal null}. |
418 |
| - * @param name must not be {@literal null} or empty. |
419 |
| - * @param parameterTypes must not be {@literal null}. |
420 |
| - * @return the optional Method. |
421 |
| - * @since 2.0 |
422 |
| - */ |
423 |
| - @Deprecated(since = "3.5", forRemoval = true) |
424 |
| - public static Optional<Method> getMethod(Class<?> type, String name, ResolvableType... parameterTypes) { |
425 |
| - return Optional.ofNullable(findMethod(type, name, parameterTypes)); |
426 |
| - } |
427 |
| - |
428 | 378 | /**
|
429 | 379 | * Returns the {@link Method} with the given name and parameters declared on the given type, if available.
|
430 | 380 | *
|
@@ -557,18 +507,4 @@ public static Object getPrimitiveDefault(Class<?> type) {
|
557 | 507 | throw new IllegalArgumentException(String.format("Primitive type %s not supported", type));
|
558 | 508 | }
|
559 | 509 |
|
560 |
| - /** |
561 |
| - * Loads the class with the given name using the given {@link ClassLoader}. |
562 |
| - * |
563 |
| - * @param name the name of the class to be loaded. |
564 |
| - * @param classLoader the {@link ClassLoader} to use to load the class. |
565 |
| - * @return the {@link Class} or {@literal null} in case the class can't be loaded for any reason. |
566 |
| - * @since 2.5 |
567 |
| - */ |
568 |
| - @Nullable |
569 |
| - @Deprecated(since = "3.5", forRemoval = true) |
570 |
| - public static Class<?> loadIfPresent(String name, ClassLoader classLoader) { |
571 |
| - return org.springframework.data.util.ClassUtils.loadIfPresent(name, classLoader); |
572 |
| - } |
573 |
| - |
574 | 510 | }
|
0 commit comments