Program: 13238
Project: 13238
Buggy source:
/** 
 * Checks the RemoteWrappedException to determine which Exception has been wrapped and handles the appropriate Exception which is wrapped.
 * @param context the ServerContext from the original request
 * @param request the original request
 * @param exception the ConnectorException that was thrown by the facade
 * @param resourceId the resourceId being operated on
 * @param before the object value "before" the request
 * @param after the object value "after" the request
 * @param handler the ResultHandler on which to call handleError
 * @param connectorExceptionActivityLogger the ActivityLogger to use to log the exception
 */
private void handleRemoteWrappedException(ServerContext context,Request request,ConnectorException exception,String resourceId,JsonValue before,JsonValue after,ResultHandler<?> handler,ActivityLogger connectorExceptionActivityLogger){
  RemoteWrappedException remoteWrappedException=(RemoteWrappedException)exception;
  final String message=exception.getMessage();
  final Throwable cause=exception.getCause();
  if (remoteWrappedException.is(AlreadyExistsException.class)) {
    handleConnectorException(context,request,new AlreadyExistsException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConfigurationException.class)) {
    handleConnectorException(context,request,new ConfigurationException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectionBrokenException.class)) {
    handleConnectorException(context,request,new ConnectionBrokenException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectionFailedException.class)) {
    handleConnectorException(context,request,new ConnectionFailedException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectorIOException.class)) {
    handleConnectorException(context,request,new ConnectorIOException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidAttributeValueException.class)) {
    handleConnectorException(context,request,new InvalidAttributeValueException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidCredentialException.class)) {
    handleConnectorException(context,request,new InvalidCredentialException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidPasswordException.class)) {
    handleConnectorException(context,request,new InvalidPasswordException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(OperationTimeoutException.class)) {
    handleConnectorException(context,request,new OperationTimeoutException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PasswordExpiredException.class)) {
    handleConnectorException(context,request,new PasswordExpiredException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PermissionDeniedException.class)) {
    handleConnectorException(context,request,new PermissionDeniedException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PreconditionFailedException.class)) {
    handleConnectorException(context,request,new PreconditionFailedException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PreconditionRequiredException.class)) {
    handleConnectorException(context,request,new PreconditionRequiredException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(RetryableException.class)) {
    handleConnectorException(context,request,RetryableException.wrap(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(UnknownUidException.class)) {
    handleConnectorException(context,request,new UnknownUidException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectorException.class)) {
    handleConnectorException(context,request,new ConnectorException(message,cause),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else {
    handleConnectorException(context,request,DotNetExceptionHelper.fromExceptionClass(remoteWrappedException.getExceptionClass()).getConnectorException(remoteWrappedException),resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
}

Fixed version (ground truth):
/** 
 * Checks the RemoteWrappedException to determine which Exception has been wrapped and handles the appropriate Exception which is wrapped.
 * @param context the ServerContext from the original request
 * @param request the original request
 * @param exception the ConnectorException that was thrown by the facade
 * @param resourceId the resourceId being operated on
 * @param before the object value "before" the request
 * @param after the object value "after" the request
 * @param handler the ResultHandler on which to call handleError
 * @param connectorExceptionActivityLogger the ActivityLogger to use to log the exception
 */
private void handleRemoteWrappedException(ServerContext context,Request request,ConnectorException exception,String resourceContainer,String resourceId,JsonValue before,JsonValue after,ResultHandler<?> handler,ActivityLogger connectorExceptionActivityLogger){
  RemoteWrappedException remoteWrappedException=(RemoteWrappedException)exception;
  final String message=exception.getMessage();
  final Throwable cause=exception.getCause();
  if (remoteWrappedException.is(AlreadyExistsException.class)) {
    handleConnectorException(context,request,new AlreadyExistsException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConfigurationException.class)) {
    handleConnectorException(context,request,new ConfigurationException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectionBrokenException.class)) {
    handleConnectorException(context,request,new ConnectionBrokenException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectionFailedException.class)) {
    handleConnectorException(context,request,new ConnectionFailedException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectorIOException.class)) {
    handleConnectorException(context,request,new ConnectorIOException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidAttributeValueException.class)) {
    handleConnectorException(context,request,new InvalidAttributeValueException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidCredentialException.class)) {
    handleConnectorException(context,request,new InvalidCredentialException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(InvalidPasswordException.class)) {
    handleConnectorException(context,request,new InvalidPasswordException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(OperationTimeoutException.class)) {
    handleConnectorException(context,request,new OperationTimeoutException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PasswordExpiredException.class)) {
    handleConnectorException(context,request,new PasswordExpiredException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PermissionDeniedException.class)) {
    handleConnectorException(context,request,new PermissionDeniedException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PreconditionFailedException.class)) {
    handleConnectorException(context,request,new PreconditionFailedException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(PreconditionRequiredException.class)) {
    handleConnectorException(context,request,new PreconditionRequiredException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(RetryableException.class)) {
    handleConnectorException(context,request,RetryableException.wrap(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(UnknownUidException.class)) {
    handleConnectorException(context,request,new UnknownUidException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else   if (remoteWrappedException.is(ConnectorException.class)) {
    handleConnectorException(context,request,new ConnectorException(message,cause),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
 else {
    handleConnectorException(context,request,DotNetExceptionHelper.fromExceptionClass(remoteWrappedException.getExceptionClass()).getConnectorException(remoteWrappedException),resourceContainer,resourceId,before,after,handler,connectorExceptionActivityLogger);
  }
}