cd.setNewPortletMode(null);
if (rd.isTargeted() && psm.isAction() && !cd.hasProcessedAction()) {
try {</BUG>
PrintWriter pw = new PrintWriter(new NullOutputStream());
<BUG>HttpServletResponse wrappedResponse = ServletObjectAccess.getStoredServletResponse(pcs.getHttpServletResponse(), pw);
final String newWindowStateName = wrappedRequest.getParameter(PortletStateManager.UP_WINDOW_STATE);</BUG>
if (newWindowStateName != null) {
pap.changePortletWindowState(new WindowState(newWindowStateName));
}
HttpServletRequest wrappedPortletRequest = new PortletParameterRequestWrapper(wrappedRequest);

cd.setNewPortletMode(null);
if (rd.isTargeted() && psm.isAction()) {
PrintWriter pw = new PrintWriter(new NullOutputStream());
HttpServletResponse wrappedResponse = ServletObjectAccess.getStoredServletResponse(pcs.getHttpServletResponse(), pw);
try {
final String newWindowStateName = wrappedRequest.getParameter(PortletStateManager.UP_WINDOW_STATE);
if (newWindowStateName != null) {
pap.changePortletWindowState(new WindowState(newWindowStateName));
}
HttpServletRequest wrappedPortletRequest = new PortletParameterRequestWrapper(wrappedRequest);
