Program: 139407
Project: 139407
Buggy source:
protected ImageDescriptor decorateImage(ImageDescriptor input,Object element){
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (FactoriesUtil.isPatternFile(file)) {
      Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
      if (pattern != null) {
        boolean validStatus=TaggedValueHelper.getValidStatus(pattern);
        if (!validStatus) {
          return ImageLib.createInvalidIcon(ImageLib.PATTERN_REG);
        }
 else {
          return ImageLib.getImageDescriptor(ImageLib.PATTERN_REG);
        }
      }
    }
 else     if (FactoriesUtil.isReportFile(file)) {
      return ImageLib.getImageDescriptor(ImageLib.REPORT_OBJECT);
    }
 else     if (FactoriesUtil.isUDIFile(file)) {
      IndicatorDefinition udi=UDIResourceFileHelper.getInstance().findUDI(file);
      if (udi != null) {
        boolean validStatus=TaggedValueHelper.getValidStatus(udi) | UDIHelper.isUDIValid(udi);
        if (!validStatus) {
          return ImageLib.createInvalidIcon(ImageLib.IND_DEFINITION);
        }
 else {
          return ImageLib.getImageDescriptor(ImageLib.IND_DEFINITION);
        }
      }
    }
  }
  if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    if (ResourceManager.isMetadataFolder(folder)) {
      return ImageLib.getImageDescriptor(ImageLib.METADATA);
    }
 else     if (ResourceManager.isLibrariesFolder(folder)) {
      return ImageLib.getImageDescriptor(ImageLib.LIBRARIES);
    }
 else     if (ResourceManager.isDataProfilingFolder(folder)) {
      return ImageLib.getImageDescriptor(ImageLib.DATA_PROFILING);
    }
 else     if (ResourceManager.isConnectionFolder(folder)) {
      return ImageLib.getImageDescriptor(ImageLib.CONNECTION);
    }
 else     if (ResourceManager.isExchangeFolder(folder)) {
      return ImageLib.getImageDescriptor(ImageLib.EXCHANGE);
    }
  }
  return super.decorateImage(input,element);
}

Fixed version (ground truth):
protected ImageDescriptor decorateImage(ImageDescriptor input,Object element){
  ImageDescriptor image=super.decorateImage(input,element);
  if (element instanceof IFile) {
    IFile file=(IFile)element;
    if (FactoriesUtil.isPatternFile(file)) {
      image=ImageLib.getImageDescriptor(ImageLib.PATTERN_REG);
      Pattern pattern=PatternResourceFileHelper.getInstance().findPattern(file);
      if (pattern != null) {
        if (!TaggedValueHelper.getValidStatus(pattern)) {
          image=ImageLib.createInvalidIcon(ImageLib.PATTERN_REG);
        }
      }
    }
 else     if (FactoriesUtil.isReportFile(file)) {
      image=ImageLib.getImageDescriptor(ImageLib.REPORT_OBJECT);
    }
 else     if (FactoriesUtil.isUDIFile(file)) {
      image=ImageLib.getImageDescriptor(ImageLib.IND_DEFINITION);
      IndicatorDefinition udi=UDIResourceFileHelper.getInstance().findUDI(file);
      if (udi != null) {
        boolean validStatus=TaggedValueHelper.getValidStatus(udi) | UDIHelper.isUDIValid(udi);
        if (!validStatus) {
          image=ImageLib.createInvalidIcon(ImageLib.IND_DEFINITION);
        }
      }
    }
    if (FactoriesUtil.isEmfFile(file)) {
      Property property=ModelElementFileFactory.getProperty(file);
      if (property != null) {
        Item item=property.getItem();
        Boolean lockByOthers=ImplementationHelper.getRepositoryManager().isLockByOthers(item);
        Boolean lockByUserOwn=ImplementationHelper.getRepositoryManager().isLockByUserOwn(item);
        if (lockByOthers || lockByUserOwn) {
          log.info(property.getLabel() + "String_Node_Str");
          image=ImageLib.createLockedIcon(image);
        }
      }
    }
  }
 else   if (element instanceof IFolder) {
    IFolder folder=(IFolder)element;
    if (ResourceManager.isMetadataFolder(folder)) {
      image=ImageLib.getImageDescriptor(ImageLib.METADATA);
    }
 else     if (ResourceManager.isLibrariesFolder(folder)) {
      image=ImageLib.getImageDescriptor(ImageLib.LIBRARIES);
    }
 else     if (ResourceManager.isDataProfilingFolder(folder)) {
      image=ImageLib.getImageDescriptor(ImageLib.DATA_PROFILING);
    }
 else     if (ResourceManager.isConnectionFolder(folder)) {
      image=ImageLib.getImageDescriptor(ImageLib.CONNECTION);
    }
 else     if (ResourceManager.isExchangeFolder(folder)) {
      image=ImageLib.getImageDescriptor(ImageLib.EXCHANGE);
    }
  }
  return image;
}