Object (@Nullable CachingConstructorInjectionComponentAdapter adapter, @NotNull PicoContainer container, @NotNull Class<?> componentImplementation) { Set<Class<?>> currentStack = ourGuard.get(); if (currentStack == null) { currentStack = Collections.newSetFromMap(new IdentityHashMap<>(1)); ourGuard.set(currentStack); } if (!currentStack.add(componentImplementation)) { throw new CyclicDependencyException(componentImplementation); } try { return doGetComponentInstance(adapter, (DefaultPicoContainer)container, componentImplementation); } catch (final CyclicDependencyException e) { e.push(componentImplementation); throw e; } finally { currentStack.remove(componentImplementation); } }