List<UsageInfo> (@NotNull RecordCandidate recordCandidate) { List<UsageInfo> result = new SmartList<>(); for (var entry : recordCandidate.getFieldAccessors().entrySet()) { PsiField psiField = entry.getKey(); FieldAccessorCandidate fieldAccessorCandidate = entry.getValue(); if (fieldAccessorCandidate == null) { if (firstHasWeakerAccess(recordCandidate.getPsiClass(), psiField)) { result.add(new BrokenEncapsulationUsageInfo(psiField, JavaRefactoringBundle .message("convert.to.record.field.more.accessible", RefactoringUIUtil.getDescription(psiField, true), VisibilityUtil.getVisibilityStringToDisplay(psiField), VisibilityUtil.toPresentableText(PsiModifier.PUBLIC)))); } } else { PsiMethod accessor = fieldAccessorCandidate.getAccessor(); if (firstHasWeakerAccess(recordCandidate.getPsiClass(), accessor)) { result.add(new BrokenEncapsulationUsageInfo(accessor, JavaRefactoringBundle .message("convert.to.record.accessor.more.accessible", RefactoringUIUtil.getDescription(accessor, true), VisibilityUtil.getVisibilityStringToDisplay(accessor), VisibilityUtil.toPresentableText(PsiModifier.PUBLIC)))); } } } PsiMethod canonicalCtor = recordCandidate.getCanonicalConstructor(); if (canonicalCtor != null && firstHasWeakerAccess(recordCandidate.getPsiClass(), canonicalCtor)) { result.add(new BrokenEncapsulationUsageInfo(canonicalCtor, JavaRefactoringBundle .message("convert.to.record.ctor.more.accessible", RefactoringUIUtil.getDescription(canonicalCtor, true), VisibilityUtil.getVisibilityStringToDisplay(canonicalCtor), VisibilityUtil.getVisibilityStringToDisplay(recordCandidate.getPsiClass())))); } return result; }