@SuppressWarnings("HardCodedStringLiteral")
  private PsiMethod createHashCode() throws IncorrectOperationException {

    StringBuilder buffer = new StringBuilder();

    buffer.append("int hashCode() {\n");
    if (!mySuperHasHashCode && myHashCodeFields.length == 1) {
      PsiField field = myHashCodeFields[0];
      final String tempName = addTempForOneField(field, buffer);
      buffer.append("return ");
      if (field.getType() instanceof PsiPrimitiveType) {
        addPrimitiveFieldHashCode(buffer, field, tempName);
      } else {
        addFieldHashCode(buffer, field);
      }
      buffer.append("\n}");
    } else if (myHashCodeFields.length > 0) {
      JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(myFile);
      final String resultName = getUniqueLocalVarName(settings.LOCAL_VARIABLE_NAME_PREFIX + RESULT_VARIABLE, myHashCodeFields);

      buffer.append("int ");
      buffer.append(resultName);

      boolean resultAssigned = false;
      if (mySuperHasHashCode) {
        buffer.append(" = ");
        addSuperHashCode(buffer);
        resultAssigned = true;
      }
      buffer.append("\n");
      String tempName = addTempDeclaration(buffer);
      for (PsiField field : myHashCodeFields) {
        addTempAssignment(field, buffer, tempName);
        buffer.append(resultName);
        buffer.append(" = ");
        if (resultAssigned) {
          buffer.append("31 * ");
          buffer.append(resultName);
          buffer.append(" + ");
        }
        if (field.getType() instanceof PsiPrimitiveType) {
          addPrimitiveFieldHashCode(buffer, field, tempName);
        } else {
          addFieldHashCode(buffer, field);
        }
        buffer.append('\n');
        resultAssigned = true;
      }
      buffer.append("return ");
      buffer.append(resultName);
      buffer.append("\n}");
    } else {
      buffer.append("return 0\n}");
    }
    PsiMethod hashCode = myFactory.createMethodFromText(buffer.toString());

    try {
      hashCode = ((GrMethod) CodeStyleManager.getInstance(myProject).reformat(hashCode));
    } catch (IncorrectOperationException e) {
      LOG.error(e);
    }

    //      reformatCode(hashCode);
    return hashCode;
  }
@SuppressWarnings("HardCodedStringLiteral")
  private PsiMethod createHashCode()