Program: 125840
Project: 125840
Buggy source:
@Override public Image getImage(Object obj){
  if (obj instanceof IRepositoryViewObject) {
    return getImage((IRepositoryViewObject)obj);
  }
  RepositoryNode node=(RepositoryNode)obj;
  IImage nodeIcon=node.getIcon();
switch (node.getType()) {
case STABLE_SYSTEM_FOLDER:
case SYSTEM_FOLDER:
    if (nodeIcon != null) {
      return ImageProvider.getImage(nodeIcon);
    }
  ERepositoryObjectType contentType=node.getContentType();
if (contentType != null) {
  Image image=RepositoryNodeProviderRegistryReader.getInstance().getImage(contentType);
  if (image != null) {
    return image;
  }
}
case SIMPLE_FOLDER:
ECoreImage image=null;
if (getView() != null) {
image=(getView().getExpandedState(obj) ? ECoreImage.FOLDER_OPEN_ICON : ECoreImage.FOLDER_CLOSE_ICON);
}
 else {
image=ECoreImage.FOLDER_OPEN_ICON;
}
return ImageProvider.getImage(image);
default :
if (node.getObject() == null) {
return ImageProvider.getImage(nodeIcon);
}
ERepositoryObjectType repositoryObjectType=node.getObject().getRepositoryObjectType();
if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_QUERY || repositoryObjectType == ERepositoryObjectType.SNIPPETS || repositoryObjectType == ERepositoryObjectType.METADATA_CON_SYNONYM || repositoryObjectType == ERepositoryObjectType.METADATA_CON_VIEW || repositoryObjectType == ERepositoryObjectType.JOB_DOC || repositoryObjectType == ERepositoryObjectType.JOBLET_DOC) {
return ImageProvider.getImage(nodeIcon);
}
 else if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_TABLE) {
Image tableImage=ImageProvider.getImage(nodeIcon);
Item item=node.getObject().getProperty().getItem();
if (item != null && item instanceof DatabaseConnectionItem) {
if (PluginChecker.isCDCPluginLoaded()) {
ICDCProviderService service=(ICDCProviderService)GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
if (service != null) {
String cdcLinkId=service.getCDCConnectionLinkId((DatabaseConnectionItem)item);
if (cdcLinkId != null) {
if (node.getObject() instanceof MetadataTableRepositoryObject) {
MetadataTable table=((MetadataTableRepositoryObject)node.getObject()).getTable();
String tableType=table.getTableType();
if (tableType != null && "String_Node_Str".equals(tableType)) {
  ECDCStatus status=ECDCStatus.NONE;
  if (table.isActivatedCDC()) {
    status=ECDCStatus.ACTIVATED;
  }
 else   if (table.isAttachedCDC()) {
    status=ECDCStatus.ADDED;
  }
  return OverlayImageProvider.getImageWithCDCStatus(tableImage,status).createImage();
}
}
}
}
}
}
return tableImage;
}
 else if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_CDC) {
IImage icon=RepositoryImageProvider.getIcon(repositoryObjectType);
if (icon != null) {
return ImageProvider.getImage(icon);
}
}
return getImage(node.getObject());
}
}

Fixed version (ground truth):
@Override public Image getImage(Object obj){
  if (obj instanceof IRepositoryViewObject) {
    return getImage((IRepositoryViewObject)obj);
  }
  RepositoryNode node=(RepositoryNode)obj;
  IImage nodeIcon=node.getIcon();
switch (node.getType()) {
case STABLE_SYSTEM_FOLDER:
case SYSTEM_FOLDER:
    ERepositoryObjectType contentType=node.getContentType();
  if (nodeIcon == null || EImage.DEFAULT_IMAGE.equals(nodeIcon)) {
    Image image=getImageFromFramework(contentType);
    if (image != null) {
      return image;
    }
  }
if (nodeIcon != null) {
  return ImageProvider.getImage(nodeIcon);
}
if (contentType != null) {
Image image=RepositoryNodeProviderRegistryReader.getInstance().getImage(contentType);
if (image != null) {
  return image;
}
}
case SIMPLE_FOLDER:
ECoreImage image=null;
if (getView() != null) {
image=(getView().getExpandedState(obj) ? ECoreImage.FOLDER_OPEN_ICON : ECoreImage.FOLDER_CLOSE_ICON);
}
 else {
image=ECoreImage.FOLDER_OPEN_ICON;
}
return ImageProvider.getImage(image);
default :
if (node.getObject() == null) {
return ImageProvider.getImage(nodeIcon);
}
ERepositoryObjectType repositoryObjectType=node.getObject().getRepositoryObjectType();
if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_QUERY || repositoryObjectType == ERepositoryObjectType.SNIPPETS || repositoryObjectType == ERepositoryObjectType.METADATA_CON_SYNONYM || repositoryObjectType == ERepositoryObjectType.METADATA_CON_VIEW || repositoryObjectType == ERepositoryObjectType.JOB_DOC || repositoryObjectType == ERepositoryObjectType.JOBLET_DOC) {
return ImageProvider.getImage(nodeIcon);
}
 else if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_TABLE) {
Image tableImage=ImageProvider.getImage(nodeIcon);
Item item=node.getObject().getProperty().getItem();
if (item != null && item instanceof DatabaseConnectionItem) {
if (PluginChecker.isCDCPluginLoaded()) {
ICDCProviderService service=(ICDCProviderService)GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
if (service != null) {
String cdcLinkId=service.getCDCConnectionLinkId((DatabaseConnectionItem)item);
if (cdcLinkId != null) {
if (node.getObject() instanceof MetadataTableRepositoryObject) {
MetadataTable table=((MetadataTableRepositoryObject)node.getObject()).getTable();
String tableType=table.getTableType();
if (tableType != null && "String_Node_Str".equals(tableType)) {
ECDCStatus status=ECDCStatus.NONE;
if (table.isActivatedCDC()) {
  status=ECDCStatus.ACTIVATED;
}
 else if (table.isAttachedCDC()) {
  status=ECDCStatus.ADDED;
}
return OverlayImageProvider.getImageWithCDCStatus(tableImage,status).createImage();
}
}
}
}
}
}
return tableImage;
}
 else if (repositoryObjectType == ERepositoryObjectType.METADATA_CON_CDC) {
IImage icon=RepositoryImageProvider.getIcon(repositoryObjectType);
if (icon != null) {
return ImageProvider.getImage(icon);
}
}
return getImage(node.getObject());
}
}