PsiField (PsiMethod method, Supplier<? extends PsiExpression> returnExprSupplier, boolean useIndex) { PsiField field = useIndex && method instanceof PsiMethodImpl && method.isPhysical() ? JavaSimplePropertyGistKt.getFieldOfGetter(method) : getSimplyReturnedField(returnExprSupplier.get()); if (field == null || !checkFieldLocation(method, field)) return null; final PsiType returnType = method.getReturnType(); return returnType != null && field.getType().equals(returnType) ? field : null; }