Program: 161740
Project: 161740
Buggy source:
/** 
 * Starts the profiler running in a new thread. If this profiler had the life cycle of:  start -> stop -> start The stats from the previous run will still be included  in this run.  If you wish to clear out previous runs  you must call {#link reset()} first. If an executor is provided, this call will block until the the  profiler has been started on the provided executor.
 * @param executor executor to execute on, or null if new thread should be created
 */
public void start(Executor executor){
synchronized (startStopLock) {
    if (collectorThread.get() == null) {
      final ProfilerRunner pr=new ProfilerRunner();
      if (executor == null) {
        Thread thread=new Thread(pr);
        collectorThread.set(thread);
        thread.setName(COLLECTOR_THREAD_NAME);
        thread.setPriority(Thread.MAX_PRIORITY);
        thread.start();
      }
 else {
        final ListenableFutureTask<Thread> runningThreadFuture;
        runningThreadFuture=new ListenableFutureTask<Thread>(false,new Runnable(){
          @Override public void run(){
          }
        }
);
        executor.execute(new Runnable(){
          @Override public void run(){
            try {
              if (!collectorThread.compareAndSet(null,Thread.currentThread())) {
                return;
              }
            }
  finally {
              runningThreadFuture.run();
            }
            pr.run();
          }
        }
);
        try {
          runningThreadFuture.get();
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
          return;
        }
catch (        ExecutionException e) {
          throw ExceptionUtils.makeRuntime(e.getCause());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Starts the profiler running in a new thread. If this profiler had the life cycle of:  start -> stop -> start The stats from the previous run will still be included  in this run.  If you wish to clear out previous runs  you must call {#link reset()} first. If an executor is provided, this call will block until the the  profiler has been started on the provided executor.
 * @param executor executor to execute on, or null if new thread should be created
 */
public void start(Executor executor){
synchronized (startStopLock) {
    if (collectorThread.get() == null) {
      final ProfilerRunner pr=new ProfilerRunner();
      if (executor == null) {
        Thread thread=new Thread(pr);
        collectorThread.set(thread);
        thread.setName(COLLECTOR_THREAD_NAME);
        thread.setPriority(Thread.MAX_PRIORITY);
        thread.start();
      }
 else {
        final SettableListenableFuture<?> runningThreadFuture;
        runningThreadFuture=new SettableListenableFuture<Object>();
        executor.execute(new Runnable(){
          @Override public void run(){
            try {
              if (!collectorThread.compareAndSet(null,Thread.currentThread())) {
                return;
              }
            }
  finally {
              runningThreadFuture.setResult(null);
            }
            pr.run();
          }
        }
);
        try {
          runningThreadFuture.get();
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
          return;
        }
catch (        ExecutionException e) {
          throw ExceptionUtils.makeRuntime(e.getCause());
        }
      }
    }
  }
}