Program: 135778
Project: 135778
Buggy source:
protected void populateViewContext(String path,PortletRequest portletRequest,PortletResponse portletResponse,Template template,TemplateHashModel staticModels) throws Exception {
  ThemeDisplay themeDisplay=(ThemeDisplay)portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
  PortletPreferences portletPreferences=portletRequest.getPreferences();
  long assetEntryIdDefault=GetterUtil.getLong(portletPreferences.getValue("String_Node_Str",null));
  boolean contentDefaultValue=GetterUtil.getBoolean(portletPreferences.getValue("String_Node_Str",null));
  if (Validator.isNull(path) || path.equals(CampaignContentDisplayPath.VIEW)) {
    CampaignQueryRule queryRule=null;
    long[] userSegmentIds=(long[])portletRequest.getAttribute(WebKeys.USER_SEGMENT_IDS);
    if (userSegmentIds != null) {
      long[] groupIds=ContentTargetingUtil.getAncestorsAndCurrentGroupIds(themeDisplay.getSiteGroupId());
      Campaign campaign=_campaignLocalService.fetchCurrentMaxPriorityCampaign(groupIds,userSegmentIds);
      if (campaign != null) {
        queryRule=CampaignQueryRuleUtil.match(campaign.getCampaignId(),portletPreferences,themeDisplay.getLocale());
        template.put("String_Node_Str",Campaign.class.getName());
        template.put("String_Node_Str",campaign.getCampaignId());
        template.put("String_Node_Str",campaign.getGroupId());
      }
    }
    boolean isMatchingRule=false;
    if ((queryRule != null) || (contentDefaultValue && (assetEntryIdDefault > 0))) {
      isMatchingRule=true;
      long assetEntryId=assetEntryIdDefault;
      if (queryRule != null) {
        assetEntryId=queryRule.getAssetEntryId();
      }
      AssetEntry assetEntry=AssetEntryLocalServiceUtil.fetchAssetEntry(assetEntryId);
      AssetRendererFactory assetRendererFactory=AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(assetEntry.getClassName());
      AssetRenderer assetRenderer=assetRendererFactory.getAssetRenderer(assetEntry.getClassPK());
      portletRequest.setAttribute("String_Node_Str",new ArrayList());
      portletRequest.setAttribute("String_Node_Str",new Integer(0));
      portletRequest.setAttribute("String_Node_Str",assetEntry);
      portletRequest.setAttribute("String_Node_Str",assetRendererFactory);
      portletRequest.setAttribute("String_Node_Str",assetRenderer);
      portletRequest.setAttribute("String_Node_Str",assetEntry.getTitle(themeDisplay.getLocale()));
      portletRequest.setAttribute("String_Node_Str",new Boolean(false));
      portletRequest.setAttribute("String_Node_Str",new Boolean(false));
      template.put("String_Node_Str",assetEntry.getClassName());
      template.put("String_Node_Str",assetEntry.getClassPK());
    }
 else {
      portletRequest.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,Boolean.TRUE);
    }
    template.put("String_Node_Str",isMatchingRule);
    template.put("String_Node_Str",LiferayWindowState.POP_UP);
  }
 else   if (path.equals(CampaignContentDisplayPath.EDIT_QUERY_RULE) || path.equals(CampaignContentDisplayPath.CONFIGURATION)) {
    template.put("String_Node_Str",getSelectableAssetRendererFactories(themeDisplay.getCompanyId()));
    String assetImageDefault=StringPool.BLANK;
    String assetTitleDefault=StringPool.BLANK;
    String assetTypeDefault=StringPool.BLANK;
    if (assetEntryIdDefault > 0) {
      AssetEntry assetEntry=AssetEntryLocalServiceUtil.fetchAssetEntry(assetEntryIdDefault);
      AssetRendererFactory assetRendererFactory=AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(assetEntry.getClassName());
      AssetRenderer assetRenderer=assetRendererFactory.getAssetRenderer(assetEntry.getClassPK());
      assetImageDefault=assetRenderer.getThumbnailPath(portletRequest);
      assetTitleDefault=assetRenderer.getTitle(themeDisplay.getLocale());
      assetTypeDefault=assetRendererFactory.getTypeName(themeDisplay.getLocale(),true);
    }
    List<Campaign> campaigns=_campaignService.getCampaigns(themeDisplay.getScopeGroupId());
    template.put("String_Node_Str",campaigns);
    template.put("String_Node_Str",assetEntryIdDefault);
    template.put("String_Node_Str",assetImageDefault);
    template.put("String_Node_Str",assetTitleDefault);
    template.put("String_Node_Str",assetTypeDefault);
    template.put("String_Node_Str",contentDefaultValue);
    template.put("String_Node_Str",LiferayWindowState.EXCLUSIVE);
    template.put("String_Node_Str",portletPreferences);
    int[] queryRulesIndexes=GetterUtil.getIntegerValues(portletPreferences.getValues("String_Node_Str",null),new int[]{0});
    template.put("String_Node_Str",queryRulesIndexes);
    template.put("String_Node_Str",staticModels.get("String_Node_Str" + "String_Node_Str"));
    template.put("String_Node_Str",staticModels.get("String_Node_Str" + "String_Node_Str"));
  }
}

Fixed version (ground truth):
protected void populateViewContext(String path,PortletRequest portletRequest,PortletResponse portletResponse,Template template,TemplateHashModel staticModels) throws Exception {
  ThemeDisplay themeDisplay=(ThemeDisplay)portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
  PortletPreferences portletPreferences=portletRequest.getPreferences();
  long assetEntryIdDefault=GetterUtil.getLong(portletPreferences.getValue("String_Node_Str",null));
  boolean contentDefaultValue=GetterUtil.getBoolean(portletPreferences.getValue("String_Node_Str",null));
  if (Validator.isNull(path) || path.equals(CampaignContentDisplayPath.VIEW)) {
    CampaignQueryRule queryRule=null;
    long[] userSegmentIds=(long[])portletRequest.getAttribute(WebKeys.USER_SEGMENT_IDS);
    if (userSegmentIds != null) {
      long[] groupIds=ContentTargetingUtil.getAncestorsAndCurrentGroupIds(themeDisplay.getSiteGroupId());
      Campaign campaign=_campaignLocalService.fetchCurrentMaxPriorityCampaign(groupIds,userSegmentIds);
      if (campaign != null) {
        queryRule=CampaignQueryRuleUtil.match(campaign.getCampaignId(),portletPreferences,themeDisplay.getLocale());
        template.put("String_Node_Str",Campaign.class.getName());
        template.put("String_Node_Str",campaign.getCampaignId());
        template.put("String_Node_Str",campaign.getGroupId());
      }
    }
    boolean isMatchingRule=false;
    if ((queryRule != null) || (contentDefaultValue && (assetEntryIdDefault > 0))) {
      isMatchingRule=true;
      long assetEntryId=assetEntryIdDefault;
      if (queryRule != null) {
        assetEntryId=queryRule.getAssetEntryId();
      }
      AssetEntry assetEntry=AssetEntryLocalServiceUtil.fetchAssetEntry(assetEntryId);
      AssetRendererFactory assetRendererFactory=AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(assetEntry.getClassName());
      AssetRenderer assetRenderer=assetRendererFactory.getAssetRenderer(assetEntry.getClassPK());
      portletRequest.setAttribute("String_Node_Str",new ArrayList());
      portletRequest.setAttribute("String_Node_Str",new Integer(0));
      portletRequest.setAttribute("String_Node_Str",assetEntry);
      portletRequest.setAttribute("String_Node_Str",assetRendererFactory);
      portletRequest.setAttribute("String_Node_Str",assetRenderer);
      portletRequest.setAttribute("String_Node_Str",assetEntry.getTitle(themeDisplay.getLocale()));
      portletRequest.setAttribute("String_Node_Str",new Boolean(false));
      portletRequest.setAttribute("String_Node_Str",new Boolean(false));
      template.put("String_Node_Str",assetEntry.getClassName());
      template.put("String_Node_Str",assetEntry.getClassPK());
    }
 else {
      portletRequest.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,Boolean.TRUE);
    }
    template.put("String_Node_Str",isMatchingRule);
    template.put("String_Node_Str",LiferayWindowState.POP_UP);
  }
 else   if (path.equals(CampaignContentDisplayPath.EDIT_QUERY_RULE) || path.equals(CampaignContentDisplayPath.CONFIGURATION)) {
    template.put("String_Node_Str",getSelectableAssetRendererFactories(themeDisplay.getCompanyId()));
    String assetImageDefault=StringPool.BLANK;
    String assetTitleDefault=StringPool.BLANK;
    String assetTypeDefault=StringPool.BLANK;
    if (assetEntryIdDefault > 0) {
      AssetEntry assetEntry=AssetEntryLocalServiceUtil.fetchAssetEntry(assetEntryIdDefault);
      AssetRendererFactory assetRendererFactory=AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(assetEntry.getClassName());
      AssetRenderer assetRenderer=assetRendererFactory.getAssetRenderer(assetEntry.getClassPK());
      assetImageDefault=assetRenderer.getThumbnailPath(portletRequest);
      assetTitleDefault=assetRenderer.getTitle(themeDisplay.getLocale());
      assetTypeDefault=assetRendererFactory.getTypeName(themeDisplay.getLocale(),true);
    }
    List<Campaign> campaigns=_campaignService.getCampaigns(themeDisplay.getScopeGroupId());
    template.put("String_Node_Str",campaigns);
    template.put("String_Node_Str",assetEntryIdDefault);
    template.put("String_Node_Str",assetImageDefault);
    template.put("String_Node_Str",assetTitleDefault);
    template.put("String_Node_Str",assetTypeDefault);
    template.put("String_Node_Str",contentDefaultValue);
    template.put("String_Node_Str",LiferayWindowState.EXCLUSIVE);
    template.put("String_Node_Str",portletPreferences);
    int[] queryRulesIndexes=GetterUtil.getIntegerValues(portletPreferences.getValues("String_Node_Str",null),new int[0]);
    template.put("String_Node_Str",queryRulesIndexes);
    template.put("String_Node_Str",staticModels.get("String_Node_Str" + "String_Node_Str"));
    template.put("String_Node_Str",staticModels.get("String_Node_Str" + "String_Node_Str"));
  }
}