private static void checkField(@NotNull ReflectiveClass ownerClass,
                                 @NotNull String fieldName,
                                 @NotNull PsiExpression fieldNameExpression,
                                 @NotNull PsiExpression fieldTypeExpression,
                                 boolean isStaticExpected,
                                 @NotNull PsiReferenceExpression factoryMethodExpression,
                                 @NotNull ProblemsHolder holder) {
    if (!ownerClass.isExact()) return;
    final PsiField field = ownerClass.getPsiClass().findFieldByName(fieldName, true);
    if (field == null) {
      holder.registerProblem(fieldNameExpression, JavaBundle.message("inspection.handle.signature.field.cannot.resolve", fieldName));
      return;
    }

    if (field.hasModifierProperty(PsiModifier.STATIC) != isStaticExpected) {
      final String factoryMethodName = factoryMethodExpression.getReferenceName();
      final PsiElement factoryMethodNameElement = factoryMethodExpression.getReferenceNameElement();
      if (factoryMethodName != null && factoryMethodNameElement != null) {
        final LocalQuickFix fix = SwitchStaticnessQuickFix.createFix(factoryMethodName, isStaticExpected);
        final String message = JavaBundle.message(
          isStaticExpected ? "inspection.handle.signature.field.not.static" : "inspection.handle.signature.field.static", fieldName);
        holder.registerProblem(factoryMethodNameElement, message, LocalQuickFix.notNullElements(fix));
        return;
      }
    }

    final ReflectiveType reflectiveType = getReflectiveType(fieldTypeExpression);
    if (reflectiveType != null && !reflectiveType.isEqualTo(field.getType())) {
      final String expectedTypeText = getTypeText(field.getType());
      final String message = JavaBundle.message("inspection.handle.signature.field.type", fieldName, expectedTypeText);
      holder.registerProblem(fieldTypeExpression, message, new FieldTypeQuickFix(expectedTypeText));
    }
  }
private static void checkField(@NotNull ReflectiveClass ownerClass,
                                 @NotNull String fieldName,
                                 @NotNull PsiExpression fieldNameExpression,
                                 @NotNull PsiExpression fieldTypeExpression,
                                 boolean isStaticExpected,
                                 @NotNull PsiReferenceExpression factoryMethodExpression,
                                 @NotNull ProblemsHolder holder)