void (Settings s) { if (myValidation.isEmpty()) return; ApplicationManager.getApplication().executeOnPooledThread(() -> { List<ValidationInfo> infos = ContainerUtil.flatMap(myValidation, it -> ReadAction.nonBlocking(() -> it.apply(s)).executeSynchronously()); if (infos.isEmpty()) return; UIUtil.invokeLaterIfNeeded(() -> { if (Disposer.isDisposed(this)) return; for (ValidationInfo info : infos) { JComponent component = info.component; if (component == null) continue; Optional<ComponentValidator> optional = ComponentValidator.getInstance(component); ComponentValidator validator; if (optional.isEmpty()) { validator = new ComponentValidator(this); validator.installOn(component); } else { validator = optional.get(); } validator.updateInfo(info.message.isEmpty() ? null : info); } }); }); }