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