|
|
@ -121,9 +121,7 @@ class IntegrityCheck {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void checkCycles() {
|
|
|
|
private void checkCycles() {
|
|
|
|
definitions.forEach(def -> {
|
|
|
|
definitions.forEach(def -> checkConstructorParameter(def.getClz(), null));
|
|
|
|
checkConstructorParameter(null, def.getClz());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void checkConstructorParameter(Class<?> rootClz, Class<?> paramClz) {
|
|
|
|
private void checkConstructorParameter(Class<?> rootClz, Class<?> paramClz) {
|
|
|
@ -131,13 +129,16 @@ class IntegrityCheck {
|
|
|
|
throw new DependencyCycleDetected(rootClz);
|
|
|
|
throw new DependencyCycleDetected(rootClz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Class<?>[] parameterTypes = findDefinition(paramClz).getConstructor().getParameterTypes();
|
|
|
|
ServiceDefinition def;
|
|
|
|
for (Class<?> innerParamClz : parameterTypes) {
|
|
|
|
if (paramClz == null) {
|
|
|
|
if (rootClz == null) {
|
|
|
|
def = findDefinition(rootClz);
|
|
|
|
checkConstructorParameter(paramClz, innerParamClz);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
checkConstructorParameter(rootClz, innerParamClz);
|
|
|
|
def = findDefinition(paramClz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class<?>[] parameterTypes = def.getConstructor().getParameterTypes();
|
|
|
|
|
|
|
|
for (Class<?> innerParamClz : parameterTypes) {
|
|
|
|
|
|
|
|
checkConstructorParameter(rootClz, innerParamClz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|