Program: 77371
Project: 77371
Buggy source:
/** 
 * Creates a new sequential or parallel   {@code Stream} from a{@code Supplier} of {@code Spliterator}. <p>The   {@link Supplier#get()} method will be invoked on the supplier nomore than once, and after the terminal operation of the stream pipeline commences. <p>For spliterators that report a characteristic of  {@code IMMUTABLE}or   {@code CONCURRENT}, or that are <a href="../Spliterator.html#binding">late-binding</a>, it is likely more efficient to use   {@link #stream(java.util.Spliterator,boolean)}instead. The use of a   {@code Supplier} in this form provides a level ofindirection that reduces the scope of potential interference with the source.  Since the supplier is only invoked after the terminal operation commences, any modifications to the source up to the start of the terminal operation are reflected in the stream result.  See <a href="package-summary.html#Non-Interference">Non-Interference</a> for more details.
 * @param supplier a {@code Supplier} of a {@code Spliterator}
 * @param characteristics Spliterator characteristics of the supplied{@code Spliterator}.  The characteristics must be equal to  {@code supplier.get().characteristics()}.
 * @param parallel if {@code true} then the returned stream is a parallelstream; if  {@code false} the returned stream is a sequentialstream.
 * @return a new sequential or parallel {@code Stream}
 * @see #stream(java.util.Spliterator,boolean)
 */
public static <T>Stream<T> stream(Supplier<? extends Spliterator<T>> supplier,int characteristics,boolean parallel){
  Objects.requireNonNull(supplier);
  return new ReferencePipeline.Head<>(supplier,StreamOpFlag.fromCharacteristics(characteristics),parallel);
}

Fixed version (ground truth):
/** 
 * Creates a new sequential or parallel   {@code Stream} from a{@code Supplier} of {@code Spliterator}. <p>The   {@link Supplier#get()} method will be invoked on the supplier nomore than once, and after the terminal operation of the stream pipeline commences. <p>For spliterators that report a characteristic of  {@code IMMUTABLE}or   {@code CONCURRENT}, or that are <a href="../Spliterator.html#binding">late-binding</a>, it is likely more efficient to use   {@link #stream(java.util.Spliterator,boolean)}instead. The use of a   {@code Supplier} in this form provides a level ofindirection that reduces the scope of potential interference with the source.  Since the supplier is only invoked after the terminal operation commences, any modifications to the source up to the start of the terminal operation are reflected in the stream result.  See <a href="package-summary.html#Non-Interference">Non-Interference</a> for more details.
 * @param < T > the type of stream elements
 * @param supplier a {@code Supplier} of a {@code Spliterator}
 * @param characteristics Spliterator characteristics of the supplied{@code Spliterator}.  The characteristics must be equal to  {@code supplier.get().characteristics()}.
 * @param parallel if {@code true} then the returned stream is a parallelstream; if  {@code false} the returned stream is a sequentialstream.
 * @return a new sequential or parallel {@code Stream}
 * @see #stream(java.util.Spliterator,boolean)
 */
public static <T>Stream<T> stream(Supplier<? extends Spliterator<T>> supplier,int characteristics,boolean parallel){
  Objects.requireNonNull(supplier);
  return new ReferencePipeline.Head<>(supplier,StreamOpFlag.fromCharacteristics(characteristics),parallel);
}