nus-yam/ex-repair huggingface dataset:
Program: 60227
Project: 60227
Buggy source:
/** 
 * Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access. Access time is reset by all cache read and write operations (including  {@code Cache.asMap().get(Object)} and {@code Cache.asMap().put(K, V)}), but not by operations on the collection-views of   {@link Cache#asMap}. <p>When   {@code duration} is zero, this method hands off to{@link #maximumSize maximumSize}{@code (0)}, ignoring any otherwise-specificed maximum size or weight. This can be useful in testing, or to disable caching temporarily without a code change. <p>Expired entries may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Expired entries are cleaned up as part of the routine maintenance described in the class javadoc.
 * @param duration the length of time after an entry is last accessed that it should beautomatically removed
 * @param unit the unit that {@code duration} is expressed in
 * @throws IllegalArgumentException if {@code duration} is negative
 * @throws IllegalStateException if the time to idle or time to live was already set
 */
public CacheBuilder<K,V> expireAfterAccess(long duration,TimeUnit unit){
  checkState(expireAfterAccessNanos == UNSET_INT,"String_Node_Str",expireAfterAccessNanos);
  checkArgument(duration >= 0,"String_Node_Str",duration,unit);
  this.expireAfterAccessNanos=unit.toNanos(duration);
  return this;
}

Fixed version (ground truth):
/** 
 * Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access. Access time is reset by all cache read and write operations (including  {@code Cache.asMap().get(Object)} and {@code Cache.asMap().put(K, V)}), but not by operations on the collection-views of   {@link Cache#asMap}. <p>When   {@code duration} is zero, this method hands off to{@link #maximumSize(long) maximumSize}{@code (0)}, ignoring any otherwise-specificed maximum size or weight. This can be useful in testing, or to disable caching temporarily without a code change. <p>Expired entries may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Expired entries are cleaned up as part of the routine maintenance described in the class javadoc.
 * @param duration the length of time after an entry is last accessed that it should beautomatically removed
 * @param unit the unit that {@code duration} is expressed in
 * @throws IllegalArgumentException if {@code duration} is negative
 * @throws IllegalStateException if the time to idle or time to live was already set
 */
public CacheBuilder<K,V> expireAfterAccess(long duration,TimeUnit unit){
  checkState(expireAfterAccessNanos == UNSET_INT,"String_Node_Str",expireAfterAccessNanos);
  checkArgument(duration >= 0,"String_Node_Str",duration,unit);
  this.expireAfterAccessNanos=unit.toNanos(duration);
  return this;
}
Program: 60228
Project: 60228
Buggy source:
/** 
 * Specifies the maximum weight of entries the cache may contain. Weight is determined using the  {@link Weigher} specified with {@link #weigher}, and use of this method requires a corresponding call to   {@link #weigher} prior to calling {@link #build}. <p>Note that the cache <b>may evict an entry before this limit is exceeded</b>. As the cache size grows close to the maximum, the cache evicts entries that are less likely to be used again. For example, the cache may evict an entry because it hasn't been used recently or very often. <p>When   {@code weight} is zero, elements will be evicted immediately after being loaded intocache. This can be useful in testing, or to disable caching temporarily without a code change.
 * @param weight the maximum weight the cache may contain
 * @param weigher the weigher to use in calculating the weight of cache entries
 * @throws IllegalArgumentException if {@code size} is negative
 * @throws IllegalStateException if a maximum size was already set
 * @since 11.0
 */
public CacheBuilder<K,V> maximumWeight(long weight){
  checkState(this.maximumWeight == UNSET_INT,"String_Node_Str",this.maximumWeight);
  checkState(this.maximumSize == UNSET_INT,"String_Node_Str",this.maximumSize);
  this.maximumWeight=weight;
  checkArgument(weight >= 0,"String_Node_Str");
  return this;
}

Fixed version (ground truth):
/** 
 * Specifies the maximum weight of entries the cache may contain. Weight is determined using the  {@link Weigher} specified with {@link #weigher}, and use of this method requires a corresponding call to   {@link #weigher} prior to calling {@link #build}. <p>Note that the cache <b>may evict an entry before this limit is exceeded</b>. As the cache size grows close to the maximum, the cache evicts entries that are less likely to be used again. For example, the cache may evict an entry because it hasn't been used recently or very often. <p>When   {@code weight} is zero, elements will be evicted immediately after being loaded intocache. This can be useful in testing, or to disable caching temporarily without a code change.
 * @param weight the maximum weight the cache may contain
 * @throws IllegalArgumentException if {@code size} is negative
 * @throws IllegalStateException if a maximum size was already set
 * @since 11.0
 */
public CacheBuilder<K,V> maximumWeight(long weight){
  checkState(this.maximumWeight == UNSET_INT,"String_Node_Str",this.maximumWeight);
  checkState(this.maximumSize == UNSET_INT,"String_Node_Str",this.maximumSize);
  this.maximumWeight=weight;
  checkArgument(weight >= 0,"String_Node_Str");
  return this;
}
Program: 60229
Project: 60229
Buggy source:
/** 
 * Specifies that each value (not key) stored in the cache should be wrapped in a  {@link SoftReference} (by default, strong references are used). Softly-referenced objects willbe garbage-collected in a <i>globally</i> least-recently-used manner, in response to memory demand. <p><b>Warning:</b> in most circumstances it is better to set a per-cache  {@linkplain #maximumSize maximum size} instead of using soft references. You should only use this method ifyou are well familiar with the practical consequences of soft references. <p><b>Note:</b> when this method is used, the resulting cache will use identity ( {@code ==}) comparison to determine equality of values. <p>Entries with values that have been garbage collected may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Entries with garbage collected values are cleaned up as part of the routine maintenance described in the class javadoc.
 * @throws IllegalStateException if the value strength was already set
 */
@GwtIncompatible("String_Node_Str") public CacheBuilder<K,V> softValues(){
  return setValueStrength(Strength.SOFT);
}

Fixed version (ground truth):
/** 
 * Specifies that each value (not key) stored in the cache should be wrapped in a  {@link SoftReference} (by default, strong references are used). Softly-referenced objects willbe garbage-collected in a <i>globally</i> least-recently-used manner, in response to memory demand. <p><b>Warning:</b> in most circumstances it is better to set a per-cache  {@linkplain #maximumSize(long) maximum size} instead of using soft references. You should only use thismethod if you are well familiar with the practical consequences of soft references. <p><b>Note:</b> when this method is used, the resulting cache will use identity ( {@code ==}) comparison to determine equality of values. <p>Entries with values that have been garbage collected may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Entries with garbage collected values are cleaned up as part of the routine maintenance described in the class javadoc.
 * @throws IllegalStateException if the value strength was already set
 */
@GwtIncompatible("String_Node_Str") public CacheBuilder<K,V> softValues(){
  return setValueStrength(Strength.SOFT);
}
Program: 60230
Project: 60230
Buggy source:
/** 
 * Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value. <p>When   {@code duration} is zero, this method hands off to{@link #maximumSize maximumSize}{@code (0)}, ignoring any otherwise-specificed maximum size or weight. This can be useful in testing, or to disable caching temporarily without a code change. <p>Expired entries may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Expired entries are cleaned up as part of the routine maintenance described in the class javadoc.
 * @param duration the length of time after an entry is created that it should be automaticallyremoved
 * @param unit the unit that {@code duration} is expressed in
 * @throws IllegalArgumentException if {@code duration} is negative
 * @throws IllegalStateException if the time to live or time to idle was already set
 */
public CacheBuilder<K,V> expireAfterWrite(long duration,TimeUnit unit){
  checkState(expireAfterWriteNanos == UNSET_INT,"String_Node_Str",expireAfterWriteNanos);
  checkArgument(duration >= 0,"String_Node_Str",duration,unit);
  this.expireAfterWriteNanos=unit.toNanos(duration);
  return this;
}

Fixed version (ground truth):
/** 
 * Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value. <p>When   {@code duration} is zero, this method hands off to{@link #maximumSize(long) maximumSize}{@code (0)}, ignoring any otherwise-specificed maximum size or weight. This can be useful in testing, or to disable caching temporarily without a code change. <p>Expired entries may be counted in   {@link Cache#size}, but will never be visible to read or write operations. Expired entries are cleaned up as part of the routine maintenance described in the class javadoc.
 * @param duration the length of time after an entry is created that it should be automaticallyremoved
 * @param unit the unit that {@code duration} is expressed in
 * @throws IllegalArgumentException if {@code duration} is negative
 * @throws IllegalStateException if the time to live or time to idle was already set
 */
public CacheBuilder<K,V> expireAfterWrite(long duration,TimeUnit unit){
  checkState(expireAfterWriteNanos == UNSET_INT,"String_Node_Str",expireAfterWriteNanos);
  checkArgument(duration >= 0,"String_Node_Str",duration,unit);
  this.expireAfterWriteNanos=unit.toNanos(duration);
  return this;
}
Program: 60232
Project: 60232
Buggy source:
/** 
 * Returns the value of each present instance from the supplied   {@code optionals}, in order, skipping over occurrences of   {@link Optional#absent}. Iterators are unmodifiable and are evaluated lazily.
 * @since 11.0
 */
public static <T>Iterable<T> presentInstances(Iterable<Optional<T>> optionals){
  checkNotNull(optionals);
  final Iterator<Optional<T>> iterator=checkNotNull(optionals.iterator());
  return new Iterable<T>(){
    @Override public Iterator<T> iterator(){
      return new AbstractIterator<T>(){
        @Override protected T computeNext(){
          while (iterator.hasNext()) {
            Optional<T> optional=iterator.next();
            if (optional.isPresent()) {
              return optional.get();
            }
          }
          return endOfData();
        }
      }
;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns the value of each present instance from the supplied   {@code optionals}, in order, skipping over occurrences of   {@link Optional#absent}. Iterators are unmodifiable and are evaluated lazily.
 * @since 11.0
 */
public static <T>Iterable<T> presentInstances(final Iterable<Optional<T>> optionals){
  checkNotNull(optionals);
  return new Iterable<T>(){
    @Override public Iterator<T> iterator(){
      return new AbstractIterator<T>(){
        private final Iterator<Optional<T>> iterator=checkNotNull(optionals.iterator());
        @Override protected T computeNext(){
          while (iterator.hasNext()) {
            Optional<T> optional=iterator.next();
            if (optional.isPresent()) {
              return optional.get();
            }
          }
          return endOfData();
        }
      }
;
    }
  }
;
}
Program: 60233
Project: 60233
Buggy source:
@Override public Iterator<T> iterator(){
  return new AbstractIterator<T>(){
    @Override protected T computeNext(){
      while (iterator.hasNext()) {
        Optional<T> optional=iterator.next();
        if (optional.isPresent()) {
          return optional.get();
        }
      }
      return endOfData();
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<T> iterator(){
  return new AbstractIterator<T>(){
    private final Iterator<Optional<T>> iterator=checkNotNull(optionals.iterator());
    @Override protected T computeNext(){
      while (iterator.hasNext()) {
        Optional<T> optional=iterator.next();
        if (optional.isPresent()) {
          return optional.get();
        }
      }
      return endOfData();
    }
  }
;
}
Program: 60234
Project: 60234
Buggy source:
private Object[] buildParamList(Functor func,int indexOfParamToSetToNull){
  Class<?>[] types=func.getParameterTypes();
  Object[] params=new Object[types.length];
  for (int i=0; i < types.length; i++) {
    if (i != indexOfParamToSetToNull) {
      params[i]=defaults.get(types[i]);
      if (!parameterIsPrimitiveOrNullable(func,indexOfParamToSetToNull)) {
        Assert.assertTrue("String_Node_Str" + types[i].getName(),params[i] != null);
      }
    }
  }
  return params;
}

Fixed version (ground truth):
private Object[] buildParamList(Functor func,int indexOfParamToSetToNull){
  Class<?>[] types=func.getParameterTypes();
  Object[] params=new Object[types.length];
  for (int i=0; i < types.length; i++) {
    if (i != indexOfParamToSetToNull) {
      params[i]=defaults.get(types[i]);
      if (!parameterIsPrimitiveOrNullable(func,i)) {
        Assert.assertTrue("String_Node_Str" + types[i].getName(),params[i] != null);
      }
    }
  }
  return params;
}
Program: 60235
Project: 60235
Buggy source:
public void testXmlEscaper() throws Exception {
  CharEscaper xmlEscaper=XmlEscapers.xmlEscaper();
  assertBasicXmlEscaper(xmlEscaper,true);
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
}

Fixed version (ground truth):
public void testXmlEscaper() throws Exception {
  CharEscaper xmlEscaper=XmlEscapers.xmlEscaper();
  assertBasicXmlEscaper(xmlEscaper,true,false);
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlEscaper.escape("String_Node_Str"));
}
Program: 60236
Project: 60236
Buggy source:
public void testXmlContentEscaper() throws Exception {
  CharEscaper xmlContentEscaper=XmlEscapers.xmlContentEscaper();
  assertBasicXmlEscaper(xmlContentEscaper,false);
  assertEquals("String_Node_Str",xmlContentEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlContentEscaper.escape("String_Node_Str"));
}

Fixed version (ground truth):
public void testXmlContentEscaper() throws Exception {
  CharEscaper xmlContentEscaper=XmlEscapers.xmlContentEscaper();
  assertBasicXmlEscaper(xmlContentEscaper,false,false);
  assertEquals("String_Node_Str",xmlContentEscaper.escape("String_Node_Str"));
  assertEquals("String_Node_Str",xmlContentEscaper.escape("String_Node_Str"));
}
Program: 60238
Project: 60238
Buggy source:
/** 
 * Returns an   {@link Escaper} instance that escapes special characters in astring so it can safely be included in an XML document as element content. See section <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#syntax">2.4</a> of the XML specification. <p><b>Note</b>: Double and single quotes are not escaped, so it is <b>not safe</b> to use this escaper to escape attribute values. Use {@link #xmlEscaper} for cases where the output can appear in eitherattribute values or element content. <p>This escaper does not escape non-ASCII characters to their numeric character references (NCR). Any non-ASCII characters appearing in the input will be preserved in the output. Specifically "\r" (carriage return) is preserved in the output, which may result in it being silently converted to "\n" when the XML is parsed. <p>This escaper does not treat surrogate pairs specially and does not perform Unicode validation on its input.
 */
public static CharEscaper xmlContentEscaper(){
  return XML_CONTENT_ESCAPER;
}

Fixed version (ground truth):
/** 
 * Returns an   {@link Escaper} instance that escapes special characters in astring so it can safely be included in an XML document as element content. See section <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#syntax">2.4</a> of the XML specification. <p><b>Note</b>: Double and single quotes are not escaped, so it is <b>not safe</b> to use this escaper to escape attribute values. Use {@link #xmlEscaper} if the output can appear in element content or{@link #xmlAttributeEscaper} in attribute values.<p>This escaper does not escape non-ASCII characters to their numeric character references (NCR). Any non-ASCII characters appearing in the input will be preserved in the output. Specifically "\r" (carriage return) is preserved in the output, which may result in it being silently converted to "\n" when the XML is parsed. <p>This escaper does not treat surrogate pairs specially and does not perform Unicode validation on its input.
 */
public static CharEscaper xmlContentEscaper(){
  return XML_CONTENT_ESCAPER;
}
Program: 60239
Project: 60239
Buggy source:
/** 
 * Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point.
 * @throws IllegalStateException if the stopwatch is already stopped.
 */
public Stopwatch stop(){
  long tick=ticker.read();
  checkState(isRunning);
  isRunning=false;
  elapsedNanos+=tick - startTick;
  return this;
}

Fixed version (ground truth):
/** 
 * Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point.
 * @return this {@code Stopwatch} instance
 * @throws IllegalStateException if the stopwatch is already stopped.
 */
public Stopwatch stop(){
  long tick=ticker.read();
  checkState(isRunning);
  isRunning=false;
  elapsedNanos+=tick - startTick;
  return this;
}
Program: 60240
Project: 60240
Buggy source:
/** 
 * Starts the stopwatch.
 * @throws IllegalStateException if the stopwatch is already running.
 */
public Stopwatch start(){
  checkState(!isRunning);
  isRunning=true;
  startTick=ticker.read();
  return this;
}

Fixed version (ground truth):
/** 
 * Starts the stopwatch.
 * @return this {@code Stopwatch} instance
 * @throws IllegalStateException if the stopwatch is already running.
 */
public Stopwatch start(){
  checkState(!isRunning);
  isRunning=true;
  startTick=ticker.read();
  return this;
}
Program: 60241
Project: 60241
Buggy source:
/** 
 * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
 */
public Stopwatch reset(){
  elapsedNanos=0;
  isRunning=false;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
 * @return this {@code Stopwatch} instance
 */
public Stopwatch reset(){
  elapsedNanos=0;
  isRunning=false;
  return this;
}
Program: 60242
Project: 60242
Buggy source:
/** 
 * Returns the empty iterator. <p>The   {@link Iterable} equivalent of this method is {@link Collections#emptySet}.
 */
@SuppressWarnings("String_Node_Str") public static <T>UnmodifiableIterator<T> emptyIterator(){
  return (UnmodifiableIterator<T>)EMPTY_ITERATOR;
}

Fixed version (ground truth):
/** 
 * Returns the empty iterator. <p>The   {@link Iterable} equivalent of this method is {@link ImmutableSet#of()}.
 */
@SuppressWarnings("String_Node_Str") public static <T>UnmodifiableIterator<T> emptyIterator(){
  return (UnmodifiableIterator<T>)EMPTY_ITERATOR;
}
Program: 60244
Project: 60244
Buggy source:
@Override public Iterator<Integer> iterator(){
  return newDoubler(2,32);
}

Fixed version (ground truth):
@Override public Iterator<Integer> iterator(){
  Iterator<Integer> powersOfTwo=new AbstractLinkedIterator<Integer>(1){
    protected Integer computeNext(    Integer previous){
      return (previous == 1 << 30) ? null : previous * 2;
    }
  }
;
  return powersOfTwo;
}
Program: 60245
Project: 60245
Buggy source:
/** 
 * Returns a predicate that evaluates to   {@code true} if the{@code CharSequence} being tested contains any match for the givenregular expression pattern. The test used is equivalent to {@code regex.matcher(arg).find()}
 * @since 3.0
 */
@GwtIncompatible(value="String_Node_Str") public static Predicate<CharSequence> contains(Pattern pattern){
  return new ContainsPatternPredicate(pattern);
}

Fixed version (ground truth):
/** 
 * Returns a predicate that evaluates to   {@code true} if the{@code CharSequence} being tested contains any match for the givenregular expression pattern. The test used is equivalent to {@code pattern.matcher(arg).find()}
 * @since 3.0
 */
@GwtIncompatible(value="String_Node_Str") public static Predicate<CharSequence> contains(Pattern pattern){
  return new ContainsPatternPredicate(pattern);
}
Program: 60246
Project: 60246
Buggy source:
/** 
 * Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point.
 * @throws IllegalStateException if the stopwatch is already stopped.
 */
public Stopwatch stop(){
  long tick=ticker.read();
  checkState(isRunning);
  isRunning=false;
  elapsedNanos+=tick - startTick;
  return this;
}

Fixed version (ground truth):
/** 
 * Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point.
 * @return this {@code Stopwatch} instance
 * @throws IllegalStateException if the stopwatch is already stopped.
 */
public Stopwatch stop(){
  long tick=ticker.read();
  checkState(isRunning);
  isRunning=false;
  elapsedNanos+=tick - startTick;
  return this;
}
Program: 60247
Project: 60247
Buggy source:
/** 
 * Starts the stopwatch.
 * @throws IllegalStateException if the stopwatch is already running.
 */
public Stopwatch start(){
  checkState(!isRunning);
  isRunning=true;
  startTick=ticker.read();
  return this;
}

Fixed version (ground truth):
/** 
 * Starts the stopwatch.
 * @return this {@code Stopwatch} instance
 * @throws IllegalStateException if the stopwatch is already running.
 */
public Stopwatch start(){
  checkState(!isRunning);
  isRunning=true;
  startTick=ticker.read();
  return this;
}
Program: 60248
Project: 60248
Buggy source:
/** 
 * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
 */
public Stopwatch reset(){
  elapsedNanos=0;
  isRunning=false;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
 * @return this {@code Stopwatch} instance
 */
public Stopwatch reset(){
  elapsedNanos=0;
  isRunning=false;
  return this;
}
Program: 60249
Project: 60249
Buggy source:
/** 
 * Returns an asynchronous   {@code RemovalListener} which processes alleviction notifications asynchronously, using  {@code executor}.
 * @param listener the backing listener
 * @param executor the executor with which removal notifications areasynchronously executed
 */
public static <K,V>RemovalListener<K,V> asynchronous(final RemovalListener<K,V> listener,final Executor executor){
  return new RemovalListener<K,V>(){
    @Override public void onRemoval(    final RemovalNotification<K,V> notification){
      executor.execute(new Runnable(){
        @Override public void run(){
          listener.onRemoval(notification);
        }
      }
);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a   {@code RemovalListener} which processes all evictionnotifications using  {@code executor}.
 * @param listener the backing listener
 * @param executor the executor with which removal notifications areasynchronously executed
 */
public static <K,V>RemovalListener<K,V> asynchronous(final RemovalListener<K,V> listener,final Executor executor){
  return new RemovalListener<K,V>(){
    @Override public void onRemoval(    final RemovalNotification<K,V> notification){
      executor.execute(new Runnable(){
        @Override public void run(){
          listener.onRemoval(notification);
        }
      }
);
    }
  }
;
}
Program: 60250
Project: 60250
Buggy source:
/** 
 * Returns the empty iterator. <p>The   {@link Iterable} equivalent of this method is {@link Collections#emptySet}.
 */
@SuppressWarnings("String_Node_Str") public static <T>UnmodifiableIterator<T> emptyIterator(){
  return (UnmodifiableIterator<T>)EMPTY_ITERATOR;
}

Fixed version (ground truth):
/** 
 * Returns the empty iterator. <p>The   {@link Iterable} equivalent of this method is {@link ImmutableSet#of()}.
 */
@SuppressWarnings("String_Node_Str") public static <T>UnmodifiableIterator<T> emptyIterator(){
  return (UnmodifiableIterator<T>)EMPTY_ITERATOR;
}
Program: 60253
Project: 60253
Buggy source:
static <E,E2 extends E>ImmutableMultiset<E> copyFromEntries(Collection<Entry<E2>> entries){
  long size=0;
  ImmutableMap.Builder<E,Integer> builder=ImmutableMap.builder();
  for (  Entry<E2> entry : entries) {
    int count=entry.getCount();
    if (count > 0) {
      builder.put(entry.getElement(),count);
      size+=count;
    }
  }
  if (size == 0) {
    return of();
  }
  return new RegularImmutableMultiset<E>(builder.build(),Ints.saturatedCast(size));
}

Fixed version (ground truth):
static <E>ImmutableMultiset<E> copyFromEntries(Collection<? extends Entry<? extends E>> entries){
  long size=0;
  ImmutableMap.Builder<E,Integer> builder=ImmutableMap.builder();
  for (  Entry<? extends E> entry : entries) {
    int count=entry.getCount();
    if (count > 0) {
      builder.put(entry.getElement(),count);
      size+=count;
    }
  }
  if (size == 0) {
    return of();
  }
  return new RegularImmutableMultiset<E>(builder.build(),Ints.saturatedCast(size));
}
Program: 60254
Project: 60254
Buggy source:
@Override public Set<Entry<E>> entrySet(){
  Set<Entry<E>> es=entrySet;
  if (es == null) {
    es=new EntrySet<E>(){
      @Override Multiset<E> multiset(){
        return SetMultiset.this;
      }
      @Override public Iterator<Entry<E>> iterator(){
        return Iterators.transform(delegate.iterator(),new Function<E,Entry<E>>(){
          @Override public Entry<E> apply(          E elem){
            return immutableEntry(elem,1);
          }
        }
);
      }
      @Override public int size(){
        return delegate.size();
      }
    }
;
  }
  return es;
}

Fixed version (ground truth):
@Override public Set<Entry<E>> entrySet(){
  Set<Entry<E>> es=entrySet;
  if (es == null) {
    es=entrySet=new EntrySet<E>(){
      @Override Multiset<E> multiset(){
        return SetMultiset.this;
      }
      @Override public Iterator<Entry<E>> iterator(){
        return Iterators.transform(delegate.iterator(),new Function<E,Entry<E>>(){
          @Override public Entry<E> apply(          E elem){
            return immutableEntry(elem,1);
          }
        }
);
      }
      @Override public int size(){
        return delegate.size();
      }
    }
;
  }
  return es;
}
Program: 60255
Project: 60255
Buggy source:
public void testConstructorLenient_classObject(){
  String toTest=Objects.toStringHelper(TestClass.class).toString();
  assertTrue(toTest.matches("String_Node_Str"));
}

Fixed version (ground truth):
public void testConstructorLenient_classObject(){
  String toTest=Objects.toStringHelper(TestClass.class).toString();
  assertTrue(toTest,toTest.matches("String_Node_Str"));
}
Program: 60256
Project: 60256
Buggy source:
public void testConstructor_anonymousClass(){
  String toTest=Objects.toStringHelper(new Object(){
  }
).toString();
  assertTrue(toTest,toTest.matches("String_Node_Str"));
}

Fixed version (ground truth):
public void testConstructor_anonymousClass(){
  String toTest=Objects.toStringHelper(new Object(){
  }
).toString();
  assertEquals("String_Node_Str",toTest);
}
Program: 60257
Project: 60257
Buggy source:
/** 
 * {@link Class#getSimpleName()} is not GWT compatible yet, so weprovide our own implementation.
 */
private static String simpleName(Class<?> clazz){
  String name=clazz.getName();
  int start=name.lastIndexOf('$');
  if (start == -1) {
    start=name.lastIndexOf('.');
  }
  return name.substring(start + 1);
}

Fixed version (ground truth):
/** 
 * {@link Class#getSimpleName()} is not GWT compatible yet, so weprovide our own implementation.
 */
private static String simpleName(Class<?> clazz){
  String name=clazz.getName();
  name=name.replaceAll("String_Node_Str","String_Node_Str");
  int start=name.lastIndexOf('$');
  if (start == -1) {
    start=name.lastIndexOf('.');
  }
  return name.substring(start + 1);
}
Program: 60258
Project: 60258
Buggy source:
@Override public E intern(E sample){
  while (true) {
    ReferenceEntry<E,Dummy> entry=map.getLiveEntry(sample);
    if (entry != null) {
      return entry.getKey();
    }
    Dummy sneaky=map.putIfAbsent(sample,Dummy.VALUE);
    if (sneaky == null) {
      return sample;
    }
 else {
    }
  }
}

Fixed version (ground truth):
@Override public E intern(E sample){
  while (true) {
    ReferenceEntry<E,Dummy> entry=map.getEntry(sample);
    if (entry != null) {
      E canonical=entry.getKey();
      if (canonical != null) {
        return canonical;
      }
    }
    Dummy sneaky=map.putIfAbsent(sample,Dummy.VALUE);
    if (sneaky == null) {
      return sample;
    }
 else {
    }
  }
}
Program: 60259
Project: 60259
Buggy source:
/** 
 * Returns the ratio of cache creates which threw exceptions. This is defined as  {@code createExceptionCount / (createSuccessCount + createExceptionCount)}, or  {@code 0.0} when {@code createSuccessCount + createExceptionCount == 0}.
 */
public double createExceptionRate(){
  long totalCreateCount=createSuccessCount + createExceptionCount;
  return (totalCreateCount == 0) ? 0.0 : createExceptionCount / totalCreateCount;
}

Fixed version (ground truth):
/** 
 * Returns the ratio of cache creates which threw exceptions. This is defined as  {@code createExceptionCount / (createSuccessCount + createExceptionCount)}, or  {@code 0.0} when {@code createSuccessCount + createExceptionCount == 0}.
 */
public double createExceptionRate(){
  long totalCreateCount=createSuccessCount + createExceptionCount;
  return (totalCreateCount == 0) ? 0.0 : (double)createExceptionCount / totalCreateCount;
}
Program: 60260
Project: 60260
Buggy source:
public final V get(@Nullable Object key){
  return Maps.safeGet(delegate,key);
}

Fixed version (ground truth):
public final V get(@Nullable Object key){
  return (key == null) ? null : Maps.safeGet(delegate,key);
}
Program: 60262
Project: 60262
Buggy source:
private static byte[] textToNumericFormatV4(String ipString){
  if (ipString.contains("String_Node_Str")) {
    return null;
  }
  String[] address=ipString.split("String_Node_Str");
  if (address.length != IPV4_PART_COUNT) {
    return null;
  }
  byte[] bytes=new byte[IPV4_PART_COUNT];
  try {
    for (int i=0; i < bytes.length; i++) {
      int piece=Integer.parseInt(address[i]);
      if (piece < 0 || piece > 255) {
        return null;
      }
      if (address[i].startsWith("String_Node_Str") && address[i].length() != 1) {
        return null;
      }
      bytes[i]=(byte)piece;
    }
  }
 catch (  NumberFormatException ex) {
    return null;
  }
  return bytes;
}

Fixed version (ground truth):
private static byte[] textToNumericFormatV4(String ipString){
  if (ipString.contains("String_Node_Str")) {
    return null;
  }
  String[] address=ipString.split("String_Node_Str",IPV4_PART_COUNT + 1);
  if (address.length != IPV4_PART_COUNT) {
    return null;
  }
  byte[] bytes=new byte[IPV4_PART_COUNT];
  try {
    for (int i=0; i < bytes.length; i++) {
      bytes[i]=parseOctet(address[i]);
    }
  }
 catch (  NumberFormatException ex) {
    return null;
  }
  return bytes;
}
Program: 60263
Project: 60263
Buggy source:
/** 
 * Moves an element one level up from a min level to a max level (or vice versa). Returns the new position of the element.
 */
int crossOverUp(int index,E x){
  if (index == 0) {
    queue[0]=x;
    return 0;
  }
  int parentIndex=getParentIndex(index);
  E parentElement=elementData(parentIndex);
  if (parentIndex != 0) {
    int grandparentIndex=getParentIndex(parentIndex);
    int uncleIndex=getRightChildIndex(grandparentIndex);
    if (uncleIndex != parentIndex) {
      E uncleElement=elementData(uncleIndex);
      if (ordering.compare(uncleElement,parentElement) < 0) {
        parentIndex=uncleIndex;
        parentElement=uncleElement;
      }
    }
  }
  if (ordering.compare(parentElement,x) < 0) {
    queue[index]=parentElement;
    queue[parentIndex]=x;
    return parentIndex;
  }
  queue[index]=x;
  return index;
}

Fixed version (ground truth):
/** 
 * Moves an element one level up from a min level to a max level (or vice versa). Returns the new position of the element.
 */
int crossOverUp(int index,E x){
  if (index == 0) {
    queue[0]=x;
    return 0;
  }
  int parentIndex=getParentIndex(index);
  E parentElement=elementData(parentIndex);
  if (parentIndex != 0) {
    int grandparentIndex=getParentIndex(parentIndex);
    int uncleIndex=getRightChildIndex(grandparentIndex);
    if (uncleIndex != parentIndex && getLeftChildIndex(uncleIndex) >= size) {
      E uncleElement=elementData(uncleIndex);
      if (ordering.compare(uncleElement,parentElement) < 0) {
        parentIndex=uncleIndex;
        parentElement=uncleElement;
      }
    }
  }
  if (ordering.compare(parentElement,x) < 0) {
    queue[index]=parentElement;
    queue[parentIndex]=x;
    return parentIndex;
  }
  queue[index]=x;
  return index;
}
Program: 60264
Project: 60264
Buggy source:
/** 
 * Removes the element at position   {@code index}. <p>Normally this method leaves the elements at up to   {@code index - 1}, inclusive, untouched.  Under these circumstances, it returns   {@code null}. <p>Occasionally, in order to maintain the heap invariant, it must swap a later element of the list with one before   {@code index}. Under these circumstances it returns a pair of elements as a   {@link MoveDesc}. The first one is the element that was previously at the end of the heap and is now at some position before   {@code index}. The second element is the one that was swapped down to replace the element at   {@code index}. This fact is used by iterator.remove so as to visit elements during a traversal once and only once.
 */
@VisibleForTesting MoveDesc<E> removeAt(int index){
  checkPositionIndex(index,size);
  modCount++;
  size--;
  if (size == index) {
    queue[size]=null;
    return null;
  }
  E toTrickle=elementData(size);
  queue[size]=null;
  Heap heap=heapForIndex(index);
  int vacated=heap.fillHoleAt(index);
  int bubbledTo=heap.bubbleUpAlternatingLevels(vacated,toTrickle);
  if (bubbledTo == vacated) {
    return heap.tryCrossOverAndBubbleUp(index,vacated,toTrickle);
  }
 else {
    return (bubbledTo < index) ? new MoveDesc<E>(toTrickle,elementData(index)) : null;
  }
}

Fixed version (ground truth):
/** 
 * Removes the element at position   {@code index}. <p>Normally this method leaves the elements at up to   {@code index - 1}, inclusive, untouched.  Under these circumstances, it returns   {@code null}. <p>Occasionally, in order to maintain the heap invariant, it must swap a later element of the list with one before   {@code index}. Under these circumstances it returns a pair of elements as a   {@link MoveDesc}. The first one is the element that was previously at the end of the heap and is now at some position before   {@code index}. The second element is the one that was swapped down to replace the element at   {@code index}. This fact is used by iterator.remove so as to visit elements during a traversal once and only once.
 */
@VisibleForTesting MoveDesc<E> removeAt(int index){
  checkPositionIndex(index,size);
  modCount++;
  size--;
  if (size == index) {
    queue[size]=null;
    return null;
  }
  E actualLastElement=elementData(size);
  int lastElementAt=heapForIndex(size).getCorrectLastElement(actualLastElement);
  E toTrickle=elementData(size);
  queue[size]=null;
  MoveDesc<E> changes=fillHole(index,toTrickle);
  if (lastElementAt < index) {
    if (changes == null) {
      return new MoveDesc<E>(actualLastElement,toTrickle);
    }
 else {
      return new MoveDesc<E>(actualLastElement,changes.replaced);
    }
  }
  return changes;
}
Program: 60265
Project: 60265
Buggy source:
@Override public void clear(){
  linkedEntries.removeAll(createEntries(delegate()));
  delegate.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  for (  V value : delegate) {
    linkedEntries.remove(createEntry(value));
  }
  delegate.clear();
}
Program: 60266
Project: 60266
Buggy source:
@Override public void clear(){
  linkedEntries.removeAll(createEntries(delegate()));
  delegate.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  for (  V value : delegate) {
    linkedEntries.remove(createEntry(value));
  }
  delegate.clear();
}
Program: 60267
Project: 60267
Buggy source:
@Override public K getKey(){
  return key;
}

Fixed version (ground truth):
@Override public K getKey(){
  return entry.getKey();
}
Program: 60268
Project: 60268
Buggy source:
@Override public Collection<Entry<K,V2>> entries(){
  if (entries == null) {
    Collection<Entry<K,V2>> es=new TransformedEntries();
    entries=es;
    return es;
  }
  return entries;
}

Fixed version (ground truth):
@Override public Collection<Entry<K,V2>> entries(){
  if (entries == null) {
    Collection<Entry<K,V2>> es=new TransformedEntries(transformer);
    entries=es;
    return es;
  }
  return entries;
}
Program: 60269
Project: 60269
Buggy source:
@Override public Collection<V> getValue(){
  return get(key);
}

Fixed version (ground truth):
@Override public V2 getValue(){
  return transformer.transformEntry(entry.getKey(),entry.getValue());
}
Program: 60270
Project: 60270
Buggy source:
TransformedEntries(){
  super(fromMultimap.entries(),new Function<Entry<K,V1>,Entry<K,V2>>(){
    @Override public Entry<K,V2> apply(    Entry<K,V1> entry){
      K key=entry.getKey();
      return Maps.immutableEntry(key,transformer.transformEntry(key,entry.getValue()));
    }
  }
);
}

Fixed version (ground truth):
TransformedEntries(final EntryTransformer<? super K,? super V1,V2> transformer){
  super(fromMultimap.entries(),new Function<Entry<K,V1>,Entry<K,V2>>(){
    @Override public Entry<K,V2> apply(    final Entry<K,V1> entry){
      return new AbstractMapEntry<K,V2>(){
        @Override public K getKey(){
          return entry.getKey();
        }
        @Override public V2 getValue(){
          return transformer.transformEntry(entry.getKey(),entry.getValue());
        }
      }
;
    }
  }
);
}
Program: 60272
Project: 60272
Buggy source:
public Class<? extends Annotation> getAnnotationType(){
  return annotationType;
}

Fixed version (ground truth):
@Override public Class<? extends Annotation> getAnnotationType(){
  return annotationType;
}
Program: 60273
Project: 60273
Buggy source:
public AnnotationStrategy withoutAttributes(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public AnnotationStrategy withoutAttributes(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 60274
Project: 60274
Buggy source:
public Annotation getAnnotation(){
  return annotation;
}

Fixed version (ground truth):
@Override public Annotation getAnnotation(){
  return annotation;
}
Program: 60275
Project: 60275
Buggy source:
public boolean hasAttributes(){
  return false;
}

Fixed version (ground truth):
@Override public boolean hasAttributes(){
  return false;
}
Program: 60276
Project: 60276
Buggy source:
PrivateBinder skipSources(Class... classesToSkip);

Fixed version (ground truth):
@Override PrivateBinder skipSources(Class... classesToSkip);
Program: 60277
Project: 60277
Buggy source:
PrivateBinder withSource(Object source);

Fixed version (ground truth):
@Override PrivateBinder withSource(Object source);
Program: 60278
Project: 60278
Buggy source:
/** 
 * Provides an instance of   {@code T}. Must never return   {@code null}.
 * @throws OutOfScopeException when an attempt is made to access a scoped object while the scopein question is not currently active
 * @throws ProvisionException if an instance cannot be provided. Such exceptions include messagesand throwables to describe why provision failed.
 */
T get();

Fixed version (ground truth):
/** 
 * Provides an instance of   {@code T}. Must never return   {@code null}.
 * @throws OutOfScopeException when an attempt is made to access a scoped object while the scopein question is not currently active
 * @throws ProvisionException if an instance cannot be provided. Such exceptions include messagesand throwables to describe why provision failed.
 */
@Override T get();
Program: 60279
Project: 60279
Buggy source:
/** 
 * A short but useful description of this scope.  For comparison, the standard scopes that ship with guice use the descriptions  {@code "Scopes.SINGLETON"},   {@code "ServletScopes.SESSION"} and{@code "ServletScopes.REQUEST"}.
 */
String toString();

Fixed version (ground truth):
/** 
 * A short but useful description of this scope. For comparison, the standard scopes that ship with guice use the descriptions   {@code "Scopes.SINGLETON"},   {@code "ServletScopes.SESSION"} and{@code "ServletScopes.REQUEST"}.
 */
@Override String toString();
Program: 60280
Project: 60280
Buggy source:
public <T>Provider<T> scope(Key<T> key,Provider<T> unscoped){
  return unscoped;
}

Fixed version (ground truth):
@Override public <T>Provider<T> scope(Key<T> key,Provider<T> unscoped){
  return unscoped;
}
Program: 60281
Project: 60281
Buggy source:
public Boolean visitNoScoping(){
  return false;
}

Fixed version (ground truth):
@Override public Boolean visitNoScoping(){
  return false;
}
Program: 60282
Project: 60282
Buggy source:
public Boolean visitScope(Scope visitedScope){
  return visitedScope == scope;
}

Fixed version (ground truth):
@Override public Boolean visitScope(Scope visitedScope){
  return visitedScope == scope;
}
Program: 60284
Project: 60284
Buggy source:
public Boolean visitScopeAnnotation(Class<? extends Annotation> visitedAnnotation){
  return visitedAnnotation == scopeAnnotation;
}

Fixed version (ground truth):
@Override public Boolean visitScopeAnnotation(Class<? extends Annotation> visitedAnnotation){
  return visitedAnnotation == scopeAnnotation;
}
Program: 60285
Project: 60285
Buggy source:
public Boolean visitEagerSingleton(){
  return false;
}

Fixed version (ground truth):
@Override public Boolean visitEagerSingleton(){
  return false;
}
Program: 60286
Project: 60286
Buggy source:
public Boolean load(Class<? extends Annotation> annotationType){
  for (  Annotation annotation : annotationType.getAnnotations()) {
    if (annotationTypes.contains(annotation.annotationType())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public Boolean load(Class<? extends Annotation> annotationType){
  for (  Annotation annotation : annotationType.getAnnotations()) {
    if (annotationTypes.contains(annotation.annotationType())) {
      return true;
    }
  }
  return false;
}
Program: 60287
Project: 60287
Buggy source:
public void toInstance(T instance){
  checkNotTargetted();
  Set<InjectionPoint> injectionPoints;
  if (instance != null) {
    try {
      injectionPoints=InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
    }
 catch (    ConfigurationException e) {
      copyErrorsToBinder(e);
      injectionPoints=e.getPartialValue();
    }
  }
 else {
    binder.addError(BINDING_TO_NULL);
    injectionPoints=ImmutableSet.of();
  }
  BindingImpl<T> base=getBinding();
  setBinding(new InstanceBindingImpl<T>(base.getSource(),base.getKey(),Scoping.EAGER_SINGLETON,injectionPoints,instance));
}

Fixed version (ground truth):
@Override public void toInstance(T instance){
  checkNotTargetted();
  Set<InjectionPoint> injectionPoints;
  if (instance != null) {
    try {
      injectionPoints=InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
    }
 catch (    ConfigurationException e) {
      copyErrorsToBinder(e);
      injectionPoints=e.getPartialValue();
    }
  }
 else {
    binder.addError(BINDING_TO_NULL);
    injectionPoints=ImmutableSet.of();
  }
  BindingImpl<T> base=getBinding();
  setBinding(new InstanceBindingImpl<T>(base.getSource(),base.getKey(),Scoping.EAGER_SINGLETON,injectionPoints,instance));
}
Program: 60288
Project: 60288
Buggy source:
public BindingBuilder<T> to(Key<? extends T> linkedKey){
  checkNotNull(linkedKey,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  setBinding(new LinkedBindingImpl<T>(base.getSource(),base.getKey(),base.getScoping(),linkedKey));
  return this;
}

Fixed version (ground truth):
@Override public BindingBuilder<T> to(Key<? extends T> linkedKey){
  checkNotNull(linkedKey,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  setBinding(new LinkedBindingImpl<T>(base.getSource(),base.getKey(),base.getScoping(),linkedKey));
  return this;
}
Program: 60289
Project: 60289
Buggy source:
public BindingBuilder<T> annotatedWith(Annotation annotation){
  annotatedWithInternal(annotation);
  return this;
}

Fixed version (ground truth):
@Override public BindingBuilder<T> annotatedWith(Annotation annotation){
  annotatedWithInternal(annotation);
  return this;
}
Program: 60290
Project: 60290
Buggy source:
public BindingBuilder<T> toProvider(Key<? extends javax.inject.Provider<? extends T>> providerKey){
  checkNotNull(providerKey,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  setBinding(new LinkedProviderBindingImpl<T>(base.getSource(),base.getKey(),base.getScoping(),providerKey));
  return this;
}

Fixed version (ground truth):
@Override public BindingBuilder<T> toProvider(Key<? extends javax.inject.Provider<? extends T>> providerKey){
  checkNotNull(providerKey,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  setBinding(new LinkedProviderBindingImpl<T>(base.getSource(),base.getKey(),base.getScoping(),providerKey));
  return this;
}
Program: 60291
Project: 60291
Buggy source:
public <S extends T>ScopedBindingBuilder toConstructor(Constructor<S> constructor,TypeLiteral<? extends S> type){
  checkNotNull(constructor,"String_Node_Str");
  checkNotNull(type,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints=InjectionPoint.forInstanceMethodsAndFields(type);
  }
 catch (  ConfigurationException e) {
    copyErrorsToBinder(e);
    injectionPoints=e.getPartialValue();
  }
  try {
    InjectionPoint constructorPoint=InjectionPoint.forConstructor(constructor,type);
    setBinding(new ConstructorBindingImpl<T>(base.getKey(),base.getSource(),base.getScoping(),constructorPoint,injectionPoints));
  }
 catch (  ConfigurationException e) {
    copyErrorsToBinder(e);
  }
  return this;
}

Fixed version (ground truth):
@Override public <S extends T>ScopedBindingBuilder toConstructor(Constructor<S> constructor,TypeLiteral<? extends S> type){
  checkNotNull(constructor,"String_Node_Str");
  checkNotNull(type,"String_Node_Str");
  checkNotTargetted();
  BindingImpl<T> base=getBinding();
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints=InjectionPoint.forInstanceMethodsAndFields(type);
  }
 catch (  ConfigurationException e) {
    copyErrorsToBinder(e);
    injectionPoints=e.getPartialValue();
  }
  try {
    InjectionPoint constructorPoint=InjectionPoint.forConstructor(constructor,type);
    setBinding(new ConstructorBindingImpl<T>(base.getKey(),base.getSource(),base.getScoping(),constructorPoint,injectionPoints));
  }
 catch (  ConfigurationException e) {
    copyErrorsToBinder(e);
  }
  return this;
}
Program: 60292
Project: 60292
Buggy source:
public <V>V acceptVisitor(ElementVisitor<V> visitor){
  return visitor.visit(this);
}

Fixed version (ground truth):
@Override public <V>V acceptVisitor(ElementVisitor<V> visitor){
  return visitor.visit(this);
}