Program: 77381
Project: 77381
Buggy source:
/** 
 * Forks all tasks in the specified collection, returning when  {@code isDone} holds for each task or an (unchecked) exceptionis encountered, in which case the exception is rethrown. If more than one task encounters an exception, then this method throws any one of these exceptions. If any task encounters an exception, others may be cancelled. However, the execution status of individual tasks is not guaranteed upon exceptional return. The status of each task may be obtained using  {@link #getException()} and related methods to check if they have beencancelled, completed normally or exceptionally, or left unprocessed.
 * @param tasks the collection of tasks
 * @return the tasks argument, to simplify usage
 * @throws NullPointerException if tasks or any element are null
 */
public static <T extends ForkJoinTask<?>>Collection<T> invokeAll(Collection<T> tasks){
  if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) {
    invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()]));
    return tasks;
  }
  @SuppressWarnings("String_Node_Str") List<? extends ForkJoinTask<?>> ts=(List<? extends ForkJoinTask<?>>)tasks;
  Throwable ex=null;
  int last=ts.size() - 1;
  for (int i=last; i >= 0; --i) {
    ForkJoinTask<?> t=ts.get(i);
    if (t == null) {
      if (ex == null)       ex=new NullPointerException();
    }
 else     if (i != 0)     t.fork();
 else     if (t.doInvoke() < NORMAL && ex == null)     ex=t.getException();
  }
  for (int i=1; i <= last; ++i) {
    ForkJoinTask<?> t=ts.get(i);
    if (t != null) {
      if (ex != null)       t.cancel(false);
 else       if (t.doJoin() < NORMAL)       ex=t.getException();
    }
  }
  if (ex != null)   rethrow(ex);
  return tasks;
}

Fixed version (ground truth):
/** 
 * Forks all tasks in the specified collection, returning when  {@code isDone} holds for each task or an (unchecked) exceptionis encountered, in which case the exception is rethrown. If more than one task encounters an exception, then this method throws any one of these exceptions. If any task encounters an exception, others may be cancelled. However, the execution status of individual tasks is not guaranteed upon exceptional return. The status of each task may be obtained using  {@link #getException()} and related methods to check if they have beencancelled, completed normally or exceptionally, or left unprocessed.
 * @param tasks the collection of tasks
 * @param < T > the type of the values returned from the tasks
 * @return the tasks argument, to simplify usage
 * @throws NullPointerException if tasks or any element are null
 */
public static <T extends ForkJoinTask<?>>Collection<T> invokeAll(Collection<T> tasks){
  if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) {
    invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()]));
    return tasks;
  }
  @SuppressWarnings("String_Node_Str") List<? extends ForkJoinTask<?>> ts=(List<? extends ForkJoinTask<?>>)tasks;
  Throwable ex=null;
  int last=ts.size() - 1;
  for (int i=last; i >= 0; --i) {
    ForkJoinTask<?> t=ts.get(i);
    if (t == null) {
      if (ex == null)       ex=new NullPointerException();
    }
 else     if (i != 0)     t.fork();
 else     if (t.doInvoke() < NORMAL && ex == null)     ex=t.getException();
  }
  for (int i=1; i <= last; ++i) {
    ForkJoinTask<?> t=ts.get(i);
    if (t != null) {
      if (ex != null)       t.cancel(false);
 else       if (t.doJoin() < NORMAL)       ex=t.getException();
    }
  }
  if (ex != null)   rethrow(ex);
  return tasks;
}