PsiMethod (PsiMethod propertyMethod) { if (propertyMethod == null) { return null; } final PsiClass aClass = propertyMethod.getContainingClass(); if (aClass == null) { return null; } final String methodName = propertyMethod.getName(); final PropertyKind kind = getPropertyKind(propertyMethod.getName()); if (kind == null) { return null; } final String name = methodName.substring(kind.prefix.length()); final PsiField field = kind == PropertyKind.SETTER ? getFieldOfSetter(propertyMethod) : getFieldOfGetter(propertyMethod); if (field == null) { return null; } if (kind == PropertyKind.SETTER) { final PsiMethod result = findPropertyMethod(aClass, PropertyKind.GETTER, name, field); if (result != null) { return result; } return findPropertyMethod(aClass, PropertyKind.BOOLEAN_GETTER, name, field); } else { return findPropertyMethod(aClass, PropertyKind.SETTER, name, field); } }