Skip to content

Commit

Permalink
⚡ 除去 ClassUtils 过时的API
Browse files Browse the repository at this point in the history
  • Loading branch information
TAKETODAY committed Apr 29, 2021
1 parent 872d3ce commit ced549b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@
import cn.taketoday.context.utils.ContextUtils;
import cn.taketoday.context.utils.ObjectUtils;
import cn.taketoday.context.utils.OrderUtils;
import cn.taketoday.context.utils.ReflectionUtils;
import cn.taketoday.context.utils.StringUtils;

import static cn.taketoday.context.utils.ContextUtils.resolveParameter;
import static cn.taketoday.context.utils.ReflectionUtils.makeAccessible;
import static java.util.Objects.requireNonNull;

/**
* @author TODAY <br>
* 2018-06-23 11:20:58
Expand Down Expand Up @@ -440,7 +437,8 @@ protected void invokeInitMethods(final Object bean, final BeanDefinition def) {
for (final Method method : def.getInitMethods()) { /*never be null*/
try {
//method.setAccessible(true); // fix: can not access a member
final Object[] args = resolveParameter(makeAccessible(method), this);
ReflectionUtils.makeAccessible(method);
final Object[] args = ContextUtils.resolveParameter(method, this);
method.invoke(bean, args);
}
catch (Exception e) {
Expand Down Expand Up @@ -931,11 +929,11 @@ public void setObjectFactories(Map<Class<?>, Object> objectFactories) {
* Reflective InvocationHandler for lazy access to the current target object.
*/
public static class ObjectFactoryDelegatingHandler implements InvocationHandler {

private final ObjectFactory<?> objectFactory;

public ObjectFactoryDelegatingHandler(ObjectFactory<?> objectFactory) {
this.objectFactory = requireNonNull(objectFactory);
Assert.notNull(objectFactory, "objectFactory must not be null");
this.objectFactory = objectFactory;
}

@Override
Expand Down
58 changes: 0 additions & 58 deletions src/main/java/cn/taketoday/context/utils/ClassUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,6 @@ public static ClassLoader getClassLoader() {
return classLoader;
}

/**
* get all classes loaded in class path
*
* @deprecated Deprecated in 2.1.7 High scan performance without caching
*/
@Deprecated
public static Set<Class<?>> getClassCache() {
return scan(Constant.BLANK);
}

// ------------------------------------------ Class Scan

/**
Expand Down Expand Up @@ -1254,54 +1244,6 @@ public static <T> Class<T> getUserClass(String name) {

// --------------------------------- Field

/**
* Get bean instance's {@link Field}
*
* @param target
* target instance
*
* @return all {@link Field}
*
* @since 2.1.5
* @deprecated use {@link ReflectionUtils#getFields(Object)}
*/
@Deprecated
public static Collection<Field> getFields(Object target) {
return ReflectionUtils.getFields(target);
}

/**
* Get all {@link Field} list
*
* @param targetClass
* target class
*
* @return get all the {@link Field}
*
* @since 2.1.2
* @deprecated use {@link ReflectionUtils#getFields(Class)}
*/
@Deprecated
public static Collection<Field> getFields(Class<?> targetClass) {
return ReflectionUtils.getFields(targetClass);
}

/**
* Get all {@link Field} array
*
* @param targetClass
* target class
*
* @return get all the {@link Field} array
*
* @since 2.1.2
* @deprecated use {@link ReflectionUtils#getFieldArray(Class)}
*/
@Deprecated
public static Field[] getFieldArray(Class<?> targetClass) {
return ReflectionUtils.getFieldArray(targetClass);
}

// Generics

/**
Expand Down

0 comments on commit ced549b

Please sign in to comment.