String (PsiMethod method) { if (myCurrentRoot == null) { return null; } final PsiElement root = myCurrentRoot.getElement(); if (!(root instanceof PsiField field)) { return null; } final PsiType migrationType = myTypeEvaluator.getType(root); if (migrationType == null) { return null; } final PsiType sourceType = field.getType(); if (TypeConversionUtil.isAssignable(migrationType, sourceType)) { return null; } if (!(migrationType.equals(PsiTypes.booleanType()) || migrationType.equals(PsiTypes.booleanType().getBoxedType(field))) && !(sourceType.equals(PsiTypes.booleanType()) || sourceType.equals(PsiTypes.booleanType().getBoxedType(field)))) { return null; } final PsiMethod[] getters = GetterSetterPrototypeProvider.findGetters(field.getContainingClass(), field.getName(), field.hasModifierProperty(PsiModifier.STATIC)); if (getters != null) { for (PsiMethod getter : getters) { if (getter.isEquivalentTo(method)) { final String suggestedName = GenerateMembersUtil.suggestGetterName(field.getName(), migrationType, method.getProject()); if (!suggestedName.equals(method.getName())) { if (getter.getContainingClass().findMethodsByName(suggestedName, true).length != 0) { return null; } return suggestedName; } return null; } } } return null; }