nus-yam/ex-repair huggingface dataset:
Program: 60005
Project: 60005
Buggy source:
private static <K,V>ImmutableSortedMap<K,V> fromEntries(final Comparator<? super K> comparator,boolean sameComparator,Entry<K,V>[] entryArray,int size){
switch (size) {
case 0:
    return emptyMap(comparator);
case 1:
  return ImmutableSortedMap.<K,V>of(comparator,entryArray[0].getKey(),entryArray[0].getValue());
default :
Object[] keys=new Object[size];
Object[] values=new Object[size];
if (sameComparator) {
for (int i=0; i < size; i++) {
Object key=entryArray[i].getKey();
Object value=entryArray[i].getValue();
checkEntryNotNull(key,value);
keys[i]=key;
values[i]=value;
}
}
 else {
Arrays.sort(entryArray,0,size,new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1,Entry<K,V> e2){
  return comparator.compare(e1.getKey(),e2.getKey());
}
}
);
K prevKey=entryArray[0].getKey();
keys[0]=prevKey;
values[0]=entryArray[0].getValue();
for (int i=1; i < size; i++) {
K key=entryArray[i].getKey();
V value=entryArray[i].getValue();
checkEntryNotNull(key,value);
keys[i]=key;
values[i]=value;
checkNoConflict(comparator.compare(prevKey,key) != 0,"String_Node_Str",entryArray[i - 1],entryArray[i]);
prevKey=key;
}
}
return new ImmutableSortedMap<>(new RegularImmutableSortedSet<K>(new RegularImmutableList<K>(keys),comparator),new RegularImmutableList<V>(values));
}
}

Fixed version (ground truth):
private static <K,V>ImmutableSortedMap<K,V> fromEntries(final Comparator<? super K> comparator,boolean sameComparator,Entry<K,V>[] entryArray,int size){
switch (size) {
case 0:
    return emptyMap(comparator);
case 1:
  return ImmutableSortedMap.<K,V>of(comparator,entryArray[0].getKey(),entryArray[0].getValue());
default :
Object[] keys=new Object[size];
Object[] values=new Object[size];
if (sameComparator) {
for (int i=0; i < size; i++) {
Object key=entryArray[i].getKey();
Object value=entryArray[i].getValue();
checkEntryNotNull(key,value);
keys[i]=key;
values[i]=value;
}
}
 else {
Arrays.sort(entryArray,0,size,new Comparator<Entry<K,V>>(){
@Override public int compare(Entry<K,V> e1,Entry<K,V> e2){
  return comparator.compare(e1.getKey(),e2.getKey());
}
}
);
K prevKey=entryArray[0].getKey();
keys[0]=prevKey;
values[0]=entryArray[0].getValue();
checkEntryNotNull(keys[0],values[0]);
for (int i=1; i < size; i++) {
K key=entryArray[i].getKey();
V value=entryArray[i].getValue();
checkEntryNotNull(key,value);
keys[i]=key;
values[i]=value;
checkNoConflict(comparator.compare(prevKey,key) != 0,"String_Node_Str",entryArray[i - 1],entryArray[i]);
prevKey=key;
}
}
return new ImmutableSortedMap<>(new RegularImmutableSortedSet<K>(new RegularImmutableList<K>(keys),comparator),new RegularImmutableList<V>(values));
}
}
Program: 60006
Project: 60006
Buggy source:
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRemoveAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.removeAll(null);
  }
 catch (  NullPointerException expected) {
  }
}

Fixed version (ground truth):
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRemoveAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.removeAll(null);
  }
 catch (  NullPointerException tolerated) {
  }
}
Program: 60007
Project: 60007
Buggy source:
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRetainAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.retainAll(null);
  }
 catch (  NullPointerException expected) {
  }
}

Fixed version (ground truth):
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRetainAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.retainAll(null);
  }
 catch (  NullPointerException tolerated) {
  }
}
Program: 60008
Project: 60008
Buggy source:
@Override public <E>E[] toArray(E[] a){
  return toArrayList(this).toArray(a);
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] a){
  return toArrayList(this).toArray(a);
}
Program: 60009
Project: 60009
Buggy source:
private static long hashLength65Plus(byte[] bytes,int offset,int length){
  final int seed=81;
  long x=seed;
  @SuppressWarnings("String_Node_Str") long y=seed * K1 + 113;
  long z=shiftMix(y * K2 + 113) * K2;
  long[] v=new long[2], w=new long[2];
  x=x * K2 + load64(bytes,offset);
  int end=offset + ((length - 1) / 64) * 64;
  int last64offset=end + ((length - 1) & 63) - 63;
  do {
    x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * K1;
    y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * K1;
    x^=w[1];
    y+=v[0] + load64(bytes,offset + 40);
    z=rotateRight(z + w[0],33) * K1;
    weakHashLength32WithSeeds(bytes,offset,v[1] * K1,x + w[0],v);
    weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
    long tmp=x;
    x=z;
    z=tmp;
    offset+=64;
  }
 while (offset != end);
  long mul=K1 + ((z & 0xFF) << 1);
  offset=last64offset;
  w[0]+=((length - 1) & 63);
  v[0]+=w[0];
  w[0]+=v[0];
  x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * mul;
  y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * mul;
  x^=w[1] * 9;
  y+=v[0] * 9 + load64(bytes,offset + 40);
  z=rotateRight(z + w[0],33) * mul;
  weakHashLength32WithSeeds(bytes,offset,v[1] * mul,x + w[0],v);
  weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
  return hashLength16(hashLength16(v[0],w[0],mul) + shiftMix(y) * K0 + x,hashLength16(v[1],w[1],mul) + z,mul);
}

Fixed version (ground truth):
private static long hashLength65Plus(byte[] bytes,int offset,int length){
  final int seed=81;
  long x=seed;
  @SuppressWarnings("String_Node_Str") long y=seed * K1 + 113;
  long z=shiftMix(y * K2 + 113) * K2;
  long[] v=new long[2];
  long[] w=new long[2];
  x=x * K2 + load64(bytes,offset);
  int end=offset + ((length - 1) / 64) * 64;
  int last64offset=end + ((length - 1) & 63) - 63;
  do {
    x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * K1;
    y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * K1;
    x^=w[1];
    y+=v[0] + load64(bytes,offset + 40);
    z=rotateRight(z + w[0],33) * K1;
    weakHashLength32WithSeeds(bytes,offset,v[1] * K1,x + w[0],v);
    weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
    long tmp=x;
    x=z;
    z=tmp;
    offset+=64;
  }
 while (offset != end);
  long mul=K1 + ((z & 0xFF) << 1);
  offset=last64offset;
  w[0]+=((length - 1) & 63);
  v[0]+=w[0];
  w[0]+=v[0];
  x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * mul;
  y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * mul;
  x^=w[1] * 9;
  y+=v[0] * 9 + load64(bytes,offset + 40);
  z=rotateRight(z + w[0],33) * mul;
  weakHashLength32WithSeeds(bytes,offset,v[1] * mul,x + w[0],v);
  weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
  return hashLength16(hashLength16(v[0],w[0],mul) + shiftMix(y) * K0 + x,hashLength16(v[1],w[1],mul) + z,mul);
}
Program: 60010
Project: 60010
Buggy source:
private static ThreadFactory build(ThreadFactoryBuilder builder){
  final String nameFormat=builder.nameFormat;
  final Boolean daemon=builder.daemon;
  final Integer priority=builder.priority;
  final UncaughtExceptionHandler uncaughtExceptionHandler=builder.uncaughtExceptionHandler;
  final ThreadFactory backingThreadFactory=(builder.backingThreadFactory != null) ? builder.backingThreadFactory : Executors.defaultThreadFactory();
  final AtomicLong count=(nameFormat != null) ? new AtomicLong(0) : null;
  return new ThreadFactory(){
    @Override public Thread newThread(    Runnable runnable){
      Thread thread=backingThreadFactory.newThread(runnable);
      if (nameFormat != null) {
        thread.setName(format(nameFormat,count.getAndIncrement()));
      }
      if (daemon != null) {
        thread.setDaemon(daemon);
      }
      if (priority != null) {
        thread.setPriority(priority);
      }
      if (uncaughtExceptionHandler != null) {
        thread.setUncaughtExceptionHandler(uncaughtExceptionHandler);
      }
      return thread;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a new thread factory using the options supplied during the building process. After building, it is still possible to change the options used to build the ThreadFactory and/or build again. State is not shared amongst built instances.
 * @return the fully constructed {@link ThreadFactory}
 */
@CheckReturnValue public ThreadFactory build(){
  return doBuild(this);
}
Program: 60011
Project: 60011
Buggy source:
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRemoveAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.removeAll(null);
  }
 catch (  NullPointerException expected) {
  }
}

Fixed version (ground truth):
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRemoveAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.removeAll(null);
  }
 catch (  NullPointerException tolerated) {
  }
}
Program: 60012
Project: 60012
Buggy source:
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRetainAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.retainAll(null);
  }
 catch (  NullPointerException expected) {
  }
}

Fixed version (ground truth):
@CollectionFeature.Require(SUPPORTS_REMOVE) @CollectionSize.Require(ZERO) public void testRetainAll_nullCollectionReferenceEmptySubject(){
  try {
    collection.retainAll(null);
  }
 catch (  NullPointerException tolerated) {
  }
}
Program: 60013
Project: 60013
Buggy source:
@Override public <E>E[] toArray(E[] a){
  return toArrayList(this).toArray(a);
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] a){
  return toArrayList(this).toArray(a);
}
Program: 60014
Project: 60014
Buggy source:
private static long hashLength65Plus(byte[] bytes,int offset,int length){
  final int seed=81;
  long x=seed;
  @SuppressWarnings("String_Node_Str") long y=seed * K1 + 113;
  long z=shiftMix(y * K2 + 113) * K2;
  long[] v=new long[2], w=new long[2];
  x=x * K2 + load64(bytes,offset);
  int end=offset + ((length - 1) / 64) * 64;
  int last64offset=end + ((length - 1) & 63) - 63;
  do {
    x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * K1;
    y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * K1;
    x^=w[1];
    y+=v[0] + load64(bytes,offset + 40);
    z=rotateRight(z + w[0],33) * K1;
    weakHashLength32WithSeeds(bytes,offset,v[1] * K1,x + w[0],v);
    weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
    long tmp=x;
    x=z;
    z=tmp;
    offset+=64;
  }
 while (offset != end);
  long mul=K1 + ((z & 0xFF) << 1);
  offset=last64offset;
  w[0]+=((length - 1) & 63);
  v[0]+=w[0];
  w[0]+=v[0];
  x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * mul;
  y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * mul;
  x^=w[1] * 9;
  y+=v[0] * 9 + load64(bytes,offset + 40);
  z=rotateRight(z + w[0],33) * mul;
  weakHashLength32WithSeeds(bytes,offset,v[1] * mul,x + w[0],v);
  weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
  return hashLength16(hashLength16(v[0],w[0],mul) + shiftMix(y) * K0 + x,hashLength16(v[1],w[1],mul) + z,mul);
}

Fixed version (ground truth):
private static long hashLength65Plus(byte[] bytes,int offset,int length){
  final int seed=81;
  long x=seed;
  @SuppressWarnings("String_Node_Str") long y=seed * K1 + 113;
  long z=shiftMix(y * K2 + 113) * K2;
  long[] v=new long[2];
  long[] w=new long[2];
  x=x * K2 + load64(bytes,offset);
  int end=offset + ((length - 1) / 64) * 64;
  int last64offset=end + ((length - 1) & 63) - 63;
  do {
    x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * K1;
    y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * K1;
    x^=w[1];
    y+=v[0] + load64(bytes,offset + 40);
    z=rotateRight(z + w[0],33) * K1;
    weakHashLength32WithSeeds(bytes,offset,v[1] * K1,x + w[0],v);
    weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
    long tmp=x;
    x=z;
    z=tmp;
    offset+=64;
  }
 while (offset != end);
  long mul=K1 + ((z & 0xFF) << 1);
  offset=last64offset;
  w[0]+=((length - 1) & 63);
  v[0]+=w[0];
  w[0]+=v[0];
  x=rotateRight(x + y + v[0]+ load64(bytes,offset + 8),37) * mul;
  y=rotateRight(y + v[1] + load64(bytes,offset + 48),42) * mul;
  x^=w[1] * 9;
  y+=v[0] * 9 + load64(bytes,offset + 40);
  z=rotateRight(z + w[0],33) * mul;
  weakHashLength32WithSeeds(bytes,offset,v[1] * mul,x + w[0],v);
  weakHashLength32WithSeeds(bytes,offset + 32,z + w[1],y + load64(bytes,offset + 16),w);
  return hashLength16(hashLength16(v[0],w[0],mul) + shiftMix(y) * K0 + x,hashLength16(v[1],w[1],mul) + z,mul);
}
Program: 60015
Project: 60015
Buggy source:
private static ThreadFactory build(ThreadFactoryBuilder builder){
  final String nameFormat=builder.nameFormat;
  final Boolean daemon=builder.daemon;
  final Integer priority=builder.priority;
  final UncaughtExceptionHandler uncaughtExceptionHandler=builder.uncaughtExceptionHandler;
  final ThreadFactory backingThreadFactory=(builder.backingThreadFactory != null) ? builder.backingThreadFactory : Executors.defaultThreadFactory();
  final AtomicLong count=(nameFormat != null) ? new AtomicLong(0) : null;
  return new ThreadFactory(){
    @Override public Thread newThread(    Runnable runnable){
      Thread thread=backingThreadFactory.newThread(runnable);
      if (nameFormat != null) {
        thread.setName(format(nameFormat,count.getAndIncrement()));
      }
      if (daemon != null) {
        thread.setDaemon(daemon);
      }
      if (priority != null) {
        thread.setPriority(priority);
      }
      if (uncaughtExceptionHandler != null) {
        thread.setUncaughtExceptionHandler(uncaughtExceptionHandler);
      }
      return thread;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a new thread factory using the options supplied during the building process. After building, it is still possible to change the options used to build the ThreadFactory and/or build again. State is not shared amongst built instances.
 * @return the fully constructed {@link ThreadFactory}
 */
@CheckReturnValue public ThreadFactory build(){
  return doBuild(this);
}
Program: 60016
Project: 60016
Buggy source:
@Override public final void run(){
  if (isDone()) {
    return;
  }
  Thread currentThread=Thread.currentThread();
  if (!compareAndSet(null,currentThread)) {
    return;
  }
  T result=null;
  Throwable error=null;
  try {
    result=runInterruptibly();
  }
 catch (  Throwable t) {
    error=t;
  }
 finally {
    if (!compareAndSet(currentThread,DONE)) {
      while (get() == INTERRUPTING) {
        Thread.yield();
      }
    }
    afterRanInterruptibly(result,error);
  }
}

Fixed version (ground truth):
@Override public final void run(){
  Thread currentThread=Thread.currentThread();
  if (!compareAndSet(null,currentThread)) {
    return;
  }
  boolean run=!isDone();
  T result=null;
  Throwable error=null;
  try {
    if (run) {
      result=runInterruptibly();
    }
  }
 catch (  Throwable t) {
    error=t;
  }
 finally {
    if (!compareAndSet(currentThread,DONE)) {
      while (get() == INTERRUPTING) {
        Thread.yield();
      }
    }
    if (run) {
      afterRanInterruptibly(result,error);
    }
  }
}
Program: 60017
Project: 60017
Buggy source:
@Override public final void run(){
  if (isDone()) {
    return;
  }
  Thread currentThread=Thread.currentThread();
  if (!compareAndSet(null,currentThread)) {
    return;
  }
  T result=null;
  Throwable error=null;
  try {
    result=runInterruptibly();
  }
 catch (  Throwable t) {
    error=t;
  }
 finally {
    if (!compareAndSet(currentThread,DONE)) {
      while (get() == INTERRUPTING) {
        Thread.yield();
      }
    }
    afterRanInterruptibly(result,error);
  }
}

Fixed version (ground truth):
@Override public final void run(){
  Thread currentThread=Thread.currentThread();
  if (!compareAndSet(null,currentThread)) {
    return;
  }
  boolean run=!isDone();
  T result=null;
  Throwable error=null;
  try {
    if (run) {
      result=runInterruptibly();
    }
  }
 catch (  Throwable t) {
    error=t;
  }
 finally {
    if (!compareAndSet(currentThread,DONE)) {
      while (get() == INTERRUPTING) {
        Thread.yield();
      }
    }
    if (run) {
      afterRanInterruptibly(result,error);
    }
  }
}
Program: 60018
Project: 60018
Buggy source:
@GwtIncompatible public void testSetFutureDelegateLaterInterrupted() throws Exception {
  assertThat(future.setFuture(delegate)).isTrue();
  delegate.cancel(true);
  assertCancelled(future,delegate instanceof TrustedFuture);
}

Fixed version (ground truth):
public void testSetFutureDelegateLaterInterrupted() throws Exception {
  assertThat(future.setFuture(delegate)).isTrue();
  delegate.cancel(true);
  assertCancelled(future,false);
}
Program: 60019
Project: 60019
Buggy source:
@GwtIncompatible public void testSetFutureDelegateAlreadyInterrupted() throws Exception {
  delegate.cancel(true);
  assertThat(future.setFuture(delegate)).isTrue();
  assertCancelled(future,delegate instanceof TrustedFuture);
}

Fixed version (ground truth):
public void testSetFutureDelegateAlreadyInterrupted() throws Exception {
  delegate.cancel(true);
  assertThat(future.setFuture(delegate)).isTrue();
  assertCancelled(future,false);
}
Program: 60021
Project: 60021
Buggy source:
/** 
 * Returns a value, suitable for storing in the   {@link #value} field. From the given future,which is assumed to be done. <p>This is approximately the inverse of  {@link #getDoneValue(Object)}
 */
private static Object getFutureValue(ListenableFuture<?> future){
  Object valueToSet;
  if (future instanceof TrustedFuture) {
    return ((AbstractFuture<?>)future).value;
  }
 else {
    try {
      Object v=getDone(future);
      valueToSet=v == null ? NULL : v;
    }
 catch (    ExecutionException exception) {
      valueToSet=new Failure(exception.getCause());
    }
catch (    CancellationException cancellation) {
      valueToSet=new Cancellation(false,cancellation);
    }
catch (    Throwable t) {
      valueToSet=new Failure(t);
    }
  }
  return valueToSet;
}

Fixed version (ground truth):
/** 
 * Returns a value that satisfies the contract of the   {@link #value} field based on the state ofgiven future. <p>This is approximately the inverse of  {@link #getDoneValue(Object)}
 */
private static Object getFutureValue(ListenableFuture<?> future){
  Object valueToSet;
  if (future instanceof TrustedFuture) {
    Object v=((AbstractFuture<?>)future).value;
    if (v instanceof Cancellation) {
      Cancellation c=(Cancellation)v;
      if (c.wasInterrupted) {
        v=c.cause != null ? new Cancellation(false,c.cause) : Cancellation.CAUSELESS_CANCELLED;
      }
    }
    return v;
  }
 else {
    try {
      Object v=getDone(future);
      valueToSet=v == null ? NULL : v;
    }
 catch (    ExecutionException exception) {
      valueToSet=new Failure(exception.getCause());
    }
catch (    CancellationException cancellation) {
      valueToSet=new Cancellation(false,cancellation);
    }
catch (    Throwable t) {
      valueToSet=new Failure(t);
    }
  }
  return valueToSet;
}
Program: 60023
Project: 60023
Buggy source:
@Override public void run(){
  if (isCancelled()) {
    return;
  }
  if (delegate instanceof AbstractFuture) {
    AbstractFuture<? extends V> other=(AbstractFuture<? extends V>)delegate;
    value=other.value;
    throwable=other.throwable;
    mayInterruptIfRunning=other.mayInterruptIfRunning;
    state=other.state;
    notifyAndClearListeners();
    return;
  }
  try {
    forceSet(getDone(delegate));
  }
 catch (  ExecutionException exception) {
    forceSetException(exception.getCause());
  }
catch (  CancellationException cancellation) {
    cancel(false);
  }
catch (  Throwable t) {
    forceSetException(t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (isCancelled()) {
    return;
  }
  if (delegate instanceof AbstractFuture) {
    AbstractFuture<? extends V> other=(AbstractFuture<? extends V>)delegate;
    value=other.value;
    throwable=other.throwable;
    state=other.state;
    notifyAndClearListeners();
    return;
  }
  try {
    forceSet(getDone(delegate));
  }
 catch (  ExecutionException exception) {
    forceSetException(exception.getCause());
  }
catch (  CancellationException cancellation) {
    cancel(false);
  }
catch (  Throwable t) {
    forceSetException(t);
  }
}
Program: 60024
Project: 60024
Buggy source:
@GwtIncompatible public void testSetFutureDelegateLaterInterrupted() throws Exception {
  assertThat(future.setFuture(delegate)).isTrue();
  delegate.cancel(true);
  assertCancelled(future,delegate instanceof TrustedFuture);
}

Fixed version (ground truth):
public void testSetFutureDelegateLaterInterrupted() throws Exception {
  assertThat(future.setFuture(delegate)).isTrue();
  delegate.cancel(true);
  assertCancelled(future,false);
}
Program: 60025
Project: 60025
Buggy source:
@GwtIncompatible public void testSetFutureDelegateAlreadyInterrupted() throws Exception {
  delegate.cancel(true);
  assertThat(future.setFuture(delegate)).isTrue();
  assertCancelled(future,delegate instanceof TrustedFuture);
}

Fixed version (ground truth):
public void testSetFutureDelegateAlreadyInterrupted() throws Exception {
  delegate.cancel(true);
  assertThat(future.setFuture(delegate)).isTrue();
  assertCancelled(future,false);
}
Program: 60027
Project: 60027
Buggy source:
/** 
 * Returns a value, suitable for storing in the   {@link #value} field. From the given future,which is assumed to be done. <p>This is approximately the inverse of  {@link #getDoneValue(Object)}
 */
private static Object getFutureValue(ListenableFuture<?> future){
  Object valueToSet;
  if (future instanceof TrustedFuture) {
    return ((AbstractFuture<?>)future).value;
  }
 else {
    try {
      Object v=getDone(future);
      valueToSet=v == null ? NULL : v;
    }
 catch (    ExecutionException exception) {
      valueToSet=new Failure(exception.getCause());
    }
catch (    CancellationException cancellation) {
      valueToSet=new Cancellation(false,cancellation);
    }
catch (    Throwable t) {
      valueToSet=new Failure(t);
    }
  }
  return valueToSet;
}

Fixed version (ground truth):
/** 
 * Returns a value that satisfies the contract of the   {@link #value} field based on the state ofgiven future. <p>This is approximately the inverse of  {@link #getDoneValue(Object)}
 */
private static Object getFutureValue(ListenableFuture<?> future){
  Object valueToSet;
  if (future instanceof TrustedFuture) {
    Object v=((AbstractFuture<?>)future).value;
    if (v instanceof Cancellation) {
      Cancellation c=(Cancellation)v;
      if (c.wasInterrupted) {
        v=c.cause != null ? new Cancellation(false,c.cause) : Cancellation.CAUSELESS_CANCELLED;
      }
    }
    return v;
  }
 else {
    try {
      Object v=getDone(future);
      valueToSet=v == null ? NULL : v;
    }
 catch (    ExecutionException exception) {
      valueToSet=new Failure(exception.getCause());
    }
catch (    CancellationException cancellation) {
      valueToSet=new Cancellation(false,cancellation);
    }
catch (    Throwable t) {
      valueToSet=new Failure(t);
    }
  }
  return valueToSet;
}
Program: 60029
Project: 60029
Buggy source:
@GwtIncompatible public void testChooseTableSize(){
  assertEquals(8,ImmutableSet.chooseTableSize(3));
  assertEquals(8,ImmutableSet.chooseTableSize(4));
  assertEquals(1 << 29,ImmutableSet.chooseTableSize(1 << 28));
  assertEquals(1 << 29,ImmutableSet.chooseTableSize(1 << 29 - 1));
  assertEquals(1 << 30,ImmutableSet.chooseTableSize(1 << 29));
  assertEquals(1 << 30,ImmutableSet.chooseTableSize(1 << 30 - 1));
  try {
    ImmutableSet.chooseTableSize(1 << 30);
    fail();
  }
 catch (  IllegalArgumentException expected) {
  }
}

Fixed version (ground truth):
@GwtIncompatible public void testChooseTableSize(){
  assertEquals(8,ImmutableSet.chooseTableSize(3));
  assertEquals(8,ImmutableSet.chooseTableSize(4));
  assertEquals(1 << 29,ImmutableSet.chooseTableSize(1 << 28));
  assertEquals(1 << 29,ImmutableSet.chooseTableSize((1 << 29) * 3 / 5));
  assertEquals(1 << 30,ImmutableSet.chooseTableSize(1 << 29));
  assertEquals(1 << 30,ImmutableSet.chooseTableSize((1 << 30) - 1));
  try {
    ImmutableSet.chooseTableSize(1 << 30);
    fail();
  }
 catch (  IllegalArgumentException expected) {
  }
}
Program: 60030
Project: 60030
Buggy source:
@Override public void forEachEntry(ObjIntConsumer<? super E> action){
  checkNotNull(action);
  for (int i=0; i < size(); i++) {
    action.accept(elementSet.asList().get(i),getCount(i));
  }
}

Fixed version (ground truth):
@Override public void forEachEntry(ObjIntConsumer<? super E> action){
  checkNotNull(action);
  for (int i=0; i < length; i++) {
    action.accept(elementSet.asList().get(i),getCount(i));
  }
}
Program: 60031
Project: 60031
Buggy source:
/** 
 * Call this in a   {@link TestSubtype} public method asserting subtype relationship. 
 */
final <T>T isSubtype(T sub){
  Type returnType=method.getGenericReturnType();
  Type paramType=getOnlyParameterType();
  TestSubtype spec=method.getAnnotation(TestSubtype.class);
  assertThat(TypeToken.of(paramType).isSubtypeOf(returnType)).isTrue();
  assertThat(TypeToken.of(returnType).isSupertypeOf(paramType)).isTrue();
  if (!spec.suppressGetSubtype()) {
    assertThat(getSubtype(returnType,TypeToken.of(paramType).getRawType())).isEqualTo(paramType);
  }
  if (!spec.suppressGetSupertype()) {
    assertThat(getSupertype(paramType,TypeToken.of(returnType).getRawType())).isEqualTo(returnType);
  }
  return sub;
}

Fixed version (ground truth):
/** 
 * Call this in a   {@link TestSubtype} public method asserting subtype relationship. 
 */
final <T>T isSubtype(T sub){
  Type returnType=method.getGenericReturnType();
  Type paramType=getOnlyParameterType();
  TestSubtype spec=method.getAnnotation(TestSubtype.class);
  assertThat(TypeToken.of(paramType).isSubtypeOf(returnType)).named("String_Node_Str",paramType,returnType).isTrue();
  assertThat(TypeToken.of(returnType).isSupertypeOf(paramType)).named("String_Node_Str",returnType,paramType).isTrue();
  if (!spec.suppressGetSubtype()) {
    assertThat(getSubtype(returnType,TypeToken.of(paramType).getRawType())).isEqualTo(paramType);
  }
  if (!spec.suppressGetSupertype()) {
    assertThat(getSupertype(paramType,TypeToken.of(returnType).getRawType())).isEqualTo(returnType);
  }
  return sub;
}
Program: 60032
Project: 60032
Buggy source:
/** 
 * Call this in a   {@link TestSubtype} public method asserting that subtype relationship does nothold.
 */
final <X>X notSubtype(@SuppressWarnings("String_Node_Str") Object sub){
  Type returnType=method.getGenericReturnType();
  Type paramType=getOnlyParameterType();
  TestSubtype spec=method.getAnnotation(TestSubtype.class);
  assertThat(TypeToken.of(paramType).isSubtypeOf(returnType)).isFalse();
  assertThat(TypeToken.of(returnType).isSupertypeOf(paramType)).isFalse();
  if (!spec.suppressGetSubtype()) {
    try {
      assertThat(getSubtype(returnType,TypeToken.of(paramType).getRawType())).isNotEqualTo(paramType);
    }
 catch (    IllegalArgumentException notSubtype1) {
    }
  }
  if (!spec.suppressGetSupertype()) {
    try {
      assertThat(getSupertype(paramType,TypeToken.of(returnType).getRawType())).isNotEqualTo(returnType);
    }
 catch (    IllegalArgumentException notSubtype2) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Call this in a   {@link TestSubtype} public method asserting that subtype relationship does nothold.
 */
final <X>X notSubtype(@SuppressWarnings("String_Node_Str") Object sub){
  Type returnType=method.getGenericReturnType();
  Type paramType=getOnlyParameterType();
  TestSubtype spec=method.getAnnotation(TestSubtype.class);
  assertThat(TypeToken.of(paramType).isSubtypeOf(returnType)).named("String_Node_Str",paramType,returnType).isFalse();
  assertThat(TypeToken.of(returnType).isSupertypeOf(paramType)).named("String_Node_Str",returnType,paramType).isFalse();
  if (!spec.suppressGetSubtype()) {
    try {
      assertThat(getSubtype(returnType,TypeToken.of(paramType).getRawType())).isNotEqualTo(paramType);
    }
 catch (    IllegalArgumentException notSubtype1) {
    }
  }
  if (!spec.suppressGetSupertype()) {
    try {
      assertThat(getSupertype(paramType,TypeToken.of(returnType).getRawType())).isNotEqualTo(returnType);
    }
 catch (    IllegalArgumentException notSubtype2) {
    }
  }
  return null;
}
Program: 60033
Project: 60033
Buggy source:
void setList(List<T> list){
  this.list=list;
}

Fixed version (ground truth):
void setList(List<T> list){
}
Program: 60034
Project: 60034
Buggy source:
private Type[] capture(Type[] types){
  Type[] result=new Type[types.length];
  for (int i=0; i < types.length; i++) {
    result[i]=capture(types[i]);
  }
  return result;
}

Fixed version (ground truth):
final Type capture(Type type){
  checkNotNull(type);
  if (type instanceof Class) {
    return type;
  }
  if (type instanceof TypeVariable) {
    return type;
  }
  if (type instanceof GenericArrayType) {
    GenericArrayType arrayType=(GenericArrayType)type;
    return Types.newArrayType(notForTypeVariable().capture(arrayType.getGenericComponentType()));
  }
  if (type instanceof ParameterizedType) {
    ParameterizedType parameterizedType=(ParameterizedType)type;
    Class<?> rawType=(Class<?>)parameterizedType.getRawType();
    TypeVariable<?>[] typeVars=rawType.getTypeParameters();
    Type[] typeArgs=parameterizedType.getActualTypeArguments();
    for (int i=0; i < typeArgs.length; i++) {
      typeArgs[i]=forTypeVariable(typeVars[i]).capture(typeArgs[i]);
    }
    return Types.newParameterizedTypeWithOwner(notForTypeVariable().captureNullable(parameterizedType.getOwnerType()),rawType,typeArgs);
  }
  if (type instanceof WildcardType) {
    WildcardType wildcardType=(WildcardType)type;
    Type[] lowerBounds=wildcardType.getLowerBounds();
    if (lowerBounds.length == 0) {
      return captureAsTypeVariable(wildcardType.getUpperBounds());
    }
 else {
      return type;
    }
  }
  throw new AssertionError("String_Node_Str");
}
Program: 60035
Project: 60035
Buggy source:
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge. <p>In an undirected graph, this is equivalent to   {@link #adjacentNodes(Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
@Override Set<N> predecessors(@CompatibleWith("String_Node_Str") Object node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge. <p>In an undirected graph, this is equivalent to   {@link #adjacentNodes(Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
@Override Set<N> predecessors(Object node);
Program: 60036
Project: 60036
Buggy source:
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>In an undirected graph, this is equivalent to   {@link #adjacentNodes(Object)}. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
@Override Set<N> successors(@CompatibleWith("String_Node_Str") Object node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>In an undirected graph, this is equivalent to   {@link #adjacentNodes(Object)}. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
@Override Set<N> successors(Object node);
Program: 60037
Project: 60037
Buggy source:
/** 
 * Returns all nodes in this network adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge. <p>In an undirected network, this is equivalent to   {@link #adjacentNodes(Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this network
 */
@Override Set<N> predecessors(@CompatibleWith("String_Node_Str") Object node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this network adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge. <p>In an undirected network, this is equivalent to   {@link #adjacentNodes(Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this network
 */
@Override Set<N> predecessors(Object node);
Program: 60038
Project: 60038
Buggy source:
/** 
 * Returns all nodes in this network adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>In an undirected network, this is equivalent to   {@link #adjacentNodes(Object)}. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this network
 */
@Override Set<N> successors(@CompatibleWith("String_Node_Str") Object node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this network adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>In an undirected network, this is equivalent to   {@link #adjacentNodes(Object)}. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this network
 */
@Override Set<N> successors(Object node);
Program: 60039
Project: 60039
Buggy source:
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
Set<N> predecessors(N node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s incoming edges <i>against</i> the direction (if any) of the edge.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
Set<N> predecessors(@CompatibleWith("String_Node_Str") Object node);
Program: 60040
Project: 60040
Buggy source:
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
Set<N> successors(N node);

Fixed version (ground truth):
/** 
 * Returns all nodes in this graph adjacent to   {@code node} which can be reached by traversing{@code node}'s outgoing edges in the direction (if any) of the edge. <p>This is <i>not</i> the same as "all nodes reachable from   {@code node} by following outgoingedges". For that functionality, see  {@link Graphs#reachableNodes(Graph,Object)}.
 * @throws IllegalArgumentException if {@code node} is not an element of this graph
 */
Set<N> successors(@CompatibleWith("String_Node_Str") Object node);
Program: 60041
Project: 60041
Buggy source:
@AndroidIncompatible public void testClassPathEntries_URLClassLoader_withParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url1},null);
  URLClassLoader child=new URLClassLoader(new URL[]{url2},parent){
  }
;
  ImmutableMap<File,ClassLoader> classPathEntries=ClassPath.Scanner.getClassPathEntries(child);
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),parent,new File("String_Node_Str"),child),classPathEntries);
  assertThat(classPathEntries.keySet()).containsExactly(new File("String_Node_Str"),new File("String_Node_Str")).inOrder();
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_URLClassLoader_withParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url1},null);
  URLClassLoader child=new URLClassLoader(new URL[]{url2},parent){
  }
;
  assertThat(ClassPath.Scanner.getClassPathEntries(child)).containsExactly(new File("String_Node_Str"),parent,new File("String_Node_Str"),child).inOrder();
}
Program: 60042
Project: 60042
Buggy source:
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_noParent(){
  assertThat(ClassPath.Scanner.getClassPathEntries(new ClassLoader(null){
  }
).keySet()).isEmpty();
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_noParent(){
  assertThat(ClassPath.Scanner.getClassPathEntries(new ClassLoader(null){
  }
)).isEmpty();
}
Program: 60043
Project: 60043
Buggy source:
@AndroidIncompatible public void testClassPathEntries_duplicateUri_parentWins() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url},null);
  URLClassLoader child=new URLClassLoader(new URL[]{url},parent){
  }
;
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),parent),ClassPath.Scanner.getClassPathEntries(child));
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_duplicateUri_parentWins() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url},null);
  URLClassLoader child=new URLClassLoader(new URL[]{url},parent){
  }
;
  assertThat(ClassPath.Scanner.getClassPathEntries(child)).containsExactly(new File("String_Node_Str"),parent);
}
Program: 60044
Project: 60044
Buggy source:
@AndroidIncompatible public void testClassPathEntries_URLClassLoader_noParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader classloader=new URLClassLoader(new URL[]{url1,url2},null);
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),classloader,new File("String_Node_Str"),classloader),ClassPath.Scanner.getClassPathEntries(classloader));
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_URLClassLoader_noParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader classloader=new URLClassLoader(new URL[]{url1,url2},null);
  assertThat(ClassPath.Scanner.getClassPathEntries(classloader)).containsExactly(new File("String_Node_Str"),classloader,new File("String_Node_Str"),classloader);
}
Program: 60045
Project: 60045
Buggy source:
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withParent() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url},null);
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),parent),ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
));
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withParent() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader parent=new URLClassLoader(new URL[]{url},null);
  assertThat(ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
)).containsExactly(new File("String_Node_Str"),parent);
}
Program: 60046
Project: 60046
Buggy source:
public void testScan_classPathCycle() throws IOException {
  File jarFile=File.createTempFile("String_Node_Str","String_Node_Str");
  try {
    writeSelfReferencingJarFile(jarFile,"String_Node_Str");
    ClassPath.DefaultScanner scanner=new ClassPath.DefaultScanner();
    scanner.scan(jarFile,ClassPathTest.class.getClassLoader());
    assertEquals(1,scanner.getResources().size());
  }
  finally {
    jarFile.delete();
  }
}

Fixed version (ground truth):
public void testScan_classPathCycle() throws IOException {
  File jarFile=File.createTempFile("String_Node_Str","String_Node_Str");
  try {
    writeSelfReferencingJarFile(jarFile,"String_Node_Str");
    ClassPath.DefaultScanner scanner=new ClassPath.DefaultScanner();
    scanner.scan(jarFile,ClassPathTest.class.getClassLoader());
    assertThat(scanner.getResources()).hasSize(1);
  }
  finally {
    jarFile.delete();
  }
}
Program: 60047
Project: 60047
Buggy source:
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withParentAndGrandParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader grandParent=new URLClassLoader(new URL[]{url1},null);
  URLClassLoader parent=new URLClassLoader(new URL[]{url2},grandParent);
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),grandParent,new File("String_Node_Str"),parent),ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
));
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withParentAndGrandParent() throws Exception {
  URL url1=new URL("String_Node_Str");
  URL url2=new URL("String_Node_Str");
  URLClassLoader grandParent=new URLClassLoader(new URL[]{url1},null);
  URLClassLoader parent=new URLClassLoader(new URL[]{url2},grandParent);
  assertThat(ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
)).containsExactly(new File("String_Node_Str"),grandParent,new File("String_Node_Str"),parent);
}
Program: 60048
Project: 60048
Buggy source:
@Override protected void scanDirectory(ClassLoader loader,File root) throws IOException {
  URI base=root.toURI();
  for (  File entry : Files.fileTreeTraverser().preOrderTraversal(root)) {
    String resourceName=new File(base.relativize(entry.toURI()).getPath()).getPath();
    resources.add(resourceName);
  }
}

Fixed version (ground truth):
@Override protected void scanDirectory(ClassLoader loader,File root){
}
Program: 60049
Project: 60049
Buggy source:
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withGrandParent() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader grandParent=new URLClassLoader(new URL[]{url},null);
  ClassLoader parent=new ClassLoader(grandParent){
  }
;
  assertEquals(ImmutableMap.of(new File("String_Node_Str"),grandParent),ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
));
}

Fixed version (ground truth):
@AndroidIncompatible public void testClassPathEntries_notURLClassLoader_withGrandParent() throws Exception {
  URL url=new URL("String_Node_Str");
  URLClassLoader grandParent=new URLClassLoader(new URL[]{url},null);
  ClassLoader parent=new ClassLoader(grandParent){
  }
;
  assertThat(ClassPath.Scanner.getClassPathEntries(new ClassLoader(parent){
  }
)).containsExactly(new File("String_Node_Str"),grandParent);
}
Program: 60050
Project: 60050
Buggy source:
@Override protected void scanJarFile(ClassLoader loader,JarFile file) throws IOException {
  Enumeration<JarEntry> entries=file.entries();
  while (entries.hasMoreElements()) {
    resources.add(entries.nextElement().getName());
  }
}

Fixed version (ground truth):
@Override protected void scanJarFile(ClassLoader loader,JarFile file) throws IOException {
  this.found=new File(file.getName());
  throw new StopScanningException();
}
Program: 60051
Project: 60051
Buggy source:
/** 
 * Returns the class path URIs specified by the   {@code Class-Path} manifest attribute, accordingto <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Main_Attributes"> JAR File Specification</a>. If  {@code manifest} is null, it means the jar file has nomanifest, and an empty set will be returned.
 */
@VisibleForTesting static ImmutableSet<File> getClassPathFromManifest(File jarFile,@Nullable Manifest manifest){
  if (manifest == null) {
    return ImmutableSet.of();
  }
  ImmutableSet.Builder<File> builder=ImmutableSet.builder();
  String classpathAttribute=manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH.toString());
  if (classpathAttribute != null) {
    for (    String path : CLASS_PATH_ATTRIBUTE_SEPARATOR.split(classpathAttribute)) {
      URL url;
      try {
        url=getClassPathEntry(jarFile,path);
      }
 catch (      MalformedURLException e) {
        logger.warning("String_Node_Str" + path);
        continue;
      }
      if (url.getProtocol().equals("String_Node_Str")) {
        builder.add(new File(url.getFile()));
      }
    }
  }
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Returns the class path URIs specified by the   {@code Class-Path} manifest attribute, accordingto <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Main_Attributes"> JAR File Specification</a>. If  {@code manifest} is null, it means the jar file has nomanifest, and an empty set will be returned.
 */
@VisibleForTesting static ImmutableSet<File> getClassPathFromManifest(File jarFile,@Nullable Manifest manifest){
  if (manifest == null) {
    return ImmutableSet.of();
  }
  ImmutableSet.Builder<File> builder=ImmutableSet.builder();
  String classpathAttribute=manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH.toString());
  if (classpathAttribute != null) {
    for (    String path : CLASS_PATH_ATTRIBUTE_SEPARATOR.split(classpathAttribute)) {
      URL url;
      try {
        url=getClassPathEntry(jarFile,path);
      }
 catch (      MalformedURLException e) {
        logger.warning("String_Node_Str" + path);
        continue;
      }
      if (url.getProtocol().equals("String_Node_Str")) {
        builder.add(toFile(url));
      }
    }
  }
  return builder.build();
}
Program: 60052
Project: 60052
Buggy source:
@VisibleForTesting static ImmutableMap<File,ClassLoader> getClassPathEntries(ClassLoader classloader){
  LinkedHashMap<File,ClassLoader> entries=Maps.newLinkedHashMap();
  ClassLoader parent=classloader.getParent();
  if (parent != null) {
    entries.putAll(getClassPathEntries(parent));
  }
  if (classloader instanceof URLClassLoader) {
    URLClassLoader urlClassLoader=(URLClassLoader)classloader;
    for (    URL entry : urlClassLoader.getURLs()) {
      if (entry.getProtocol().equals("String_Node_Str")) {
        File file=new File(entry.getFile());
        if (!entries.containsKey(file)) {
          entries.put(file,classloader);
        }
      }
    }
  }
  return ImmutableMap.copyOf(entries);
}

Fixed version (ground truth):
@VisibleForTesting static ImmutableMap<File,ClassLoader> getClassPathEntries(ClassLoader classloader){
  LinkedHashMap<File,ClassLoader> entries=Maps.newLinkedHashMap();
  ClassLoader parent=classloader.getParent();
  if (parent != null) {
    entries.putAll(getClassPathEntries(parent));
  }
  if (classloader instanceof URLClassLoader) {
    URLClassLoader urlClassLoader=(URLClassLoader)classloader;
    for (    URL entry : urlClassLoader.getURLs()) {
      if (entry.getProtocol().equals("String_Node_Str")) {
        File file=toFile(entry);
        if (!entries.containsKey(file)) {
          entries.put(file,classloader);
        }
      }
    }
  }
  return ImmutableMap.copyOf(entries);
}