dromara / dromara/forest

代码的一点疑惑:com.dtflys.forest.reflection.SpringForestObjectFactory#getObject

Open
#188 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
241
PR merge metrics
No merged PRs in 30d

Description

public T getObject(Class clazz) {
T bean = getObjectFromCache(clazz);
if (bean == null) {
try {
bean = applicationContext.getBean(clazz);
} catch (Throwable ignored) {
}
if (bean == null) {
bean = super.getObject(clazz);
}
}
return bean;
}

我的想法
public T getObject(Class clazz) {
T bean = super.getObject(clazz);
if (bean == null) {
try {
bean = applicationContext.getBean(clazz);
} catch (Throwable ignored) {
}
}
return bean;
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.