boolean () { if (myConstructors.size() > 1) return false; if (myConstructors.size() == 1) { RecordConstructorCandidate ctorCandidate = myConstructors.get(0); boolean isCanonical = ctorCandidate.myCanonical && throwsOnlyUncheckedExceptions(ctorCandidate.myConstructor); if (!isCanonical) return false; if (containsObjectMethodCalls(ctorCandidate.myConstructor)) return false; } if (myFieldAccessors.size() == 0) return false; for (var entry : myFieldAccessors.entrySet()) { PsiField field = entry.getKey(); if (!field.hasModifierProperty(FINAL) || field.hasInitializer()) return false; if (HighlightUtil.RESTRICTED_RECORD_COMPONENT_NAMES.contains(field.getName())) return false; if (entry.getValue().size() > 1) return false; FieldAccessorCandidate firstAccessor = ContainerUtil.getFirstItem(entry.getValue()); if (firstAccessor == null) continue; if (containsObjectMethodCalls(firstAccessor.getAccessor())) return false; } for (PsiMethod ordinaryMethod : myOrdinaryMethods) { if (ordinaryMethod.hasModifierProperty(NATIVE)) return false; boolean conflictsWithPotentialAccessor = ordinaryMethod.getParameterList().isEmpty() && ContainerUtil.exists(myFieldAccessors.keySet(), field -> field.getName().equals(ordinaryMethod.getName())); if (conflictsWithPotentialAccessor) return false; if (containsObjectMethodCalls(ordinaryMethod)) return false; } return true; }