Program: 78877
Project: 78877
Buggy source:
/** 
 * @param object
 */
private static Object doPalette(Object object,String type){
  assert(object instanceof PaletteRoot);
  PaletteRoot root=(PaletteRoot)object;
  List list=root.getChildren();
  List exts=ExtensionPointManager.getInstance().getExtendedElementPoints();
  if (exts == null) {
    return root;
  }
  for (Iterator itor=exts.iterator(); itor.hasNext(); ) {
    ExtendedElementUIPoint point=(ExtendedElementUIPoint)itor.next();
    if (point == null) {
      return root;
    }
    String category=(String)point.getAttribute(IExtensionConstants.ATTRIBUTE_PALETTE_CATEGORY);
    ImageDescriptor icon=(ImageDescriptor)point.getAttribute(IExtensionConstants.ATTRIBUTE_KEY_PALETTE_ICON);
    IReportItemFigureProvider UI=point.getReportItemUI();
    if (UI == null) {
      return root;
    }
    if (PALETTE_DESIGNER.equals(type)) {
      Boolean bool=(Boolean)point.getAttribute(IExtensionConstants.ATTRIBUTE_EDITOR_SHOW_IN_DESIGNER);
      if (!bool.booleanValue()) {
        continue;
      }
    }
 else     if (PALETTE_MASTERPAGE.equals(type)) {
      Boolean bool=(Boolean)point.getAttribute(IExtensionConstants.ATTRIBUTE_EDITOR_SHOW_IN_MASTERPAGE);
      if (!bool.booleanValue()) {
        continue;
      }
    }
    String displayName=DesignEngine.getMetaDataDictionary().getExtension(point.getExtensionName()).getDisplayName();
    CombinedTemplateCreationEntry combined=new ReportCombinedTemplateCreationEntry(displayName,Messages.getFormattedString("String_Node_Str",new Object[]{displayName}),getExtendedPalletTemplateName(point),new ReportElementFactory(IReportElementConstants.REPORT_ELEMENT_EXTENDED + point.getExtensionName()),icon,icon,BasePaletteFactory.getAbstractToolHandleExtendsFromPalletName(getExtendedPalletTemplateName(point)));
    PaletteContainer entry=findCategory(list,category);
    if (entry == null) {
      String categoryLabel=(String)point.getAttribute(IExtensionConstants.ATTRIBUTE_PALETTE_CATEGORY_DISPLAYNAME);
      if (categoryLabel == null) {
        categoryLabel=category;
      }
      entry=new PaletteCategory(category,categoryLabel,null);
      root.add(entry);
    }
    entry.add(combined);
  }
  return root;
}

Fixed version (ground truth):
/** 
 * @param object
 */
private static Object doPalette(Object object,String type){
  assert(object instanceof PaletteRoot);
  PaletteRoot root=(PaletteRoot)object;
  List list=root.getChildren();
  List exts=ExtensionPointManager.getInstance().getExtendedElementPoints();
  if (exts == null) {
    return root;
  }
  for (Iterator itor=exts.iterator(); itor.hasNext(); ) {
    ExtendedElementUIPoint point=(ExtendedElementUIPoint)itor.next();
    if (point == null) {
      return root;
    }
    String category=(String)point.getAttribute(IExtensionConstants.ATTRIBUTE_PALETTE_CATEGORY);
    ImageDescriptor icon=(ImageDescriptor)point.getAttribute(IExtensionConstants.ATTRIBUTE_KEY_PALETTE_ICON);
    IReportItemFigureProvider UI=point.getReportItemUI();
    if (UI == null) {
      return root;
    }
    if (PALETTE_DESIGNER.equals(type)) {
      Boolean bool=(Boolean)point.getAttribute(IExtensionConstants.ATTRIBUTE_EDITOR_SHOW_IN_DESIGNER);
      if (!bool.booleanValue()) {
        continue;
      }
    }
 else     if (PALETTE_MASTERPAGE.equals(type)) {
      Boolean bool=(Boolean)point.getAttribute(IExtensionConstants.ATTRIBUTE_EDITOR_SHOW_IN_MASTERPAGE);
      if (!bool.booleanValue()) {
        continue;
      }
    }
    String displayName=DesignEngine.getMetaDataDictionary().getExtension(point.getExtensionName()).getDisplayName();
    CombinedTemplateCreationEntry combined=new ReportCombinedTemplateCreationEntry(displayName,Messages.getFormattedString("String_Node_Str",new Object[]{displayName}),getExtendedPalletTemplateName(point),new ReportElementFactory(IReportElementConstants.REPORT_ELEMENT_EXTENDED + point.getExtensionName()),icon,icon,BasePaletteFactory.getAbstractToolHandleExtendsFromPaletteName(getExtendedPalletTemplateName(point)));
    PaletteContainer entry=findCategory(list,category);
    if (entry == null) {
      String categoryLabel=(String)point.getAttribute(IExtensionConstants.ATTRIBUTE_PALETTE_CATEGORY_DISPLAYNAME);
      if (categoryLabel == null) {
        categoryLabel=category;
      }
      entry=new PaletteCategory(category,categoryLabel,null);
      root.add(entry);
    }
    entry.add(combined);
  }
  return root;
}