Program: 95899
Project: 95899
Buggy source:
/** 
 * Query the AUTServer for all supported components. <code>listener.componentInfo()</code> will be called when the answer receives.
 * @param command the command to execute as a callback
 * @throws CommunicationException if an error occurs while communicating with the AUT.
 */
private void getAllComponentsFromAUT(AUTStartedCommand command) throws CommunicationException {
  LOG.info(Messages.GettingAllComponentsFromAUT);
  try {
    SendAUTListOfSupportedComponentsMessage message=MessageFactory.getSendAUTListOfSupportedComponentsMessage();
    CompSystem compSystem=ComponentBuilder.getInstance().getCompSystem();
    IAUTMainPO connectedAut=TestExecution.getInstance().getConnectedAut();
    String autToolkitId=connectedAut.getToolkit();
    List<Component> components=compSystem.getComponents(autToolkitId,true);
    components.retainAll(compSystem.getConcreteComponents());
    message.setComponents(components);
    Profile profile=new Profile();
    IObjectMappingProfilePO profilePo=connectedAut.getObjMap().getProfile();
    profile.setNameFactor(profilePo.getNameFactor());
    profile.setPathFactor(profilePo.getPathFactor());
    profile.setContextFactor(profilePo.getContextFactor());
    profile.setThreshold(profilePo.getThreshold());
    message.setProfile(profile);
    int timeoutToUse=AUTStateCommand.AUT_COMPONENT_RETRIEVAL_TIMEOUT;
    request(message,command,timeoutToUse);
    long startTime=System.currentTimeMillis();
    while (System.currentTimeMillis() <= startTime + timeoutToUse && !command.wasExecuted() && isConnected()) {
      TimeUtil.delay(500);
    }
    if (!command.wasExecuted() && isConnected()) {
      IAUTInfoListener listener=command.getListener();
      if (listener != null) {
        listener.error(IAUTInfoListener.ERROR_COMMUNICATION);
      }
      throw new CommunicationException(Messages.CouldNotRequestComponentsFromAUT,IAUTInfoListener.ERROR_COMMUNICATION);
    }
    if (ObjectMappingEventDispatcher.getObjMapTransient().getMappings().isEmpty()) {
      LOG.warn(Messages.NoDefaultObjectMappingsCouldBeFoundForTheAUT);
    }
  }
 catch (  UnknownMessageException ume) {
    ClientTestFactory.getClientTest().fireAUTServerStateChanged(new AUTServerEvent(ume.getErrorId()));
  }
}

Fixed version (ground truth):
/** 
 * Query the AUTServer for all supported components. <code>listener.componentInfo()</code> will be called when the answer receives.
 * @param command the command to execute as a callback
 * @throws CommunicationException if an error occurs while communicating with the AUT.
 */
private void getAllComponentsFromAUT(AUTStartedCommand command) throws CommunicationException {
  LOG.info(Messages.GettingAllComponentsFromAUT);
  try {
    SendAUTListOfSupportedComponentsMessage message=MessageFactory.getSendAUTListOfSupportedComponentsMessage();
    CompSystem compSystem=ComponentBuilder.getInstance().getCompSystem();
    IAUTMainPO connectedAut=TestExecution.getInstance().getConnectedAut();
    String autToolkitId=connectedAut.getToolkit();
    List<Component> components=compSystem.getComponents(autToolkitId,true);
    components.retainAll(compSystem.getConcreteComponents());
    message.setComponents(components);
    Profile profile=new Profile();
    IObjectMappingProfilePO profilePo=connectedAut.getObjMap().getProfile();
    profile.setNameFactor(profilePo.getNameFactor());
    profile.setPathFactor(profilePo.getPathFactor());
    profile.setContextFactor(profilePo.getContextFactor());
    profile.setThreshold(profilePo.getThreshold());
    message.setProfile(profile);
    int timeoutToUse=AUTStateCommand.AUT_COMPONENT_RETRIEVAL_TIMEOUT;
    request(message,command,timeoutToUse);
    long startTime=System.currentTimeMillis();
    while (System.currentTimeMillis() <= startTime + timeoutToUse && !command.wasExecuted() && isConnected()) {
      TimeUtil.delay(500);
    }
    if (!command.wasExecuted() && isConnected()) {
      IAUTInfoListener listener=command.getListener();
      if (listener != null) {
        listener.error(IAUTInfoListener.ERROR_COMMUNICATION);
      }
      throw new CommunicationException(Messages.CouldNotRequestComponentsFromAUT,IAUTInfoListener.ERROR_COMMUNICATION);
    }
  }
 catch (  UnknownMessageException ume) {
    ClientTestFactory.getClientTest().fireAUTServerStateChanged(new AUTServerEvent(ume.getErrorId()));
  }
}