public boolean analyze(Project aProject, CAS aCas, List<LogMessage> aMessages, boolean aFatalChecks) throws CasDoctorException { long tStart = System.currentTimeMillis(); boolean ok = true; for (Class<? extends Check> checkClass : checkClasses) { try { long tStartTask = System.currentTimeMillis(); Check check = checkClass.newInstance(); if (context != null) { context.getAutowireCapableBeanFactory().autowireBean(check); } log.debug("CasDoctor analysis [" + checkClass.getSimpleName() + "] running..."); ok &= check.check(aProject, aCas, aMessages); log.debug("CasDoctor analysis [" + checkClass.getSimpleName() + "] completed in " + (System.currentTimeMillis() - tStartTask) + "ms"); } catch (InstantiationException | IllegalAccessException e) { aMessages.add(new LogMessage(this, LogLevel.ERROR, "Cannot instantiate [%s]: %s", checkClass.getSimpleName(), ExceptionUtils.getRootCauseMessage(e))); log.error("Error running check", e); } } if (!ok) { aMessages.forEach(s -> log.error("{}", s)); }