Program: 9888
Project: 9888
Buggy source:
public void savePage(UIEditInlineWorkspace editInlineWS,Event<?> event) throws Exception {
  UIWorkingWorkspace uiWorkingWS=editInlineWS.getParent();
  UIPortalToolPanel uiToolPanel=uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
  UIPortalComposer composer=uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class);
  UIPortalApplication uiPortalApp=Util.getUIPortalApplication();
  UIPortal uiPortal=uiPortalApp.getCurrentSite();
  DataStorage dataService=uiWorkingWS.getApplicationComponent(DataStorage.class);
  PageService pageService=uiWorkingWS.getApplicationComponent(PageService.class);
  UIPage uiPage=uiToolPanel.findFirstComponentOfType(UIPage.class);
  Page page=(Page)PortalDataMapper.buildModelObject(uiPage);
  String pageId=page.getPageId();
  PageKey pageKey=PageKey.parse(pageId);
  PageState pageState=PageUtils.toPageState(page);
  PageContext pageContext=new PageContext(pageKey,pageState);
  pageService.savePage(pageContext);
  dataService.save(page);
  composer.setEditted(false);
  uiToolPanel.setUIComponent(null);
  uiPortalApp.refreshCachedUI();
  if (PortalProperties.SESSION_ALWAYS.equals(uiPortal.getSessionAlive())) {
    uiPortalApp.setSessionOpen(true);
  }
 else {
    uiPortalApp.setSessionOpen(false);
  }
  uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
  uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
  Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);
  UserNode currentNode=uiPortal.getSelectedUserNode();
  PageNodeEvent<UIPortalApplication> pnevent=new PageNodeEvent<UIPortalApplication>(uiPortalApp,PageNodeEvent.CHANGE_NODE,currentNode.getNavigation().getKey(),currentNode.getURI());
  uiPortalApp.broadcast(pnevent,Event.Phase.PROCESS);
  Util.updatePortalMode();
}

Fixed version (ground truth):
public void savePage(UIEditInlineWorkspace editInlineWS,Event<?> event) throws Exception {
  UIWorkingWorkspace uiWorkingWS=editInlineWS.getParent();
  UIPortalToolPanel uiToolPanel=uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
  UIPortalComposer composer=uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class);
  UIPortalApplication uiPortalApp=Util.getUIPortalApplication();
  UIPortal uiPortal=uiPortalApp.getCurrentSite();
  DataStorage dataService=uiWorkingWS.getApplicationComponent(DataStorage.class);
  PageService pageService=uiWorkingWS.getApplicationComponent(PageService.class);
  UIPage uiPage;
  if (!UIPage.isFullPreview()) {
    uiPage=uiToolPanel.findFirstComponentOfType(UIPage.class);
  }
 else {
    uiPage=uiWorkingWS.findFirstComponentOfType(UIPage.class);
  }
  Page page=(Page)PortalDataMapper.buildModelObject(uiPage);
  String pageId=page.getPageId();
  PageKey pageKey=PageKey.parse(pageId);
  PageState pageState=PageUtils.toPageState(page);
  PageContext pageContext=new PageContext(pageKey,pageState);
  pageService.savePage(pageContext);
  dataService.save(page);
  composer.setEditted(false);
  uiToolPanel.setUIComponent(null);
  uiPortalApp.refreshCachedUI();
  if (PortalProperties.SESSION_ALWAYS.equals(uiPortal.getSessionAlive())) {
    uiPortalApp.setSessionOpen(true);
  }
 else {
    uiPortalApp.setSessionOpen(false);
  }
  uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
  uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
  Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);
  UserNode currentNode=uiPortal.getSelectedUserNode();
  PageNodeEvent<UIPortalApplication> pnevent=new PageNodeEvent<UIPortalApplication>(uiPortalApp,PageNodeEvent.CHANGE_NODE,currentNode.getNavigation().getKey(),currentNode.getURI());
  uiPortalApp.broadcast(pnevent,Event.Phase.PROCESS);
  Util.updatePortalMode();
}