Program: 160310
Project: 160310
Buggy source:
public void testPusherDeletedDoc() throws Throwable {
  CountDownLatch replicationDoneSignal=new CountDownLatch(1);
  URL remote=getReplicationURL();
  String docIdTimestamp=Long.toString(System.currentTimeMillis());
  Map<String,Object> documentProperties=new HashMap<String,Object>();
  final String doc1Id=String.format("String_Node_Str",docIdTimestamp);
  documentProperties.put("String_Node_Str",doc1Id);
  documentProperties.put("String_Node_Str",1);
  documentProperties.put("String_Node_Str",false);
  CBLBody body=new CBLBody(documentProperties);
  CBLRevision rev1=new CBLRevision(body,database);
  CBLStatus status=new CBLStatus();
  rev1=database.putRevision(rev1,null,false,status);
  Assert.assertEquals(CBLStatus.CREATED,status.getCode());
  documentProperties.put("String_Node_Str",rev1.getRevId());
  documentProperties.put("String_Node_Str",true);
  documentProperties.put("String_Node_Str",true);
  @SuppressWarnings("String_Node_Str") CBLRevision rev2=database.putRevision(new CBLRevision(documentProperties,database),rev1.getRevId(),false,status);
  Assert.assertTrue(status.getCode() >= 200 && status.getCode() < 300);
  final CBLReplicator repl=database.getReplicator(remote,true,false,server.getWorkExecutor());
  ((CBLPusher)repl).setCreateTarget(true);
  AsyncTask replicationTask=new AsyncTask<Object,Object,Object>(){
    @Override protected Object doInBackground(    Object... aParams){
      repl.start();
      Assert.assertTrue(repl.isRunning());
      return null;
    }
  }
;
  replicationTask.execute();
  ReplicationObserver replicationObserver=new ReplicationObserver(replicationDoneSignal);
  repl.addObserver(replicationObserver);
  Log.d(TAG,"String_Node_Str");
  try {
    replicationDoneSignal.await();
    Log.d(TAG,"String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  URL replicationUrlTrailing=new URL(String.format("String_Node_Str",remote.toExternalForm()));
  final URL pathToDoc=new URL(replicationUrlTrailing,doc1Id);
  Log.d(TAG,"String_Node_Str" + pathToDoc);
  final CountDownLatch httpRequestDoneSignal=new CountDownLatch(1);
  AsyncTask getDocTask=new AsyncTask<Object,Object,Object>(){
    @Override protected Object doInBackground(    Object... aParams){
      org.apache.http.client.HttpClient httpclient=new DefaultHttpClient();
      HttpResponse response;
      String responseString=null;
      try {
        response=httpclient.execute(new HttpGet(pathToDoc.toExternalForm()));
        StatusLine statusLine=response.getStatusLine();
        return statusLine;
      }
 catch (      ClientProtocolException e) {
        Assert.assertNull("String_Node_Str" + e.getLocalizedMessage(),e);
      }
catch (      IOException e) {
        Assert.assertNull("String_Node_Str" + e.getLocalizedMessage(),e);
      }
      httpRequestDoneSignal.countDown();
      return null;
    }
    @Override protected void onPostExecute(    Object o){
      StatusLine statusLine=(StatusLine)o;
      Assert.assertEquals(HttpStatus.SC_NOT_FOUND,statusLine.getStatusCode());
    }
  }
;
  getDocTask.execute();
  Log.d(TAG,"String_Node_Str");
  try {
    httpRequestDoneSignal.await();
    Log.d(TAG,"String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void testPusherDeletedDoc() throws Throwable {
  CountDownLatch replicationDoneSignal=new CountDownLatch(1);
  URL remote=getReplicationURL();
  String docIdTimestamp=Long.toString(System.currentTimeMillis());
  Map<String,Object> documentProperties=new HashMap<String,Object>();
  final String doc1Id=String.format("String_Node_Str",docIdTimestamp);
  documentProperties.put("String_Node_Str",doc1Id);
  documentProperties.put("String_Node_Str",1);
  documentProperties.put("String_Node_Str",false);
  CBLBody body=new CBLBody(documentProperties);
  CBLRevision rev1=new CBLRevision(body,database);
  CBLStatus status=new CBLStatus();
  rev1=database.putRevision(rev1,null,false,status);
  Assert.assertEquals(CBLStatus.CREATED,status.getCode());
  documentProperties.put("String_Node_Str",rev1.getRevId());
  documentProperties.put("String_Node_Str",true);
  documentProperties.put("String_Node_Str",true);
  @SuppressWarnings("String_Node_Str") CBLRevision rev2=database.putRevision(new CBLRevision(documentProperties,database),rev1.getRevId(),false,status);
  Assert.assertTrue(status.getCode() >= 200 && status.getCode() < 300);
  final CBLReplicator repl=database.getReplicator(remote,true,false,server.getWorkExecutor());
  ((CBLPusher)repl).setCreateTarget(true);
  AsyncTask replicationTask=new AsyncTask<Object,Object,Object>(){
    @Override protected Object doInBackground(    Object... aParams){
      repl.start();
      Assert.assertTrue(repl.isRunning());
      return null;
    }
  }
;
  replicationTask.execute();
  ReplicationObserver replicationObserver=new ReplicationObserver(replicationDoneSignal);
  repl.addObserver(replicationObserver);
  Log.d(TAG,"String_Node_Str");
  try {
    replicationDoneSignal.await();
    Log.d(TAG,"String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  URL replicationUrlTrailing=new URL(String.format("String_Node_Str",remote.toExternalForm()));
  final URL pathToDoc=new URL(replicationUrlTrailing,doc1Id);
  Log.d(TAG,"String_Node_Str" + pathToDoc);
  final CountDownLatch httpRequestDoneSignal=new CountDownLatch(1);
  AsyncTask getDocTask=new AsyncTask<Object,Object,Object>(){
    @Override protected Object doInBackground(    Object... aParams){
      org.apache.http.client.HttpClient httpclient=new DefaultHttpClient();
      HttpResponse response;
      String responseString=null;
      try {
        response=httpclient.execute(new HttpGet(pathToDoc.toExternalForm()));
        StatusLine statusLine=response.getStatusLine();
        Log.d(TAG,"String_Node_Str" + statusLine);
        return statusLine;
      }
 catch (      ClientProtocolException e) {
        Assert.assertNull("String_Node_Str" + e.getLocalizedMessage(),e);
      }
catch (      IOException e) {
        Assert.assertNull("String_Node_Str" + e.getLocalizedMessage(),e);
      }
 finally {
        httpRequestDoneSignal.countDown();
      }
      return null;
    }
    @Override protected void onPostExecute(    Object o){
      Log.d(TAG,"String_Node_Str" + o);
      StatusLine statusLine=(StatusLine)o;
      Assert.assertEquals(HttpStatus.SC_NOT_FOUND,statusLine.getStatusCode());
    }
  }
;
  getDocTask.execute();
  Log.d(TAG,"String_Node_Str");
  try {
    httpRequestDoneSignal.await();
    Log.d(TAG,"String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  Log.d(TAG,"String_Node_Str");
}