Program: 90641
Project: 90641
Buggy source:
/** 
 * Parse a servlet request to a portal URL.
 * @param request  the servlet request to parse.
 * @return the portal URL.
 */
public PortalURL parse(HttpServletRequest request){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + request.getRequestURI());
  }
  String contextPath=request.getContextPath();
  String servletName=request.getServletPath();
  PortalURL portalURL=new RelativePortalURLImpl(contextPath,servletName,this);
  String pathInfo=request.getPathInfo();
  if (pathInfo == null) {
    if (servletName.contains("String_Node_Str") && !servletName.endsWith("String_Node_Str")) {
      int idx=servletName.indexOf("String_Node_Str") + "String_Node_Str".length();
      pathInfo=servletName.substring(idx);
      servletName=servletName.substring(0,idx);
      portalURL=new RelativePortalURLImpl(contextPath,servletName,this);
    }
 else {
      return portalURL;
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + pathInfo);
  }
  StringBuffer renderPath=new StringBuffer();
  StringTokenizer st=new StringTokenizer(pathInfo,"String_Node_Str",false);
  while (st.hasMoreTokens()) {
    String token=st.nextToken();
    if (!token.startsWith(PREFIX)) {
      renderPath.append('/').append(token);
    }
 else     if (token.startsWith(PREFIX + RESOURCE)) {
      portalURL.setResourceWindow(decodeControlParameter(token)[0]);
    }
 else     if (token.startsWith(PREFIX + ACTION)) {
      portalURL.setActionWindow(decodeControlParameter(token)[0]);
    }
 else     if (token.startsWith(PREFIX + WINDOW_STATE)) {
      String[] decoded=decodeControlParameter(token);
      portalURL.setWindowState(decoded[0],new WindowState(decoded[1]));
    }
 else     if (token.startsWith(PREFIX + PORTLET_MODE)) {
      String[] decoded=decodeControlParameter(token);
      portalURL.setPortletMode(decoded[0],new PortletMode(decoded[1]));
    }
 else     if (token.startsWith(PREFIX + RENDER_PARAM)) {
      String value=null;
      if (st.hasMoreTokens()) {
        value=st.nextToken();
      }
      PortalURLParameter param=decodeParameter(token,value);
      portalURL.addParameter(param);
    }
 else {
      String value=null;
      if (st.hasMoreTokens()) {
        value=st.nextToken();
      }
      PortalURLParameter param=decodePublicParameter(token,value);
      if (param != null) {
        portalURL.addParameter(param);
      }
      portalURL.addPublicParameterCurrent(param.getName(),param.getValues());
    }
  }
  if (renderPath.length() > 0) {
    portalURL.setRenderPath(renderPath.toString());
  }
  return portalURL;
}

Fixed version (ground truth):
/** 
 * Parse a servlet request to a portal URL.
 * @param request  the servlet request to parse.
 * @return the portal URL.
 */
public PortalURL parse(HttpServletRequest request){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + request.getRequestURI());
  }
  String contextPath=request.getContextPath();
  String servletName=request.getServletPath();
  PortalURL portalURL=new RelativePortalURLImpl(contextPath,servletName,this);
  String pathInfo=request.getPathInfo();
  if (pathInfo == null) {
    if (servletName.contains("String_Node_Str") && !servletName.endsWith("String_Node_Str")) {
      int idx=servletName.indexOf("String_Node_Str") + "String_Node_Str".length();
      pathInfo=servletName.substring(idx);
      servletName=servletName.substring(0,idx);
      portalURL=new RelativePortalURLImpl(contextPath,servletName,this);
    }
 else {
      return portalURL;
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + pathInfo);
  }
  StringBuffer renderPath=new StringBuffer();
  StringTokenizer st=new StringTokenizer(pathInfo,"String_Node_Str",false);
  while (st.hasMoreTokens()) {
    String token=st.nextToken();
    if (!token.startsWith(PREFIX)) {
      renderPath.append('/').append(token);
    }
 else     if (token.startsWith(PREFIX + RESOURCE)) {
      portalURL.setResourceWindow(decodeControlParameter(token)[0]);
    }
 else     if (token.startsWith(PREFIX + ACTION)) {
      portalURL.setActionWindow(decodeControlParameter(token)[0]);
    }
 else     if (token.startsWith(PREFIX + WINDOW_STATE)) {
      String[] decoded=decodeControlParameter(token);
      portalURL.setWindowState(decoded[0],new WindowState(decoded[1]));
    }
 else     if (token.startsWith(PREFIX + PORTLET_MODE)) {
      String[] decoded=decodeControlParameter(token);
      portalURL.setPortletMode(decoded[0],new PortletMode(decoded[1]));
    }
 else     if (token.startsWith(PREFIX + RENDER_PARAM)) {
      String value=null;
      if (st.hasMoreTokens()) {
        value=st.nextToken();
      }
      PortalURLParameter param=decodeParameter(token,value);
      portalURL.addParameter(param);
    }
 else {
      String value=null;
      if (st.hasMoreTokens()) {
        value=st.nextToken();
      }
      PortalURLParameter param=decodePublicParameter(token,value);
      if (param != null) {
        portalURL.addPublicParameterCurrent(param.getName(),param.getValues());
      }
    }
  }
  if (renderPath.length() > 0) {
    portalURL.setRenderPath(renderPath.toString());
  }
  return portalURL;
}