private Indent calcIndent(final ASTNode child, final int state) {
    if (state == AFTER_ELSE && child.getElementType() == JavaElementType.IF_STATEMENT) {
      if (mySettings.SPECIAL_ELSE_IF_TREATMENT) {
        return Indent.getNoneIndent();
      } else {
        return getCodeBlockInternalIndent(1);
      }
    }
    if (isSimpleStatement(child)){
      return createNormalIndent();
    }
    if (child.getElementType() == JavaTokenType.ELSE_KEYWORD)
      return Indent.getNoneIndent();
    if (state == BEFORE_FIRST || child.getElementType() == JavaTokenType.WHILE_KEYWORD) {
      return Indent.getNoneIndent();
    }
    else {
      if (isPartOfCodeBlock(child)) {
        return getCodeBlockExternalIndent();
      }
      else if (isSimpleStatement(child) || StdTokenSets.COMMENT_BIT_SET.contains(child.getElementType())){
        return getCodeBlockInternalIndent(1);
      }
      else if (isNodeParentMethod(child) &&
               (child.getElementType() == JavaElementType.TYPE
                || child.getElementType() == JavaTokenType.IDENTIFIER
                || child.getElementType() == JavaElementType.THROWS_LIST
                || child.getElementType() == JavaElementType.TYPE_PARAMETER_LIST)) {
        return Indent.getNoneIndent();
      }
      else if (child.getElementType() == JavaTokenType.LPARENTH || child.getElementType() == JavaTokenType.RPARENTH) {
        return Indent.getNoneIndent();
      }
      else {
        return Indent.getContinuationIndent(myIndentSettings.USE_RELATIVE_INDENTS);
      }
    }
  }
private Indent calcIndent(final ASTNode child, final int state)