officially deprecated ClassUtils.forName variant without ClassLoader
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1005 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
151a1a2a7b
commit
3d034cb046
|
|
@ -194,7 +194,10 @@ public abstract class ClassUtils {
|
|||
* @throws LinkageError if the class file could not be loaded
|
||||
* @see Class#forName(String, boolean, ClassLoader)
|
||||
* @see #getDefaultClassLoader()
|
||||
* @deprecated as of Spring 3.0, in favor of specifying a ClassLoader explicitly:
|
||||
* see {@link #forName(String, ClassLoader)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static Class forName(String name) throws ClassNotFoundException, LinkageError {
|
||||
return forName(name, getDefaultClassLoader());
|
||||
}
|
||||
|
|
@ -298,7 +301,7 @@ public abstract class ClassUtils {
|
|||
* according to the JVM's naming rules for primitive classes.
|
||||
* <p>Also supports the JVM's internal class names for primitive arrays.
|
||||
* Does <i>not</i> support the "[]" suffix notation for primitive arrays;
|
||||
* this is only supported by {@link #forName}.
|
||||
* this is only supported by {@link #forName(String, ClassLoader)}.
|
||||
* @param name the name of the potentially primitive class
|
||||
* @return the primitive class, or <code>null</code> if the name does not denote
|
||||
* a primitive class or primitive array class
|
||||
|
|
@ -673,7 +676,6 @@ public abstract class ClassUtils {
|
|||
* May be <code>null</code> or may not even implement the method.
|
||||
* @return the specific target method, or the original method if the
|
||||
* <code>targetClass</code> doesn't implement it or is <code>null</code>
|
||||
* @see org.springframework.aop.support.AopUtils#getMostSpecificMethod
|
||||
*/
|
||||
public static Method getMostSpecificMethod(Method method, Class targetClass) {
|
||||
if (method != null && targetClass != null && !targetClass.equals(method.getDeclaringClass())) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
|
|
@ -37,8 +37,6 @@ import java.lang.reflect.Modifier;
|
|||
* @since 19.02.2004
|
||||
* @see #prepare
|
||||
* @see #invoke
|
||||
* @see org.springframework.beans.factory.config.MethodInvokingFactoryBean
|
||||
* @see org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
|
||||
*/
|
||||
public class MethodInvoker {
|
||||
|
||||
|
|
@ -197,7 +195,7 @@ public class MethodInvoker {
|
|||
* @throws ClassNotFoundException if the class name was invalid
|
||||
*/
|
||||
protected Class resolveClassName(String className) throws ClassNotFoundException {
|
||||
return ClassUtils.forName(className);
|
||||
return ClassUtils.forName(className, ClassUtils.getDefaultClassLoader());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -216,8 +214,7 @@ public class MethodInvoker {
|
|||
int minTypeDiffWeight = Integer.MAX_VALUE;
|
||||
Method matchingMethod = null;
|
||||
|
||||
for (int i = 0; i < candidates.length; i++) {
|
||||
Method candidate = candidates[i];
|
||||
for (Method candidate : candidates) {
|
||||
if (candidate.getName().equals(targetMethod)) {
|
||||
Class[] paramTypes = candidate.getParameterTypes();
|
||||
if (paramTypes.length == argCount) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue