Program: 101157
Project: 101157
Buggy source:
/** 
 * This methods of the Lifecycle writes into the output writer the content of the portlet 1) Create a RenderInput object and fill it with all the Request information 2) Call the portletContainer.render() method of the Portlet Container to get the HTML generated fragment 3) Then if the current request is an AJAX one, just write in the buffer the content returned by the portlet container 4) If not AJAX, then merge the content with the UIPortlet.gtmpl
 */
public void processRender(UIComponent uicomponent,WebuiRequestContext context) throws Exception {
  UIPortlet uiPortlet=(UIPortlet)uicomponent;
  PortalRequestContext prcontext=(PortalRequestContext)context;
  ExoContainer container=context.getApplication().getApplicationServiceContainer();
  UIPortal uiPortal=Util.getUIPortal();
  PortletContainerService portletContainer=(PortletContainerService)container.getComponentInstanceOfType(PortletContainerService.class);
  OrganizationService service=uicomponent.getApplicationComponent(OrganizationService.class);
  UserProfile userProfile=service.getUserProfileHandler().findUserProfileByName(uiPortal.getOwner());
  RenderInput input=new RenderInput();
  String baseUrl=new StringBuilder(prcontext.getNodeURI()).append("String_Node_Str" + PortalRequestContext.UI_COMPONENT_ID).append("String_Node_Str").append(uiPortlet.getId()).toString();
  input.setBaseURL(baseUrl);
  if (userProfile != null)   input.setUserAttributes(userProfile.getUserInfoMap());
 else   input.setUserAttributes(new HashMap());
  input.setPortletMode(uiPortlet.getCurrentPortletMode());
  input.setWindowState(uiPortlet.getCurrentWindowState());
  input.setMarkup("String_Node_Str");
  input.setTitle(uiPortlet.getTitle());
  input.setInternalWindowID(uiPortlet.getExoWindowID());
  input.setRenderParameters(getRenderParameterMap(uiPortlet));
  input.setPublicParamNames(uiPortlet.getPublicRenderParamNames());
  RenderOutput output=null;
  StringBuilder portletContent=new StringBuilder();
  String portletTitle=null;
  try {
    if (uiPortlet.getCurrentWindowState() != WindowState.MINIMIZED) {
      output=portletContainer.render(prcontext.getRequest(),prcontext.getResponse(),input);
      if (output.getContent() == null) {
        portletContent.append("String_Node_Str").append(uiPortlet.getId()).append("String_Node_Str");
      }
 else {
        portletContent.setLength(0);
        portletContent.append(output.getContent());
      }
    }
  }
 catch (  Throwable ex) {
    ex=ExceptionUtil.getRootCause(ex);
    portletContent.append(ExceptionUtil.getStackTrace(ex,100));
    log.error("String_Node_Str",ex);
  }
  if (output != null) {
    portletTitle=output.getTitle();
    prcontext.setHeaders(output.getHeaderProperties());
  }
  if (portletTitle == null)   portletTitle="String_Node_Str";
  if (context.useAjax() && !prcontext.getFullRender()) {
    context.getWriter().write(portletContent.toString());
  }
 else {
    WebuiApplication app=(WebuiApplication)context.getApplication();
    ApplicationResourceResolver resolver=app.getResourceResolver();
    WebuiBindingContext bcontext=new WebuiBindingContext(resolver,context.getWriter(),uicomponent,context);
    bcontext.put("String_Node_Str",uicomponent);
    bcontext.put("String_Node_Str",portletContent);
    bcontext.put("String_Node_Str",portletTitle);
    try {
      renderTemplate(uicomponent.getTemplate(),bcontext);
    }
 catch (    Throwable ex) {
    }
  }
  try {
    prcontext.getResponse().flushBuffer();
  }
 catch (  Throwable ex) {
  }
}

Fixed version (ground truth):
/** 
 * This methods of the Lifecycle writes into the output writer the content of the portlet 1) Create a RenderInput object and fill it with all the Request information 2) Call the portletContainer.render() method of the Portlet Container to get the HTML generated fragment 3) Then if the current request is an AJAX one, just write in the buffer the content returned by the portlet container 4) If not AJAX, then merge the content with the UIPortlet.gtmpl
 */
public void processRender(UIComponent uicomponent,WebuiRequestContext context) throws Exception {
  UIPortlet uiPortlet=(UIPortlet)uicomponent;
  PortalRequestContext prcontext=(PortalRequestContext)context;
  ExoContainer container=context.getApplication().getApplicationServiceContainer();
  UIPortal uiPortal=Util.getUIPortal();
  PortletContainerService portletContainer=(PortletContainerService)container.getComponentInstanceOfType(PortletContainerService.class);
  OrganizationService service=uicomponent.getApplicationComponent(OrganizationService.class);
  UserProfile userProfile=service.getUserProfileHandler().findUserProfileByName(uiPortal.getOwner());
  RenderInput input=new RenderInput();
  String baseUrl=new StringBuilder(prcontext.getRequestURI()).append("String_Node_Str" + PortalRequestContext.UI_COMPONENT_ID).append("String_Node_Str").append(uiPortlet.getId()).toString();
  input.setBaseURL(baseUrl);
  if (userProfile != null)   input.setUserAttributes(userProfile.getUserInfoMap());
 else   input.setUserAttributes(new HashMap());
  input.setPortletMode(uiPortlet.getCurrentPortletMode());
  input.setWindowState(uiPortlet.getCurrentWindowState());
  input.setMarkup("String_Node_Str");
  input.setTitle(uiPortlet.getTitle());
  input.setInternalWindowID(uiPortlet.getExoWindowID());
  input.setRenderParameters(getRenderParameterMap(uiPortlet));
  input.setPublicParamNames(uiPortlet.getPublicRenderParamNames());
  RenderOutput output=null;
  StringBuilder portletContent=new StringBuilder();
  String portletTitle=null;
  try {
    if (uiPortlet.getCurrentWindowState() != WindowState.MINIMIZED) {
      output=portletContainer.render(prcontext.getRequest(),prcontext.getResponse(),input);
      if (output.getContent() == null) {
        portletContent.append("String_Node_Str").append(uiPortlet.getId()).append("String_Node_Str");
      }
 else {
        portletContent.setLength(0);
        portletContent.append(output.getContent());
      }
    }
  }
 catch (  Throwable ex) {
    ex=ExceptionUtil.getRootCause(ex);
    portletContent.append(ExceptionUtil.getStackTrace(ex,100));
    log.error("String_Node_Str",ex);
  }
  if (output != null) {
    portletTitle=output.getTitle();
    prcontext.setHeaders(output.getHeaderProperties());
  }
  if (portletTitle == null)   portletTitle="String_Node_Str";
  if (context.useAjax() && !prcontext.getFullRender()) {
    context.getWriter().write(portletContent.toString());
  }
 else {
    WebuiApplication app=(WebuiApplication)context.getApplication();
    ApplicationResourceResolver resolver=app.getResourceResolver();
    WebuiBindingContext bcontext=new WebuiBindingContext(resolver,context.getWriter(),uicomponent,context);
    bcontext.put("String_Node_Str",uicomponent);
    bcontext.put("String_Node_Str",portletContent);
    bcontext.put("String_Node_Str",portletTitle);
    try {
      renderTemplate(uicomponent.getTemplate(),bcontext);
    }
 catch (    Throwable ex) {
    }
  }
  try {
    prcontext.getResponse().flushBuffer();
  }
 catch (  Throwable ex) {
  }
}