Program: 51617
Project: 51617
Buggy source:
/** 
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
 * @param request servlet request
 * @param response servlet response
 */
protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, java.io.IOException {
  String queryName=request.getParameter("String_Node_Str");
  request.setAttribute("String_Node_Str",queryName);
  if (queryName != null) {
    processTransform(request,response);
    return;
  }
  String queryString=request.getParameter("String_Node_Str");
  request.setAttribute("String_Node_Str",queryString);
  mondrian.olap.Connection mdxConnection=null;
  StringBuffer html=new StringBuffer();
  try {
    mdxConnection=DriverManager.getConnection(connectString,getServletContext(),false);
    Query q=mdxConnection.parseQuery(queryString);
    Result result=mdxConnection.execute(q);
    Position slicers[]=result.getSlicerAxis().positions;
    html.append("String_Node_Str");
    final String nl=System.getProperty("String_Node_Str");
    html.append(nl);
    Position[] columns=result.getAxes()[0].positions;
    Position[] rows=null;
    if (result.getAxes().length == 2)     rows=result.getAxes()[1].positions;
    int columnWidth=columns[0].members.length;
    int rowWidth=0;
    if (result.getAxes().length == 2)     rowWidth=result.getAxes()[1].positions[0].members.length;
    for (int j=0; j < columnWidth; j++) {
      if (j == 0) {
        html.append("String_Node_Str" + columnWidth + "String_Node_Str"+ rowWidth+ "String_Node_Str");
        for (int i=0; i < slicers.length; i++) {
          Position position=slicers[i];
          for (int k=0; k < position.members.length; k++) {
            if (k > 0) {
              html.append("String_Node_Str");
            }
            Member member=position.members[k];
            html.append(member.getUniqueName());
          }
        }
        html.append("String_Node_Str" + nl);
      }
 else {
        html.append("String_Node_Str");
      }
      for (int i=0; i < columns.length; i++) {
        Member member=columns[i].members[j];
        int width=1;
        while ((i + 1) < columns.length && columns[i + 1].members[j] == member) {
          i++;
          width++;
        }
        html.append("String_Node_Str" + width + "String_Node_Str"+ member.getUniqueName()+ "String_Node_Str");
      }
      html.append("String_Node_Str" + nl);
    }
    if (result.getAxes().length > 1) {
      for (int i=0; i < rows.length; i++) {
        html.append("String_Node_Str");
        final Position row=rows[i];
        for (int j=0; j < row.members.length; j++) {
          Member member=row.members[j];
          html.append("String_Node_Str" + member.getUniqueName() + "String_Node_Str");
        }
        for (int j=0; j < columns.length; j++) {
          Cell cell=result.getCell(new int[]{j,i});
          html.append("String_Node_Str" + cell.getFormattedValue() + "String_Node_Str");
        }
        html.append("String_Node_Str");
      }
    }
 else {
      for (int i=0; i < columns.length; i++) {
        Cell cell=result.getCell(new int[]{i});
        html.append("String_Node_Str" + cell.getFormattedValue() + "String_Node_Str");
      }
    }
    html.append("String_Node_Str");
  }
 catch (  Throwable e) {
    final String[] strings=Util.convertStackToString(e);
    html.append("String_Node_Str");
    for (int i=0; i < strings.length; i++) {
      StringEscaper.htmlEscaper.appendEscapedString(strings[i],html);
    }
    html.append("String_Node_Str");
  }
 finally {
    if (mdxConnection != null) {
      mdxConnection.close();
    }
  }
  request.setAttribute("String_Node_Str",html.toString());
  response.setHeader("String_Node_Str","String_Node_Str");
  getServletContext().getRequestDispatcher("String_Node_Str").include(request,response);
}

Fixed version (ground truth):
/** 
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
 * @param request servlet request
 * @param response servlet response
 */
protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, java.io.IOException {
  String queryName=request.getParameter("String_Node_Str");
  request.setAttribute("String_Node_Str",queryName);
  if (queryName != null) {
    processTransform(request,response);
    return;
  }
  String queryString=request.getParameter("String_Node_Str");
  request.setAttribute("String_Node_Str",queryString);
  mondrian.olap.Connection mdxConnection=null;
  StringBuffer html=new StringBuffer();
  try {
    mdxConnection=DriverManager.getConnection(connectString,getServletContext(),false);
    Query q=mdxConnection.parseQuery(queryString);
    Result result=mdxConnection.execute(q);
    Position slicers[]=result.getSlicerAxis().positions;
    html.append("String_Node_Str");
    final String nl=System.getProperty("String_Node_Str");
    html.append(nl);
    Position[] columns=result.getAxes()[0].positions;
    Position[] rows=null;
    if (result.getAxes().length == 2)     rows=result.getAxes()[1].positions;
    int columnWidth=columns[0].members.length;
    int rowWidth=0;
    if (result.getAxes().length == 2)     rowWidth=result.getAxes()[1].positions[0].members.length;
    for (int j=0; j < columnWidth; j++) {
      html.append("String_Node_Str");
      if (j == 0 && result.getAxes().length > 1) {
        html.append("String_Node_Str" + columnWidth + "String_Node_Str"+ rowWidth+ "String_Node_Str");
        for (int i=0; i < slicers.length; i++) {
          Position position=slicers[i];
          for (int k=0; k < position.members.length; k++) {
            if (k > 0) {
              html.append("String_Node_Str");
            }
            Member member=position.members[k];
            html.append(member.getUniqueName());
          }
        }
        html.append("String_Node_Str" + nl);
      }
      for (int i=0; i < columns.length; i++) {
        Member member=columns[i].members[j];
        int width=1;
        while ((i + 1) < columns.length && columns[i + 1].members[j] == member) {
          i++;
          width++;
        }
        html.append("String_Node_Str" + width + "String_Node_Str"+ member.getUniqueName()+ "String_Node_Str");
      }
      html.append("String_Node_Str" + nl);
    }
    if (result.getAxes().length > 1) {
      for (int i=0; i < rows.length; i++) {
        html.append("String_Node_Str");
        final Position row=rows[i];
        for (int j=0; j < row.members.length; j++) {
          Member member=row.members[j];
          html.append("String_Node_Str" + member.getUniqueName() + "String_Node_Str");
        }
        for (int j=0; j < columns.length; j++) {
          showCell(html,result.getCell(new int[]{j,i}));
        }
        html.append("String_Node_Str");
      }
    }
 else {
      html.append("String_Node_Str");
      for (int i=0; i < columns.length; i++) {
        showCell(html,result.getCell(new int[]{i}));
      }
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
  }
 catch (  Throwable e) {
    final String[] strings=Util.convertStackToString(e);
    html.append("String_Node_Str");
    for (int i=0; i < strings.length; i++) {
      StringEscaper.htmlEscaper.appendEscapedString(strings[i],html);
    }
    html.append("String_Node_Str");
  }
 finally {
    if (mdxConnection != null) {
      mdxConnection.close();
    }
  }
  request.setAttribute("String_Node_Str",html.toString());
  response.setHeader("String_Node_Str","String_Node_Str");
  getServletContext().getRequestDispatcher("String_Node_Str").include(request,response);
}