PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { final Charset charset = EncodingProjectManager.getInstance(holder.getProject()).getDefaultCharsetForPropertiesFiles(null); if (charset != StandardCharsets.UTF_8) return PsiElementVisitor.EMPTY_VISITOR; return new PsiElementVisitor() { @Override public void visitElement(@NotNull PsiElement element) { if (!(element instanceof PropertyValueImpl)) return; boolean found = getThreeDots(((PropertyValueImpl)element).getChars()); if (found) { int length = element.getTextLength(); holder.registerProblem(element, TextRange.create(length - 3, length), PropertiesBundle.message("inspection.use.ellipsis.in.property.description"), ReplaceThreeDotsWithEllipsisFix.getInstance()); } } }; }