Program: 95789
Project: 95789
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;
  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 {
    if (!messageCap.hasDefaultMapping()) {
      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);
      }
    }
    if (!messageCap.hasDefaultMapping()) {
      Object component=findComponent(ci,timeout);
      implClass=AUTServerConfiguration.getInstance().prepareImplementationClass(component,component.getClass());
    }
 else {
      implClass=AUTServerConfiguration.getInstance().getImplementationClass(ci.getComponentClassName());
    }
    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;
}

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 {
    if (!messageCap.hasDefaultMapping()) {
      Validate.notNull(ci);
    }
    int timeout=TimingConstantsServer.DEFAULT_FIND_COMPONENT_TIMEOUT;
    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);
      }
    }
    if (!messageCap.hasDefaultMapping()) {
      Object component=findComponent(ci,timeout);
      implClass=AUTServerConfiguration.getInstance().prepareImplementationClass(component,component.getClass());
    }
 else {
      implClass=AUTServerConfiguration.getInstance().getImplementationClass(ci.getComponentClassName());
    }
    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;
}