Program: 78942
Project: 78942
Buggy source:
/** 
 * Creates the outline provider and returns it.
 * @param object the object
 * @return the outline provider
 */
public static INodeProvider createProvider(Object object){
  if (object instanceof ReportDesignHandle) {
    return new ReportDesignNodeProvider();
  }
  if (object instanceof LibraryHandle) {
    return new LibraryHandleNodeProvider();
  }
 else   if (object instanceof ReportElementModel) {
    ReportElementModel model=(ReportElementModel)object;
    DesignElementHandle handle=model.getElementHandle();
    if (handle instanceof ModuleHandle) {
switch (model.getSlotId()) {
case ReportDesignHandle.BODY_SLOT:
        return new BodyNodeProvider();
case ModuleHandle.COMPONENT_SLOT:
      return new ComponentsProvider();
case ILibraryModel.THEMES_SLOT:
{
      if (model.getElementHandle() instanceof LibraryHandle) {
        ThemesNodeProvider themesProvider=new ThemesNodeProvider();
        themesProvider.setSorter(new AlphabeticallyComparator());
        return themesProvider;
      }
      StylesNodeProvider provider=new StylesNodeProvider();
      provider.setSorter(new AlphabeticallyComparator());
      return provider;
    }
case ModuleHandle.PAGE_SLOT:
  return new MasterPagesNodeProvider();
case ModuleHandle.DATA_SOURCE_SLOT:
return new DataSourcesNodeProvider();
case ModuleHandle.PARAMETER_SLOT:
return new ParametersNodeProvider();
case ModuleHandle.DATA_SET_SLOT:
return new DataSetsNodeProvider();
}
}
 else if (handle instanceof TableHandle || handle instanceof TableGroupHandle) {
return new TableBandProvider();
}
 else if (handle instanceof ListHandle || handle instanceof ListGroupHandle) {
return new ListBandProvider();
}
 else if (handle instanceof MasterPageHandle) {
return new MasterPageBandProvider();
}
}
 else if (object instanceof DesignElementHandle) {
String elementName=((DesignElementHandle)object).getDefn().getName();
IProviderFactory factory=ExtensionPointManager.getInstance().getProviderFactory(elementName);
if (factory != null) {
return factory.createProvider(object);
}
if (object instanceof CellHandle) {
return new CellProvider();
}
 else if (object instanceof GridHandle) {
return new GridProvider();
}
 else if (object instanceof StyleHandle) {
return new StyleNodeProvider();
}
 else if (object instanceof ListHandle) {
return new ListProvider();
}
 else if (object instanceof TableHandle) {
return new TableProvider();
}
 else if (object instanceof TableGroupHandle || object instanceof ListGroupHandle) {
return new GroupProvider();
}
 else if (object instanceof RowHandle) {
return new RowProvider();
}
 else if (object instanceof DataItemHandle) {
return new DataProvider();
}
 else if (object instanceof LabelHandle) {
return new LabelProvider();
}
 else if (object instanceof MasterPageHandle) {
return new MasterPageNodeProvider();
}
 else if (object instanceof DataSourceHandle) {
return new DataSourceNodeProvider();
}
 else if (object instanceof DataSetHandle) {
return new DataSetNodeProvider();
}
 else if (object instanceof ParameterGroupHandle) {
if (object instanceof CascadingParameterGroupHandle) {
return new CascadingParameterGroupNodeProvider();
}
return new ParameterGroupNodeProvider();
}
 else if (object instanceof ParameterHandle) {
return new ParameterNodeProvider();
}
 else if (object instanceof ThemeHandle) {
return new ThemeNodeProvider();
}
}
 else if (object instanceof DataSetItemModel) {
return new DataSetColumnProvider();
}
 else if (object instanceof DataSetParameterHandle) {
return new DataSetParameterProvider();
}
 else if (object instanceof EmbeddedImageNode) {
return new EmbeddedImagesNodeProvider();
}
 else if (object instanceof EmbeddedImageHandle) {
return new EmbeddedImageNodeProvider();
}
 else if (object instanceof LibraryNode) {
return new LibrariesNodeProvider();
}
return getDefaultProvider();
}

Fixed version (ground truth):
/** 
 * Creates the outline provider and returns it.
 * @param object the object
 * @return the outline provider
 */
public static INodeProvider createProvider(Object object){
  if (object instanceof ReportDesignHandle) {
    return new ReportDesignNodeProvider();
  }
  if (object instanceof LibraryHandle) {
    return new LibraryNodeProvider();
  }
 else   if (object instanceof ReportElementModel) {
    ReportElementModel model=(ReportElementModel)object;
    DesignElementHandle handle=model.getElementHandle();
    if (handle instanceof ModuleHandle) {
switch (model.getSlotId()) {
case ReportDesignHandle.BODY_SLOT:
        return new BodyNodeProvider();
case ModuleHandle.COMPONENT_SLOT:
      return new ComponentsProvider();
case ILibraryModel.THEMES_SLOT:
{
      if (model.getElementHandle() instanceof LibraryHandle) {
        ThemesNodeProvider themesProvider=new ThemesNodeProvider();
        themesProvider.setSorter(new AlphabeticallyComparator());
        return themesProvider;
      }
      StylesNodeProvider provider=new StylesNodeProvider();
      provider.setSorter(new AlphabeticallyComparator());
      return provider;
    }
case ModuleHandle.PAGE_SLOT:
  return new MasterPagesNodeProvider();
case ModuleHandle.DATA_SOURCE_SLOT:
return new DataSourcesNodeProvider();
case ModuleHandle.PARAMETER_SLOT:
return new ParametersNodeProvider();
case ModuleHandle.DATA_SET_SLOT:
return new DataSetsNodeProvider();
}
}
 else if (handle instanceof TableHandle || handle instanceof TableGroupHandle) {
return new TableBandProvider();
}
 else if (handle instanceof ListHandle || handle instanceof ListGroupHandle) {
return new ListBandProvider();
}
 else if (handle instanceof MasterPageHandle) {
return new MasterPageBandProvider();
}
}
 else if (object instanceof DesignElementHandle) {
String elementName=((DesignElementHandle)object).getDefn().getName();
IProviderFactory factory=ExtensionPointManager.getInstance().getProviderFactory(elementName);
if (factory != null) {
return factory.createProvider(object);
}
if (object instanceof CellHandle) {
return new CellProvider();
}
 else if (object instanceof GridHandle) {
return new GridProvider();
}
 else if (object instanceof StyleHandle) {
return new StyleNodeProvider();
}
 else if (object instanceof ListHandle) {
return new ListProvider();
}
 else if (object instanceof TableHandle) {
return new TableProvider();
}
 else if (object instanceof TableGroupHandle || object instanceof ListGroupHandle) {
return new GroupProvider();
}
 else if (object instanceof RowHandle) {
return new RowProvider();
}
 else if (object instanceof DataItemHandle) {
return new DataProvider();
}
 else if (object instanceof LabelHandle) {
return new LabelProvider();
}
 else if (object instanceof MasterPageHandle) {
return new MasterPageNodeProvider();
}
 else if (object instanceof DataSourceHandle) {
return new DataSourceNodeProvider();
}
 else if (object instanceof DataSetHandle) {
return new DataSetNodeProvider();
}
 else if (object instanceof ParameterGroupHandle) {
if (object instanceof CascadingParameterGroupHandle) {
return new CascadingParameterGroupNodeProvider();
}
return new ParameterGroupNodeProvider();
}
 else if (object instanceof ParameterHandle) {
return new ParameterNodeProvider();
}
 else if (object instanceof ThemeHandle) {
return new ThemeNodeProvider();
}
}
 else if (object instanceof DataSetItemModel) {
return new DataSetColumnProvider();
}
 else if (object instanceof DataSetParameterHandle) {
return new DataSetParameterProvider();
}
 else if (object instanceof EmbeddedImageNode) {
return new EmbeddedImagesNodeProvider();
}
 else if (object instanceof EmbeddedImageHandle) {
return new EmbeddedImageNodeProvider();
}
 else if (object instanceof LibraryNode) {
return new LibrariesNodeProvider();
}
return getDefaultProvider();
}