Program: 95794
Project: 95794
Buggy source:
/** 
 * Searchs the component in the AUT, which belongs to the given <code>componentIdentifier</code>.
 * @param componentIdentifier the identifier of the component to search for
 * @param retry number of tries to get object
 * @param timeout timeout for retries
 * @throws ComponentNotFoundException if no component is found for the given identifier.
 * @throws IllegalArgumentException if the identifier is null or contains invalid data {@inheritDoc}
 * @return the found component
 */
public static Object findComponent(IComponentIdentifier componentIdentifier,boolean retry,int timeout) throws ComponentNotFoundException, IllegalArgumentException {
  long start=System.currentTimeMillis();
  ReentrantLock lock=hierarchy.getLock();
  try {
    return hierarchy.findComponent(componentIdentifier);
  }
 catch (  ComponentNotManagedException cnme) {
    if (retry) {
      while (System.currentTimeMillis() - start < timeout) {
        try {
          lock.lock();
          return hierarchy.findComponent(componentIdentifier);
        }
 catch (        ComponentNotManagedException e) {
          lock.unlock();
          try {
            Thread.sleep(TimingConstantsServer.POLLING_DELAY_FIND_COMPONENT);
          }
 catch (          InterruptedException e1) {
          }
        }
catch (        InvalidDataException ide) {
        }
      }
    }
    throw new ComponentNotFoundException(cnme.getMessage(),MessageIDs.E_COMPONENT_NOT_FOUND);
  }
catch (  IllegalArgumentException iae) {
    log.error(iae);
    throw iae;
  }
catch (  InvalidDataException ide) {
    log.error(ide);
    throw new ComponentNotFoundException(ide.getMessage(),MessageIDs.E_COMPONENT_NOT_FOUND);
  }
 finally {
    if (lock.isHeldByCurrentThread()) {
      lock.unlock();
    }
  }
}

Fixed version (ground truth):
/** 
 * Searchs the component in the AUT, which belongs to the given <code>componentIdentifier</code>.
 * @param componentIdentifier the identifier of the component to search for
 * @param retry number of tries to get object
 * @param timeout timeout for retries
 * @throws ComponentNotFoundException if no component is found for the given identifier.
 * @throws IllegalArgumentException if the identifier is null or contains invalid data {@inheritDoc}
 * @return the found component
 */
public static Object findComponent(IComponentIdentifier componentIdentifier,boolean retry,int timeout) throws ComponentNotFoundException, IllegalArgumentException {
  long start=System.currentTimeMillis();
  ReentrantLock lock=hierarchy.getLock();
  try {
    lock.lock();
    return hierarchy.findComponent(componentIdentifier);
  }
 catch (  ComponentNotManagedException cnme) {
    if (retry) {
      if (lock.isHeldByCurrentThread()) {
        lock.unlock();
      }
      while (System.currentTimeMillis() - start < timeout) {
        try {
          lock.lock();
          return hierarchy.findComponent(componentIdentifier);
        }
 catch (        ComponentNotManagedException e) {
          if (lock.isHeldByCurrentThread()) {
            lock.unlock();
          }
          try {
            Thread.sleep(TimingConstantsServer.POLLING_DELAY_FIND_COMPONENT);
          }
 catch (          InterruptedException e1) {
          }
        }
catch (        InvalidDataException ide) {
        }
      }
    }
    throw new ComponentNotFoundException(cnme.getMessage(),MessageIDs.E_COMPONENT_NOT_FOUND);
  }
catch (  IllegalArgumentException iae) {
    log.error(iae);
    throw iae;
  }
catch (  InvalidDataException ide) {
    log.error(ide);
    throw new ComponentNotFoundException(ide.getMessage(),MessageIDs.E_COMPONENT_NOT_FOUND);
  }
 finally {
    if (lock.isHeldByCurrentThread()) {
      lock.unlock();
    }
  }
}