Program: 82405
Project: 82405
Buggy source:
/** 
 * Create a new instance using the given streams and request processor. Closing either stream will cause the termination of the transport.
 * @param inputStream an input stream for reading messages
 * @param outputStream an output stream for writing messages
 * @param requestProcessor a callback interface for handling remote clientrequests
 */
public MessageTransport(final InputStream inputStream,final OutputStream outputStream,RequestProcessor requestProcessor){
  this.requestProcessor=requestProcessor;
  serverRequestExecutor=Executors.newFixedThreadPool(DEFAULT_SERVICE_THREADS);
  messageProcessingThread=new Thread(new Runnable(){
    public void run(){
      try {
        while (true) {
          Message message=Message.parseDelimitedFrom(inputStream);
          processMessage(message);
        }
      }
 catch (      IOException e) {
        terminateDueToException(e);
      }
catch (      InterruptedException e) {
        terminateDueToException(e);
      }
    }
  }
);
  messageProcessingThread.start();
  sendThread=new Thread(new Runnable(){
    public void run(){
      while (true) {
        try {
          PendingSend pendingSend=sendQueue.take();
          try {
            pendingSend.send(outputStream);
          }
 catch (          IOException e) {
            pendingSend.failed(e);
          }
        }
 catch (        InterruptedException e) {
          break;
        }
      }
    }
  }
);
  sendThread.setDaemon(true);
  sendThread.start();
}

Fixed version (ground truth):
/** 
 * Create a new instance using the given streams and request processor. Closing either stream will cause the termination of the transport.
 * @param inputStream an input stream for reading messages
 * @param outputStream an output stream for writing messages
 * @param requestProcessor a callback interface for handling remote clientrequests
 * @param terminationCallback a callback that is invoked when the transportterminates
 */
public MessageTransport(final InputStream inputStream,final OutputStream outputStream,RequestProcessor requestProcessor,TerminationCallback terminationCallback){
  this.requestProcessor=requestProcessor;
  this.terminationCallback=terminationCallback;
  serverRequestExecutor=Executors.newFixedThreadPool(DEFAULT_SERVICE_THREADS);
  messageProcessingThread=new Thread(new Runnable(){
    public void run(){
      try {
        while (true) {
          Message message=Message.parseDelimitedFrom(inputStream);
          processMessage(message);
        }
      }
 catch (      IOException e) {
        terminateDueToException(e);
      }
catch (      InterruptedException e) {
        terminateDueToException(e);
      }
    }
  }
);
  messageProcessingThread.start();
  sendThread=new Thread(new Runnable(){
    public void run(){
      while (true) {
        try {
          PendingSend pendingSend=sendQueue.take();
          try {
            pendingSend.send(outputStream);
          }
 catch (          IOException e) {
            pendingSend.failed(e);
          }
        }
 catch (        InterruptedException e) {
          break;
        }
      }
    }
  }
);
  sendThread.setDaemon(true);
  sendThread.start();
}