Program: 138381
Project: 138381
Buggy source:
public Image getImage(Object element){
  if (element instanceof IRepositoryNode) {
    IRepositoryNode node=(IRepositoryNode)element;
    IRepositoryViewObject viewObject=node.getObject();
    ENodeType type=node.getType();
    if (node instanceof ReportAnalysisRepNode) {
      return ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
    }
    if (element instanceof RecycleBinRepNode) {
      return ImageLib.getImage(ImageLib.RECYCLEBIN_EMPTY);
    }
 else     if (type.equals(ENodeType.SYSTEM_FOLDER)) {
      if (viewObject.getLabel().equals(EResourceConstant.DATA_PROFILING.getName())) {
        return ImageLib.getImage(ImageLib.DATA_PROFILING);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.METADATA.getName())) {
        return ImageLib.getImage(ImageLib.METADATA);
      }
 else       if (node instanceof DBConnectionFolderRepNode) {
        return ImageLib.getImage(ImageLib.CONNECTION);
      }
 else       if (node instanceof MDMConnectionFolderRepNode) {
        return ImageLib.getImage(ImageLib.MDM_CONNECTION);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.FILEDELIMITED.getName())) {
        return ImageLib.getImage(ImageLib.FILE_DELIMITED);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.LIBRARIES.getName())) {
        return ImageLib.getImage(ImageLib.LIBRARIES);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.EXCHANGE.getName())) {
        return ImageLib.getImage(ImageLib.EXCHANGE);
      }
      return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
    }
 else     if (type.equals(ENodeType.SIMPLE_FOLDER)) {
      return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
    }
 else     if (type.equals(ENodeType.REPOSITORY_ELEMENT)) {
      if (node instanceof DBConnectionRepNode) {
        if (!isSupportedConnection(node)) {
          return ImageLib.createErrorIcon(ImageLib.TD_DATAPROVIDER).createImage();
        }
        return ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
      }
 else       if (node instanceof MDMConnectionRepNode) {
        return ImageLib.getImage(ImageLib.MDM_CONNECTION);
      }
 else       if (node instanceof DFConnectionRepNode) {
        return ImageLib.getImage(ImageLib.FILE_DELIMITED);
      }
 else       if (node instanceof AnalysisRepNode) {
        return ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
      }
 else       if (node instanceof ReportRepNode) {
        return ImageLib.getImage(ImageLib.REPORT_OBJECT);
      }
 else       if (node instanceof SysIndicatorDefinitionRepNode) {
        return ImageLib.getImage(ImageLib.IND_DEFINITION);
      }
 else       if (node instanceof PatternRepNode) {
        return ImageLib.getImage(ImageLib.PATTERN_REG);
      }
 else       if (node instanceof RuleRepNode) {
        return ImageLib.getImage(ImageLib.DQ_RULE);
      }
 else       if (node instanceof SourceFileRepNode) {
        return ImageLib.getImage(ImageLib.SOURCE_FILE);
      }
 else       if (node instanceof ExchangeCategoryRepNode || node instanceof ExchangeComponentRepNode) {
        return ImageLib.getImage(ImageLib.EXCHANGE);
      }
 else       if (node instanceof RepositoryNode) {
        Image image=getImageByContentType((RepositoryNode)node);
        if (image != null) {
          return image;
        }
      }
    }
 else     if (type.equals(ENodeType.TDQ_REPOSITORY_ELEMENT)) {
      if (node instanceof DBCatalogRepNode) {
        return ImageLib.getImage(ImageLib.CATALOG);
      }
 else       if (node instanceof DBSchemaRepNode) {
        return ImageLib.getImage(ImageLib.SCHEMA);
      }
 else       if (node instanceof DBTableFolderRepNode) {
        return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
 else       if (node instanceof DBViewFolderRepNode) {
        return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
 else       if (node instanceof DBTableRepNode || node instanceof DFTableRepNode) {
        return ImageLib.getImage(ImageLib.TABLE);
      }
 else       if (node instanceof DBViewRepNode) {
        return ImageLib.getImage(ImageLib.VIEW);
      }
 else       if (node instanceof DBColumnRepNode) {
        if (((DBColumnRepNode)node).isKey()) {
          return ImageLib.getImage(ImageLib.PK_COLUMN);
        }
        return ImageLib.getImage(ImageLib.TD_COLUMN);
      }
 else       if (node instanceof DFColumnRepNode) {
        return ImageLib.getImage(ImageLib.TD_COLUMN);
      }
 else       if (node instanceof MDMSchemaRepNode) {
        return ImageLib.getImage(ImageLib.XML_DOC);
      }
 else       if (node instanceof MDMXmlElementRepNode) {
        return ImageLib.getImage(ImageLib.XML_ELEMENT_DOC);
      }
 else       if (node instanceof DBColumnFolderRepNode || node instanceof DFColumnFolderRepNode) {
        return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
    }
  }
  return super.getImage(element);
}

Fixed version (ground truth):
public Image getImage(Object element){
  Image image=super.getImage(element);
  if (element instanceof IRepositoryNode) {
    IRepositoryNode node=(IRepositoryNode)element;
    IRepositoryViewObject viewObject=node.getObject();
    ENodeType type=node.getType();
    if (node instanceof ReportAnalysisRepNode) {
      image=ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
    }
    if (element instanceof RecycleBinRepNode) {
      image=ImageLib.getImage(ImageLib.RECYCLEBIN_EMPTY);
    }
 else     if (type.equals(ENodeType.SYSTEM_FOLDER)) {
      if (viewObject.getLabel().equals(EResourceConstant.DATA_PROFILING.getName())) {
        image=ImageLib.getImage(ImageLib.DATA_PROFILING);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.METADATA.getName())) {
        image=ImageLib.getImage(ImageLib.METADATA);
      }
 else       if (node instanceof DBConnectionFolderRepNode) {
        image=ImageLib.getImage(ImageLib.CONNECTION);
      }
 else       if (node instanceof MDMConnectionFolderRepNode) {
        image=ImageLib.getImage(ImageLib.MDM_CONNECTION);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.FILEDELIMITED.getName())) {
        image=ImageLib.getImage(ImageLib.FILE_DELIMITED);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.LIBRARIES.getName())) {
        image=ImageLib.getImage(ImageLib.LIBRARIES);
      }
 else       if (viewObject.getLabel().equals(EResourceConstant.EXCHANGE.getName())) {
        image=ImageLib.getImage(ImageLib.EXCHANGE);
      }
 else {
        image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
    }
 else     if (type.equals(ENodeType.SIMPLE_FOLDER)) {
      image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
    }
 else     if (type.equals(ENodeType.REPOSITORY_ELEMENT)) {
      if (node instanceof DBConnectionRepNode) {
        if (!isSupportedConnection(node)) {
          image=ImageLib.createErrorIcon(ImageLib.TD_DATAPROVIDER).createImage();
        }
        image=ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
      }
 else       if (node instanceof MDMConnectionRepNode) {
        image=ImageLib.getImage(ImageLib.MDM_CONNECTION);
      }
 else       if (node instanceof DFConnectionRepNode) {
        image=ImageLib.getImage(ImageLib.FILE_DELIMITED);
      }
 else       if (node instanceof AnalysisRepNode) {
        image=ImageLib.getImage(ImageLib.ANALYSIS_OBJECT);
      }
 else       if (node instanceof ReportRepNode) {
        image=ImageLib.getImage(ImageLib.REPORT_OBJECT);
      }
 else       if (node instanceof SysIndicatorDefinitionRepNode) {
        image=ImageLib.getImage(ImageLib.IND_DEFINITION);
      }
 else       if (node instanceof PatternRepNode) {
        image=ImageLib.getImage(ImageLib.PATTERN_REG);
      }
 else       if (node instanceof RuleRepNode) {
        image=ImageLib.getImage(ImageLib.DQ_RULE);
      }
 else       if (node instanceof SourceFileRepNode) {
        image=ImageLib.getImage(ImageLib.SOURCE_FILE);
      }
 else       if (node instanceof ExchangeCategoryRepNode || node instanceof ExchangeComponentRepNode) {
        image=ImageLib.getImage(ImageLib.EXCHANGE);
      }
 else       if (node instanceof RepositoryNode) {
        Image imageNode=getImageByContentType((RepositoryNode)node);
        if (image != null) {
          image=imageNode;
        }
      }
      if (ERepositoryStatus.LOCK_BY_USER == ProxyRepositoryFactory.getInstance().getStatus(viewObject)) {
        image=ImageLib.createLockedIcon(ImageDescriptor.createFromImage(image)).createImage();
      }
    }
 else     if (type.equals(ENodeType.TDQ_REPOSITORY_ELEMENT)) {
      if (node instanceof DBCatalogRepNode) {
        image=ImageLib.getImage(ImageLib.CATALOG);
      }
 else       if (node instanceof DBSchemaRepNode) {
        image=ImageLib.getImage(ImageLib.SCHEMA);
      }
 else       if (node instanceof DBTableFolderRepNode) {
        image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
 else       if (node instanceof DBViewFolderRepNode) {
        image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
 else       if (node instanceof DBTableRepNode || node instanceof DFTableRepNode) {
        image=ImageLib.getImage(ImageLib.TABLE);
      }
 else       if (node instanceof DBViewRepNode) {
        image=ImageLib.getImage(ImageLib.VIEW);
      }
 else       if (node instanceof DBColumnRepNode) {
        if (((DBColumnRepNode)node).isKey()) {
          image=ImageLib.getImage(ImageLib.PK_COLUMN);
        }
        image=ImageLib.getImage(ImageLib.TD_COLUMN);
      }
 else       if (node instanceof DFColumnRepNode) {
        image=ImageLib.getImage(ImageLib.TD_COLUMN);
      }
 else       if (node instanceof MDMSchemaRepNode) {
        image=ImageLib.getImage(ImageLib.XML_DOC);
      }
 else       if (node instanceof MDMXmlElementRepNode) {
        image=ImageLib.getImage(ImageLib.XML_ELEMENT_DOC);
      }
 else       if (node instanceof DBColumnFolderRepNode || node instanceof DFColumnFolderRepNode) {
        image=ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
      }
    }
  }
  return image;
}