Program: 75769
Project: 75769
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=DEUtil.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);
  }
  PaletteEntryExtension[] entries=EditpartExtensionManager.getPaletteEntries();
  for (int i=0; i < entries.length; i++) {
    String category=entries[i].getCategory();
    PaletteContainer entry=findCategory(list,category);
    if (entry == null) {
      entry=new PaletteCategory(category,category,null);
      root.add(entry);
    }
    CombinedTemplateCreationEntry combined=new CommandCombinedTemplateCreationEntry(entries[i]);
    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);
{
        continue;
      }
    }
    String displayName=DEUtil.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);
  }
  PaletteEntryExtension[] entries=EditpartExtensionManager.getPaletteEntries();
  for (int i=0; i < entries.length; i++) {
    if (PALETTE_MASTERPAGE.equals(type)) {
      continue;
    }
    String category=entries[i].getCategory();
    PaletteContainer entry=findCategory(list,category);
    if (entry == null) {
      entry=new PaletteCategory(category,category,null);
      root.add(entry);
    }
    CombinedTemplateCreationEntry combined=new CommandCombinedTemplateCreationEntry(entries[i]);
    entry.add(combined);
  }
  return root;
}