Program: 95958
Project: 95958
Buggy source:
/** 
 * Gets the implementation class. 
 * @param response The response message.
 * @return the implementation class or null if an error occurs.
 */
protected Object getImplClass(CAPTestResponseMessage response){
  Object implClass=null;
  IComponentIdentifier ci=m_capTestMessage.getMessageCap().getCi();
  if (LOG.isInfoEnabled()) {
    LOG.info("String_Node_Str" + (ci == null ? "String_Node_Str" : ci.getComponentClassName()));
  }
  try {
    Validate.notNull(ci);
    int timeout=500;
    boolean isWaitForComponent=m_capTestMessage.getMessageCap().getMethod().equals("String_Node_Str");
    if (isWaitForComponent) {
      MessageParam timeoutParam=(MessageParam)m_capTestMessage.getMessageCap().getMessageParams().get(0);
      try {
        timeout=Integer.parseInt(timeoutParam.getValue());
      }
 catch (      NumberFormatException e) {
        LOG.warn("String_Node_Str" + "String_Node_Str",e);
      }
    }
    Object component=findComponent(ci,timeout);
    implClass=AUTServerConfiguration.getInstance().prepareImplementationClass(component,component.getClass());
    if (isWaitForComponent) {
      MessageParam delayParam=(MessageParam)m_capTestMessage.getMessageCap().getMessageParams().get(1);
      try {
        int delay=Integer.parseInt(delayParam.getValue());
        TimeUtil.delay(delay);
      }
 catch (      IllegalArgumentException iae) {
        handleInvalidInput("String_Node_Str" + CompSystemI18n.getString("String_Node_Str") + "String_Node_Str");
      }
    }
  }
 catch (  IllegalArgumentException e) {
    handleComponentNotFound(response,e);
  }
catch (  ComponentNotFoundException e) {
    MessageCap cap=m_capTestMessage.getMessageCap();
    if ("String_Node_Str".equals(cap.getMethod())) {
      MessageParam isVisibleParam=(MessageParam)cap.getMessageParams().get(0);
      handleComponentDoesNotExist(response,Boolean.valueOf(isVisibleParam.getValue()).booleanValue());
    }
 else {
      handleComponentNotFound(response,e);
    }
  }
catch (  UnsupportedComponentException buce) {
    LOG.error(buce.getLocalizedMessage(),buce);
    response.setTestErrorEvent(EventFactory.createConfigErrorEvent());
  }
catch (  Throwable e) {
    if (LOG.isErrorEnabled()) {
      LOG.error(e.getLocalizedMessage(),e);
    }
    response.setTestErrorEvent(EventFactory.createImplClassErrorEvent());
  }
  return implClass;
}

Fixed version (ground truth):
/** 
 * Gets the implementation class. 
 * @param response The response message.
 * @return the implementation class or null if an error occurs.
 */
protected Object getImplClass(CAPTestResponseMessage response){
  Object implClass=null;
  final MessageCap messageCap=m_capTestMessage.getMessageCap();
  IComponentIdentifier ci=messageCap.getCi();
  if (LOG.isInfoEnabled()) {
    LOG.info("String_Node_Str" + (ci == null ? "String_Node_Str" : ci.getComponentClassName()));
  }
  try {
    Validate.notNull(ci);
    int timeout=500;
    boolean isWaitForComponent=WidgetTester.RC_METHOD_NAME_WAIT_FOR_COMPONENT.equals(messageCap.getMethod());
    if (isWaitForComponent) {
      MessageParam timeoutParam=(MessageParam)messageCap.getMessageParams().get(0);
      try {
        timeout=Integer.parseInt(timeoutParam.getValue());
      }
 catch (      NumberFormatException e) {
        LOG.warn("String_Node_Str" + "String_Node_Str",e);
      }
    }
    Object component=findComponent(ci,timeout);
    implClass=AUTServerConfiguration.getInstance().prepareImplementationClass(component,component.getClass());
    if (isWaitForComponent) {
      MessageParam delayParam=(MessageParam)messageCap.getMessageParams().get(1);
      try {
        int delay=Integer.parseInt(delayParam.getValue());
        TimeUtil.delay(delay);
      }
 catch (      IllegalArgumentException iae) {
        handleInvalidInput("String_Node_Str" + CompSystemI18n.getString("String_Node_Str") + "String_Node_Str");
      }
    }
  }
 catch (  IllegalArgumentException e) {
    handleComponentNotFound(response,e);
  }
catch (  ComponentNotFoundException e) {
    if (WidgetTester.RC_METHOD_NAME_CHECK_EXISTENCE.equals(messageCap.getMethod())) {
      MessageParam isVisibleParam=(MessageParam)messageCap.getMessageParams().get(0);
      handleComponentDoesNotExist(response,Boolean.valueOf(isVisibleParam.getValue()).booleanValue());
    }
 else {
      handleComponentNotFound(response,e);
    }
  }
catch (  UnsupportedComponentException buce) {
    LOG.error(buce.getLocalizedMessage(),buce);
    response.setTestErrorEvent(EventFactory.createConfigErrorEvent());
  }
catch (  Throwable e) {
    if (LOG.isErrorEnabled()) {
      LOG.error(e.getLocalizedMessage(),e);
    }
    response.setTestErrorEvent(EventFactory.createImplClassErrorEvent());
  }
  return implClass;
}