public boolean analyze(Project aProject, CAS aCas) throws CasDoctorException { List<LogMessage> messages = new ArrayList<>(); boolean result = analyze(aProject, aCas, messages); if (log.isDebugEnabled()) { messages.forEach(s -> log.debug("{}", s)); } return result; }
analyze(aProject, aCas, aMessages, true);
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)); }
casDoctor.analyze(aProject, aCas);
casDoctor.analyze(aProject, aCas);
casDoctor.analyze(aProject, aCas);
casDoctor.analyze(aProject, aJcas.getCas());
casDoctor.analyze(aDocument.getProject(), aJcas.getCas());
casDoctor.analyze(aDocument.getProject(), aJcas.getCas());
casDoctor.analyze(project, initialCas.getCas(), messageSet.messages); try { JCas correctionCas = casStorageService.readCas(sd, CORRECTION_USER, false); casDoctor.analyze(project, correctionCas.getCas(), messageSet.messages); try { JCas curationCas = casStorageService.readCas(sd, CURATION_USER, false); casDoctor.analyze(project, curationCas.getCas(), messageSet.messages); JCas userCas = casStorageService.readCas(ad.getDocument(), ad.getUser(), false); casDoctor.analyze(project, userCas.getCas(), messageSet.messages);
casDoctor.analyze(project, initialCas.getCas(), messageSet.messages); try { JCas correctionCas = casStorageService.readCas(sd, CORRECTION_USER, false); casDoctor.analyze(project, correctionCas.getCas(), messageSet.messages); try { JCas curationCas = casStorageService.readCas(sd, CURATION_USER, false); casDoctor.analyze(project, curationCas.getCas(), messageSet.messages); JCas userCas = casStorageService.readCas(ad.getDocument(), ad.getUser(), false); casDoctor.analyze(project, userCas.getCas(), messageSet.messages);
AllFeatureStructuresIndexedCheck.class); boolean result = cd.analyze(null, jcas.getCas(), messages);
CasDoctor cd = new CasDoctor(AllFeatureStructuresIndexedCheck.class); boolean result = cd.analyze(null, cas, messages);
CasDoctor cd = new CasDoctor(AllFeatureStructuresIndexedCheck.class); boolean result = cd.analyze(null, cas, messages);