Program: 69964
Project: 69964
Buggy source:
/** 
 * @param browser
 * @param portletCss
 * @param columnCount the count of columns to scan for
 * @return the x and y position of the portlet, the result may be null ifthe portlet is inactive or doesn't exists. Find the position of the portlet within the portal.
 */
public int[] findPortletPosition(Selenium browser,String portletCss,int columnCount){
  for (int i=0; i < columnCount; i++) {
    StringBuffer selectorBuffer=new StringBuffer();
    selectorBuffer.append("String_Node_Str").append(getPortalCss()).append('.').append(getPortalSubcolumnsCss()).append("String_Node_Str").append(getPortalColumnCssPrefix()).append(i + 1).append("String_Node_Str").append(getPortletCss()).append('.').append(getPortletEditCss()).append('.').append(portletCss);
    if (browser.isElementPresent(selectorBuffer.toString())) {
      int position[]=new int[2];
      position[0]=i;
      selectorBuffer=new StringBuffer();
      selectorBuffer.append("String_Node_Str").append(getPortalCss()).append("String_Node_Str").append(getPortalColumnCssPrefix()).append(i + 1).append("String_Node_Str").append(getPortletCss());
      VelocityContext context=new VelocityContext();
      context.put("String_Node_Str",getPortalCss());
      context.put("String_Node_Str",getPortalSubcolumnsCss());
      context.put("String_Node_Str",getPortletCss());
      context.put("String_Node_Str",portletCss);
      context.put("String_Node_Str",i);
      context.put("String_Node_Str",browser.getCssCount(selectorBuffer.toString()).intValue());
      VelocityEngine engine=null;
      engine=new VelocityEngine();
      StringWriter sw=new StringWriter();
      try {
        engine.evaluate(context,sw,"String_Node_Str",FunctionalHomeSiteUtil.class.getResourceAsStream("String_Node_Str"));
        Integer j=new Integer(browser.getEval(sw.toString()));
        position[1]=j.intValue();
        return (position);
      }
 catch (      ParseErrorException e) {
        e.printStackTrace();
      }
catch (      MethodInvocationException e) {
        e.printStackTrace();
      }
catch (      ResourceNotFoundException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      return (null);
    }
  }
  return (null);
}

Fixed version (ground truth):
/** 
 * @param browser
 * @param portletCss
 * @param columnCount the count of columns to scan for
 * @return the x and y position of the portlet, the result may be null ifthe portlet is inactive or doesn't exists. Find the position of the portlet within the portal.
 */
public int[] findPortletPosition(Selenium browser,String portletCss,int columnCount){
  for (int i=0; i < columnCount; i++) {
    StringBuffer selectorBuffer=new StringBuffer();
    selectorBuffer.append("String_Node_Str").append(getPortalCss()).append('.').append(getPortalSubcolumnsCss()).append("String_Node_Str").append(getPortalColumnCssPrefix()).append(i + 1).append("String_Node_Str").append(getPortletCss()).append('.').append(getPortletEditCss()).append('.').append(portletCss);
    if (browser.isElementPresent(selectorBuffer.toString())) {
      int position[]=new int[2];
      position[0]=i;
      selectorBuffer=new StringBuffer();
      selectorBuffer.append("String_Node_Str").append(getPortalCss()).append("String_Node_Str").append(getPortalColumnCssPrefix()).append(i + 1).append("String_Node_Str").append(getPortletCss());
      VelocityContext context=new VelocityContext();
      context.put("String_Node_Str",getPortalCss());
      context.put("String_Node_Str",getPortalSubcolumnsCss());
      context.put("String_Node_Str",getPortletCss());
      context.put("String_Node_Str",getPortalColumnCssPrefix());
      context.put("String_Node_Str",portletCss);
      context.put("String_Node_Str",i);
      context.put("String_Node_Str",browser.getCssCount(selectorBuffer.toString()).intValue());
      VelocityEngine engine=null;
      engine=new VelocityEngine();
      StringWriter sw=new StringWriter();
      try {
        engine.evaluate(context,sw,"String_Node_Str",FunctionalHomeSiteUtil.class.getResourceAsStream("String_Node_Str"));
        Integer j=new Integer(browser.getEval(sw.toString()));
        position[1]=j.intValue();
        return (position);
      }
 catch (      ParseErrorException e) {
        e.printStackTrace();
      }
catch (      MethodInvocationException e) {
        e.printStackTrace();
      }
catch (      ResourceNotFoundException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      return (null);
    }
  }
  return (null);
}