看了好几遍,还是觉得是一样的,if 条件判断分开了,还是我看花眼了
public void prepareStarterInstance() {
for (Class<?> klass : starterClasses) {
Object obj;
if (klass.getAnnotation(IocBean.class) == null) {
obj = Mirror.me(klass).born();
} else {
continue;
}
aware(obj);
if (obj instanceof IocLoaderProvider) {
IocLoader loader = ((IocLoaderProvider) obj).getIocLoader();
ctx.getComboIocLoader().addLoader(loader);
}
ctx.addStarter(obj);
}
for (Class<?> klass : starterClasses) {
Object obj;
if (klass.getAnnotation(IocBean.class) == null) {
continue;
} else {
obj = ctx.getIoc().get(klass);
}
aware(obj);
if (obj instanceof IocLoaderProvider) {
IocLoader loader = ((IocLoaderProvider) obj).getIocLoader();
ctx.getComboIocLoader().addLoader(loader);
}
ctx.addStarter(obj);
}
}