Program: 71732
Project: 71732
Buggy source:
/** 
 * Return the category map.
 * @return
 */
private static Map<String,Category> getCategoryMap(){
  if (categories != null)   return categories;
  categories=new HashMap<String,Category>();
  IExtensionRegistry extReg=Platform.getExtensionRegistry();
  IExtensionPoint extPoint=extReg.getExtensionPoint(EXTENSION_POINT);
  if (extPoint == null)   return categories;
  IExtension[] exts=extPoint.getExtensions();
  if (exts == null) {
    return categories;
  }
  for (int e=0; e < exts.length; e++) {
    IConfigurationElement[] configElems=exts[e].getConfigurationElements();
    if (configElems == null)     continue;
    for (int i=0; i < configElems.length; i++) {
      if (configElems[i].getName().equals(ELEMENT_CATEGORY)) {
        Category category=new Category(configElems[i].getAttribute(ATTRIBUTE_NAME),configElems[i].getAttribute(ATTRIBUTE_DESC));
        categories.put(category.getName(),category);
        IScriptFunctionFactory factory;
        try {
          factory=(IScriptFunctionFactory)configElems[i].createExecutableExtension(ATTRIBUTE_FACTORYCLASS);
          IConfigurationElement[] functions=configElems[i].getChildren(ELEMENT_FUNCTION);
          for (int j=0; j < functions.length; j++) {
            IScriptFunction function=getScriptFunction(category,factory,functions[j]);
            if (function != null)             category.addFunction(function);
          }
        }
 catch (        FrameworkException e1) {
        }
      }
 else       if (configElems[i].getName().equals(ELEMENT_FUNCTION)) {
        if (categories.get(DEFAULT_CATEGORYNAME) == null) {
          categories.put(DEFAULT_CATEGORYNAME,new Category(DEFAULT_CATEGORYNAME,null));
        }
        IScriptFunction function=getScriptFunction(categories.get(DEFAULT_CATEGORYNAME),null,configElems[i]);
        if (function != null)         categories.get(DEFAULT_CATEGORYNAME).addFunction(function);
      }
 else       if (configElems[i].getName().equals(ELEMENT_JSLIB)) {
        populateResources(jsLibs,"String_Node_Str",configElems[i]);
      }
    }
  }
  return categories;
}

Fixed version (ground truth):
/** 
 * Return the category map.
 * @return
 */
private static Map<String,Category> getCategoryMap(){
  if (categories != null)   return categories;
  categories=new HashMap<String,Category>();
  IExtensionRegistry extReg=Platform.getExtensionRegistry();
  IExtensionPoint extPoint=extReg.getExtensionPoint(EXTENSION_POINT);
  if (extPoint == null)   return categories;
  IExtension[] exts=extPoint.getExtensions();
  if (exts == null) {
    return categories;
  }
  for (int e=0; e < exts.length; e++) {
    IConfigurationElement[] configElems=exts[e].getConfigurationElements();
    if (configElems == null)     continue;
    for (int i=0; i < configElems.length; i++) {
      if (configElems[i].getName().equals(ELEMENT_CATEGORY)) {
        Category category=new Category(configElems[i].getAttribute(ATTRIBUTE_NAME),configElems[i].getAttribute(ATTRIBUTE_DESC));
        categories.put(category.getName(),category);
        IScriptFunctionFactory factory=null;
        try {
          if (configElems[i].getAttribute(ATTRIBUTE_FACTORYCLASS) != null)           factory=(IScriptFunctionFactory)configElems[i].createExecutableExtension(ATTRIBUTE_FACTORYCLASS);
          IConfigurationElement[] functions=configElems[i].getChildren(ELEMENT_FUNCTION);
          for (int j=0; j < functions.length; j++) {
            IScriptFunction function=getScriptFunction(category,factory,functions[j]);
            if (function != null)             category.addFunction(function);
          }
        }
 catch (        FrameworkException e1) {
        }
      }
 else       if (configElems[i].getName().equals(ELEMENT_FUNCTION)) {
        if (categories.get(DEFAULT_CATEGORYNAME) == null) {
          categories.put(DEFAULT_CATEGORYNAME,new Category(DEFAULT_CATEGORYNAME,null));
        }
        IScriptFunction function=getScriptFunction(categories.get(DEFAULT_CATEGORYNAME),null,configElems[i]);
        if (function != null)         categories.get(DEFAULT_CATEGORYNAME).addFunction(function);
      }
 else       if (configElems[i].getName().equals(ELEMENT_JSLIB)) {
        populateResources(jsLibs,"String_Node_Str",configElems[i]);
      }
    }
  }
  return categories;
}