Program: 117865
Project: 117865
Buggy source:
/** 
 * DOC cmeng Comment method "createRecentlyUsedEntry".
 * @param componentsDrawer
 * @param ht
 * @param recentlyUsedList
 * @param recentlyUsedMap
 * @return
 */
protected static void createRecentlyUsedEntryList(Hashtable<String,PaletteDrawer> ht,List<RecentlyUsedComponent> recentlyUsedList,Map<String,IComponent> recentlyUsedMap){
  String name;
  String longName;
  TalendCombinedTemplateCreationEntry component;
  final int recentlyUsedSize=PaletteSettingsPreferencePage.getPaletteRencentlyUsedListSize();
  int i=1;
  for (  RecentlyUsedComponent recentlyUsed : recentlyUsedList) {
    if (recentlyUsedSize < i) {
      break;
    }
    IComponent recentlyUsedComponent=recentlyUsedMap.get(recentlyUsed.getName());
    if (recentlyUsedComponent == null) {
      continue;
    }
    if (!ComponentUtilities.isComponentVisible(recentlyUsedComponent)) {
      continue;
    }
    recentlyUsedComponent=UnifiedComponentUtil.getDelegateComponent(recentlyUsedComponent);
    ++i;
    PaletteDrawer componentsDrawer=ht.get(RECENTLY_USED);
    if (componentsDrawer != null) {
      name=recentlyUsedComponent.getName();
      longName=recentlyUsedComponent.getLongName();
      ImageDescriptor imageSmall=recentlyUsedComponent.getIcon16();
      IPreferenceStore store=DesignerPlugin.getDefault().getPreferenceStore();
      ImageDescriptor imageLarge;
      final String string=store.getString(TalendDesignerPrefConstants.LARGE_ICONS_SIZE);
      if (string.equals("String_Node_Str")) {
        imageLarge=recentlyUsedComponent.getIcon24();
      }
 else {
        imageLarge=recentlyUsedComponent.getIcon32();
      }
      component=new TalendCombinedTemplateCreationEntry(name,name,Node.class,recentlyUsedComponent,imageSmall,imageLarge);
      component.setDescription(longName);
      component.setParent(componentsDrawer);
      component.setTimestemp(recentlyUsed.getTimestamp());
      componentsDrawer.add(component);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC cmeng Comment method "createRecentlyUsedEntry".
 * @param componentsDrawer
 * @param ht
 * @param recentlyUsedList
 * @param recentlyUsedMap
 * @return
 */
protected static void createRecentlyUsedEntryList(Hashtable<String,PaletteDrawer> ht,List<RecentlyUsedComponent> recentlyUsedList,Map<String,IComponent> recentlyUsedMap){
  String name;
  String longName;
  TalendCombinedTemplateCreationEntry component;
  final int recentlyUsedSize=PaletteSettingsPreferencePage.getPaletteRencentlyUsedListSize();
  int i=1;
  for (  RecentlyUsedComponent recentlyUsed : recentlyUsedList) {
    if (recentlyUsedSize < i) {
      break;
    }
    IComponent recentlyUsedComponent=recentlyUsedMap.get(recentlyUsed.getName());
    if (recentlyUsedComponent == null) {
      continue;
    }
    if (!ComponentUtilities.isComponentVisible(recentlyUsedComponent)) {
      continue;
    }
    recentlyUsedComponent=UnifiedComponentUtil.getDelegateComponent(recentlyUsedComponent);
    ++i;
    PaletteDrawer componentsDrawer=ht.get(RECENTLY_USED);
    if (componentsDrawer != null) {
      name=UnifiedComponentUtil.getComponentDisplayNameForPalette(recentlyUsedComponent,filter);
      longName=recentlyUsedComponent.getLongName();
      ImageDescriptor imageSmall=recentlyUsedComponent.getIcon16();
      IPreferenceStore store=DesignerPlugin.getDefault().getPreferenceStore();
      ImageDescriptor imageLarge;
      final String string=store.getString(TalendDesignerPrefConstants.LARGE_ICONS_SIZE);
      if (string.equals("String_Node_Str")) {
        imageLarge=recentlyUsedComponent.getIcon24();
      }
 else {
        imageLarge=recentlyUsedComponent.getIcon32();
      }
      component=new TalendCombinedTemplateCreationEntry(name,name,Node.class,recentlyUsedComponent,imageSmall,imageLarge,filter);
      component.setDescription(longName);
      component.setParent(componentsDrawer);
      component.setTimestemp(recentlyUsed.getTimestamp());
      componentsDrawer.add(component);
    }
  }
}