}
} catch (AmbiguousComponentResolutionException e) {
e.setComponent(getComponentImplementation());
throw e;
}
ComponentMonitor componentMonitor = currentMonitor();
try {
Object[] parameters = getMemberArguments(guardedContainer, ctor);
ctor = componentMonitor.instantiating(container, ConstructorInjector.this, ctor);
if(ctor == null) {
throw new NullPointerException("Component Monitor " + componentMonitor
+ " returned a null constructor from method 'instantiating' after passing in " + ctor);
}
long startTime = System.currentTimeMillis();
T inst = instantiate(ctor, parameters);
componentMonitor.instantiated(container,
ConstructorInjector.this,
ctor, inst, parameters, System.currentTimeMillis() - startTime);
return inst;
} catch (InvocationTargetException e) {
componentMonitor.instantiationFailed(container, ConstructorInjector.this, ctor, e);
if (e.getTargetException() instanceof RuntimeException) {
throw (RuntimeException) e.getTargetException();
} else if (e.getTargetException() instanceof Error) {
throw (Error) e.getTargetException();
}