diff --git a/src/main/java/cn/taketoday/context/factory/AbstractBeanFactory.java b/src/main/java/cn/taketoday/context/factory/AbstractBeanFactory.java index 821941a6fd..3754153ba2 100644 --- a/src/main/java/cn/taketoday/context/factory/AbstractBeanFactory.java +++ b/src/main/java/cn/taketoday/context/factory/AbstractBeanFactory.java @@ -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
* 2018-06-23 11:20:58 @@ -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) { @@ -931,11 +929,11 @@ public void setObjectFactories(Map, 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 diff --git a/src/main/java/cn/taketoday/context/utils/ClassUtils.java b/src/main/java/cn/taketoday/context/utils/ClassUtils.java index 5f6ca10baa..f7bdb07806 100644 --- a/src/main/java/cn/taketoday/context/utils/ClassUtils.java +++ b/src/main/java/cn/taketoday/context/utils/ClassUtils.java @@ -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> getClassCache() { - return scan(Constant.BLANK); - } - // ------------------------------------------ Class Scan /** @@ -1254,54 +1244,6 @@ public static Class 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 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 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 /**