nus-yam/ex-repair huggingface dataset:
Program: 113149
Project: 113149
Buggy source:
public void run(){
  while (s < 20 && !shutdown) {
    s++;
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
    }
    try {
      String txID=allocater.getTransaction();
synchronized (activeTX) {
        assert(!activeTX.contains(txID));
        activeTX.add(txID);
        activeTX.notify();
      }
      try {
        Thread.sleep(200 + (Math.abs(random.nextInt()) % 200));
      }
 catch (      InterruptedException e) {
      }
      allocater.releaseTransaction(txID);
synchronized (activeTX) {
        activeTX.remove(txID);
      }
    }
 catch (    Throwable e) {
synchronized (failures) {
        failures.add(e);
        shutdown=true;
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (s < 10 && !shutdown) {
    s++;
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
    }
    try {
      String txID=allocater.getTransaction();
synchronized (activeTX) {
        assert(!activeTX.contains(txID));
        activeTX.add(txID);
        activeTX.notify();
      }
      try {
        Thread.sleep(200 + (Math.abs(random.nextInt()) % 200));
      }
 catch (      InterruptedException e) {
      }
      allocater.releaseTransaction(txID);
synchronized (activeTX) {
        activeTX.remove(txID);
      }
    }
 catch (    Throwable e) {
synchronized (failures) {
        failures.add(e);
        shutdown=true;
      }
    }
  }
}
Program: 113150
Project: 113150
Buggy source:
protected boolean objectExists(final ByteArrayId id){
  if (cache.get(id) != null) {
    return true;
  }
  try {
    final BatchScanner scanner=getScanner(id);
    try {
      final Iterator<Entry<Key,Value>> it=scanner.iterator();
      return it.hasNext();
    }
  finally {
      scanner.close();
    }
  }
 catch (  final TableNotFoundException e) {
    LOGGER.debug("String_Node_Str" + StringUtils.stringFromBinary(id.getBytes()) + "String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
protected boolean objectExists(final ByteArrayId id){
  if (cache.get(id) != null) {
    return true;
  }
  try {
    final BatchScanner scanner=getScanner(id);
    try {
      final Iterator<Entry<Key,Value>> it=scanner.iterator();
      if (it.hasNext()) {
        return (entryToValue(it.next()) != null);
      }
 else {
        return false;
      }
    }
  finally {
      scanner.close();
    }
  }
 catch (  final TableNotFoundException e) {
    LOGGER.debug("String_Node_Str" + StringUtils.stringFromBinary(id.getBytes()) + "String_Node_Str",e);
  }
  return false;
}
Program: 113151
Project: 113151
Buggy source:
@Override public boolean tableExists(String tableName){
  final String qName=getQualifiedTableName(tableName);
  return connector.tableOperations().exists(qName);
}

Fixed version (ground truth):
@Override public boolean tableExists(final String tableName){
  final String qName=getQualifiedTableName(tableName);
  return connector.tableOperations().exists(qName);
}
Program: 113152
Project: 113152
Buggy source:
/** 
 * Convert from an expected input format to a data format that can be directly ingested into GeoWave
 * @param input The expected input.
 * @param primaryIndexId The index ID specified via a commandline argument (this is typically either the default spatial index or default spatial-temporal index)
 * @param globalVisibility If on the command-line the user specifies a global visibility to write to the visibility column in GeoWave, it is passed along here. It is assumed that this is the same visibility string that will be passed to DataAdapterProvider.getDataAdapters()
 * @return The objects that can be directly ingested into GeoWave
 */
public Iterable<GeoWaveData<O>> toGeoWaveData(I input,ByteArrayId primaryIndexId,String globalVisibility);

Fixed version (ground truth):
/** 
 * Convert from an expected input format to a data format that can be directly ingested into GeoWave
 * @param input The expected input.
 * @param primaryIndexId The index ID specified via a commandline argument (this is typically either the default spatial index or default spatial-temporal index)
 * @param globalVisibility If on the command-line the user specifies a global visibility to write to the visibility column in GeoWave, it is passed along here. It is assumed that this is the same visibility string that will be passed to DataAdapterProvider.getDataAdapters()
 * @return The objects that can be directly ingested into GeoWave
 */
public CloseableIterator<GeoWaveData<O>> toGeoWaveData(I input,ByteArrayId primaryIndexId,String globalVisibility);
Program: 113153
Project: 113153
Buggy source:
@Override protected void map(final AvroKey key,final NullWritable value,final org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
  final Iterable<GeoWaveData> data=ingestWithMapper.toGeoWaveData(key.datum(),primaryIndexId,globalVisibility);
  for (  final GeoWaveData d : data) {
    context.write(d.getKey(),d.getValue());
  }
}

Fixed version (ground truth):
@Override protected void map(final AvroKey key,final NullWritable value,final org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
  try (CloseableIterator<GeoWaveData> data=ingestWithMapper.toGeoWaveData(key.datum(),primaryIndexId,globalVisibility)){
    while (data.hasNext()) {
      final GeoWaveData d=data.next();
      context.write(d.getKey(),d.getValue());
    }
  }
 }
Program: 113154
Project: 113154
Buggy source:
@Override protected void reduce(final WritableComparable<?> key,final Iterable<Writable> values,final Context context) throws IOException, InterruptedException {
  final Iterable<GeoWaveData> data=ingestWithReducer.toGeoWaveData(key,primaryIndexId,globalVisibility,values);
  for (  final GeoWaveData d : data) {
    context.write(d.getKey(),d.getValue());
  }
}

Fixed version (ground truth):
@Override protected void reduce(final WritableComparable<?> key,final Iterable<Writable> values,final Context context) throws IOException, InterruptedException {
  try (CloseableIterator<GeoWaveData> data=ingestWithReducer.toGeoWaveData(key,primaryIndexId,globalVisibility,values)){
    while (data.hasNext()) {
      final GeoWaveData d=data.next();
      context.write(d.getKey(),d.getValue());
    }
  }
 }
Program: 113155
Project: 113155
Buggy source:
public Iterable<GeoWaveData<O>> toGeoWaveData(K key,ByteArrayId primaryIndexId,String globalVisibility,Iterable<V> values);

Fixed version (ground truth):
public CloseableIterator<GeoWaveData<O>> toGeoWaveData(K key,ByteArrayId primaryIndexId,String globalVisibility,Iterable<V> values);
Program: 113156
Project: 113156
Buggy source:
public Iterable<KeyValueData<K,V>> toIntermediateMapReduceData(I input);

Fixed version (ground truth):
public CloseableIterator<KeyValueData<K,V>> toIntermediateMapReduceData(I input);
Program: 113157
Project: 113157
Buggy source:
@Override protected void map(final AvroKey key,final NullWritable value,final org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
  final Iterable<KeyValueData<WritableComparable<?>,Writable>> data=ingestWithReducer.toIntermediateMapReduceData(key.datum());
  for (  final KeyValueData<WritableComparable<?>,Writable> d : data) {
    context.write(d.getKey(),d.getValue());
  }
}

Fixed version (ground truth):
@Override protected void map(final AvroKey key,final NullWritable value,final org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
  try (CloseableIterator<KeyValueData<WritableComparable<?>,Writable>> data=ingestWithReducer.toIntermediateMapReduceData(key.datum())){
    while (data.hasNext()) {
      final KeyValueData<WritableComparable<?>,Writable> d=data.next();
      context.write(d.getKey(),d.getValue());
    }
  }
 }
Program: 113158
Project: 113158
Buggy source:
abstract protected void processFile(final File file,String typeName,P plugin,R runData);

Fixed version (ground truth):
abstract protected void processFile(final File file,String typeName,P plugin,R runData) throws IOException ;
Program: 113159
Project: 113159
Buggy source:
@Override protected void processFile(final File file,final String typeName,final LocalFileIngestPlugin plugin,final IngestRunData ingestRunData){
  final Iterable<GeoWaveData<?>> geowaveDataIt=plugin.toGeoWaveData(file,accumulo.getPrimaryIndex().getId(),accumulo.getVisibility());
  for (  final GeoWaveData<?> geowaveData : geowaveDataIt) {
    final WritableDataAdapter adapter=ingestRunData.getDataAdapter(geowaveData);
    if (adapter == null) {
      LOGGER.warn("String_Node_Str" + geowaveData.getValue());
      continue;
    }
    indexWriter.write(adapter,geowaveData.getValue());
  }
}

Fixed version (ground truth):
@Override protected void processFile(final File file,final String typeName,final LocalFileIngestPlugin plugin,final IngestRunData ingestRunData) throws IOException {
  try (CloseableIterator<GeoWaveData<?>> geowaveDataIt=plugin.toGeoWaveData(file,accumulo.getPrimaryIndex().getId(),accumulo.getVisibility())){
    while (geowaveDataIt.hasNext()) {
      final GeoWaveData<?> geowaveData=geowaveDataIt.next();
      final WritableDataAdapter adapter=ingestRunData.getDataAdapter(geowaveData);
      if (adapter == null) {
        LOGGER.warn("String_Node_Str" + geowaveData.getValue());
        continue;
      }
      ingestRunData.getIndexWriter().write(adapter,geowaveData.getValue());
    }
  }
 }
Program: 113161
Project: 113161
Buggy source:
@Override public void init(final SFCDimensionDefinition[] dimensionDefs){
  binsPerDimension=new long[dimensionDefs.length];
  for (int d=0; d < dimensionDefs.length; d++) {
    final SFCDimensionDefinition dimension=dimensionDefs[d];
    binsPerDimension[d]=(long)Math.pow(2,dimension.getBitsOfPrecision());
  }
}

Fixed version (ground truth):
@Override public void init(final SFCDimensionDefinition[] dimensionDefs){
  binsPerDimension=new long[dimensionDefs.length];
  int totalPrecision=0;
  for (int d=0; d < dimensionDefs.length; d++) {
    final SFCDimensionDefinition dimension=dimensionDefs[d];
    binsPerDimension[d]=(long)Math.pow(2,dimension.getBitsOfPrecision());
    totalPrecision+=dimension.getBitsOfPrecision();
  }
  minHilbertValue=0;
  maxHilbertValue=(long)(Math.pow(2,totalPrecision) - 1);
}
Program: 113163
Project: 113163
Buggy source:
@Override public void init(final SFCDimensionDefinition[] dimensionDefs){
  binsPerDimension=new BigDecimal[dimensionDefs.length];
  for (int d=0; d < dimensionDefs.length; d++) {
    final SFCDimensionDefinition dimension=dimensionDefs[d];
    binsPerDimension[d]=TWO.pow(dimension.getBitsOfPrecision());
  }
}

Fixed version (ground truth):
@Override public void init(final SFCDimensionDefinition[] dimensionDefs){
  binsPerDimension=new BigDecimal[dimensionDefs.length];
  int totalPrecision=0;
  for (int d=0; d < dimensionDefs.length; d++) {
    final SFCDimensionDefinition dimension=dimensionDefs[d];
    binsPerDimension[d]=TWO.pow(dimension.getBitsOfPrecision());
    totalPrecision+=dimension.getBitsOfPrecision();
  }
  minHilbertValue=BigInteger.ZERO;
  maxHilbertValue=TWO.pow(totalPrecision).subtract(BigDecimal.ONE).toBigInteger();
}
Program: 113165
Project: 113165
Buggy source:
protected List<ByteArrayId> decomposeRangesForEntry(final BinnedNumericDataset index,final int tier){
  final List<ByteArrayId> retVal=new ArrayList<ByteArrayId>();
  final byte[] tierAndBinId=ByteArrayUtils.combineArrays(new byte[]{(byte)tier},index.getBinId());
  final RangeDecomposition rangeDecomp=orderedSfcs[tier].decomposeQuery(index,DEFAULT_MAX_RANGES);
  for (  final ByteArrayRange range : rangeDecomp.getRanges()) {
    final byte[] currentRowId=Arrays.copyOf(range.getStart().getBytes(),range.getStart().getBytes().length);
    final int increment=(orderedSfcs[tier].getBitsOfPrecision() % 8) + 1;
    retVal.add(new ByteArrayId(ByteArrayUtils.combineArrays(tierAndBinId,currentRowId)));
    while (!Arrays.equals(currentRowId,range.getEnd().getBytes())) {
      boolean overflow=false;
      for (int i=0; i < increment; i++) {
        if (!ByteArrayUtils.increment(currentRowId)) {
          LOGGER.warn("String_Node_Str");
          overflow=true;
          break;
        }
        if (Arrays.equals(currentRowId,range.getEnd().getBytes())) {
          break;
        }
      }
      if (!overflow) {
        retVal.add(new ByteArrayId(ByteArrayUtils.combineArrays(tierAndBinId,currentRowId)));
      }
    }
  }
  return retVal;
}

Fixed version (ground truth):
protected List<ByteArrayId> decomposeRangesForEntry(final BinnedNumericDataset index,final int tier){
  final List<ByteArrayId> retVal=new ArrayList<ByteArrayId>();
  final byte[] tierAndBinId=ByteArrayUtils.combineArrays(new byte[]{(byte)tier},index.getBinId());
  final RangeDecomposition rangeDecomp=orderedSfcs[tier].decomposeQuery(index,DEFAULT_MAX_RANGES);
  for (  final ByteArrayRange range : rangeDecomp.getRanges()) {
    final byte[] currentRowId=Arrays.copyOf(range.getStart().getBytes(),range.getStart().getBytes().length);
    final int increment=(int)Math.pow(2,getNumPaddedBitsInByte(orderedSfcs[tier].getBitsOfPrecision()));
    retVal.add(new ByteArrayId(ByteArrayUtils.combineArrays(tierAndBinId,currentRowId)));
    while (!Arrays.equals(currentRowId,range.getEnd().getBytes())) {
      boolean overflow=false;
      for (int i=0; i < increment; i++) {
        if (!ByteArrayUtils.increment(currentRowId)) {
          LOGGER.warn("String_Node_Str");
          ;
          overflow=true;
          break;
        }
        if (Arrays.equals(currentRowId,range.getEnd().getBytes())) {
          break;
        }
      }
      if (!overflow) {
        retVal.add(new ByteArrayId(ByteArrayUtils.combineArrays(tierAndBinId,currentRowId)));
      }
    }
  }
  return retVal;
}
Program: 113167
Project: 113167
Buggy source:
/** 
 * Returns the slope parametar of this function
 * @return slope parametar of this function
 */
public double getSlope(){
  return this.slope;
}

Fixed version (ground truth):
/** 
 * Returns the slope parameter of this function
 * @return slope parameter of this function
 */
public double getSlope(){
  return slope;
}
Program: 113168
Project: 113168
Buggy source:
public double getAmplitude(){
  return amplitude;
}

Fixed version (ground truth):
/** 
 * Returns the amplitude parameter of this function
 * @return amplitude parameter of this function
 */
public double getAmplitude(){
  return amplitude;
}
Program: 113169
Project: 113169
Buggy source:
@Override final public double getDerivative(double net){
  return (1d - output * output);
}

Fixed version (ground truth):
/** 
 * Returns the derivative of this function evaluated at x=input
 * @param input location to evaluate the derivative
 * @return derivative of this function evaluated at x=input
 */
@Override final public double getDerivative(double input){
  if (Math.abs(input) * slope > 100) {
    return 0.0d;
  }
  double E_x=Math.exp(2 * slope * input);
  double tanhsx=(E_x - 1d) / (E_x + 1d);
  derivativeOutput=amplitude * slope * (1.0d - tanhsx * tanhsx);
  return derivativeOutput;
}
Program: 113170
Project: 113170
Buggy source:
public void setAmplitude(double amplitude){
  this.amplitude=amplitude;
}

Fixed version (ground truth):
/** 
 * Sets the slope parameter for this function
 * @param amplitude value for the amplitude parameter
 */
public void setAmplitude(double amplitude){
  this.amplitude=amplitude;
}
Program: 113171
Project: 113171
Buggy source:
/** 
 * Sets the slope parametar for this function
 * @param slope value for the slope parametar
 */
public void setSlope(double slope){
  this.slope=slope;
}

Fixed version (ground truth):
/** 
 * Sets the slope parameter for this function
 * @param slope value for the slope parameter
 */
public void setSlope(double slope){
  this.slope=slope;
}
Program: 113172
Project: 113172
Buggy source:
@Override final public double getOutput(double input){
  if (input > 100) {
    return 1.0;
  }
 else   if (input < -100) {
    return -1.0;
  }
  double E_x=Math.exp(this.slope * input);
  this.output=amplitude * ((E_x - 1d) / (E_x + 1d));
  return this.output;
}

Fixed version (ground truth):
/** 
 * Returns the value of this function at x=input
 * @param input location to evaluate this function
 * @return value of this function at x=input
 */
@Override final public double getOutput(double input){
  if (Math.abs(input) * slope > 100) {
    return Math.signum(input) * 1.0d;
  }
  double E_x=Math.exp(2.0d * slope * input);
  output=amplitude * ((E_x - 1.0d) / (E_x + 1.0d));
  return output;
}
Program: 113173
Project: 113173
Buggy source:
@Parameters public static Collection getparameters(){
  return Arrays.asList(new Object[][]{{.1,.0249947929,.940014848},{.2,.0499583,.786447},{.3,.07485969,.596585},{.4,.09966799,.419974},{.5,.124353,.280414},{.6,.1488850,.1807066},{.7,.17323515,.113812},{.8,.1973753,.070650},{.9,.22127846,.043464}});
}

Fixed version (ground truth):
@Parameters public static Collection getparameters(){
  return Arrays.asList(new Object[][]{{.1,0.5,1.5,.0749376d,.748128d},{.2,0.5,1.5,.149502d,.74255d},{.3,0.5,1.5,.223328d,.733375d},{.4,0.5,1.5,.296063d,.720782d},{.5,0.5,1.5,.367378d,.705011d},{.6,0.5,1.5,.436969d,.686353d},{.7,0.5,1.5,.504563d,.665139d},{.8,0.5,1.5,.569923d,.641729d},{.9,0.5,1.5,.632849d,.616501d}});
}
Program: 113174
Project: 113174
Buggy source:
@Before public void setUp(){
  instance=new Tanh();
  instance.setSlope(.5);
}

Fixed version (ground truth):
@Before public void setUp(){
  instance=new Tanh();
  instance.setSlope(slope);
  instance.setAmplitude(amplitude);
}
Program: 113175
Project: 113175
Buggy source:
/** 
 * Test of getDerivative method, of class Tanh.
 */
@Test public void testGetDerivative(){
  instance.setSlope(5);
  double out=instance.getOutput(input);
  double result=instance.getDerivative(input);
  assertEquals(expected_derivative,result,0.00001);
}

Fixed version (ground truth):
/** 
 * Test of getDerivative method, of class Tanh.
 */
@Test public void testGetDerivative(){
  double out=instance.getOutput(input);
  double result=instance.getDerivative(input);
  assertEquals(expected_derivative,result,0.00001);
}
Program: 113176
Project: 113176
Buggy source:
public TanhTest(double input,double expected,double expected_derivative){
  this.input=input;
  this.expected=expected;
  this.expected_derivative=expected_derivative;
}

Fixed version (ground truth):
public TanhTest(double input,double slope,double amplitude,double expected,double expected_derivative){
  this.input=input;
  this.slope=slope;
  this.amplitude=amplitude;
  this.expected=expected;
  this.expected_derivative=expected_derivative;
}
Program: 113177
Project: 113177
Buggy source:
public MultilayerPerceptronOptimazer(){
  errorEstimationMethod=new KFoldCrossValidation(10);
}

Fixed version (ground truth):
/** 
 * If ErrorEstimationMethod is not provided use KFoldCrossValidation by default
 */
public MultilayerPerceptronOptimazer(){
  errorEstimationMethod=new KFoldCrossValidation(10);
}
Program: 113178
Project: 113178
Buggy source:
@Override protected DataSetRow getNextDataSetRow(){
  return dataDeque.pop();
}

Fixed version (ground truth):
@Override protected DataSetRow getNextDataSetRow(){
  return dataSet.getRowAt(new Random().nextInt(dataSet.size()));
}
Program: 113179
Project: 113179
Buggy source:
@Override protected void populateInternalDataStructure(DataSet dataSet){
  dataDeque.addAll(dataSet.getRows());
}

Fixed version (ground truth):
@Override protected void populateInternalDataStructure(DataSet dataSet){
  this.dataSet=dataSet;
}
Program: 113180
Project: 113180
Buggy source:
@Override protected int getSampleSize(){
  return dataDeque.size();
}

Fixed version (ground truth):
@Override protected int getSampleSize(){
  return dataSet.size();
}
Program: 113181
Project: 113181
Buggy source:
public RandomSamplingWithRepetition(final int numberOfFolds){
  super(numberOfFolds);
  dataDeque=new ArrayDeque<>();
}

Fixed version (ground truth):
public RandomSamplingWithRepetition(final int numberOfSamples){
  super(numberOfSamples);
}
Program: 113182
Project: 113182
Buggy source:
public RandomSamplingWithoutRepetition(final int numberOfSamples){
  super(numberOfSamples);
}

Fixed version (ground truth):
public RandomSamplingWithoutRepetition(final int numberOfFolds){
  super(numberOfFolds);
  dataDeque=new ArrayDeque<>();
}
Program: 113183
Project: 113183
Buggy source:
@Override protected DataSetRow getNextDataSetRow(){
  return dataSet.getRowAt(new Random().nextInt(dataSet.size()));
}

Fixed version (ground truth):
@Override protected DataSetRow getNextDataSetRow(){
  return dataDeque.pop();
}
Program: 113184
Project: 113184
Buggy source:
@Override protected void populateInternalDataStructure(DataSet dataSet){
  this.dataSet=dataSet;
}

Fixed version (ground truth):
@Override protected void populateInternalDataStructure(DataSet dataSet){
  dataDeque.addAll(dataSet.getRows());
}
Program: 113185
Project: 113185
Buggy source:
@Override protected int getSampleSize(){
  return dataSet.size() / numberOfSamples;
}

Fixed version (ground truth):
@Override protected int getSampleSize(){
  return dataDeque.size() / numberOfSamples;
}
Program: 113186
Project: 113186
Buggy source:
public static void fullConectMapLayers(FeatureMapLayer fromLayer,FeatureMapLayer toLayer){
  if (fromLayer instanceof ConvolutionLayer || fromLayer instanceof InputMapLayer) {
    for (int i=0; i < fromLayer.getNumberOfMaps(); i++) {
      for (int j=0; j < toLayer.getNumberOfMaps(); j++) {
        connect(fromLayer,toLayer,i,j);
      }
    }
  }
 else {
    for (int i=0; i < fromLayer.getNumberOfMaps(); i++) {
      connect(fromLayer,toLayer,i,i);
    }
  }
}

Fixed version (ground truth):
public static void fullConectMapLayers(FeatureMapLayer fromLayer,FeatureMapLayer toLayer){
  if (toLayer instanceof ConvolutionLayer) {
    for (int i=0; i < fromLayer.getNumberOfMaps(); i++) {
      for (int j=0; j < toLayer.getNumberOfMaps(); j++) {
        connect(fromLayer,toLayer,i,j);
      }
    }
  }
 else {
    for (int i=0; i < toLayer.getNumberOfMaps(); i++) {
      connect(fromLayer,toLayer,i,i);
    }
  }
}
Program: 113188
Project: 113188
Buggy source:
@Override protected String doInBackground() throws Exception {
  publish("String_Node_Str");
  GooglePlayAPI service=App.createConnection(archive);
  service.setLocalization(Locale.getDefault().getCountry());
  service.checkin();
  service.login();
  service.uploadDeviceConfig();
  Archive a=new Archive(archive.getRoot());
  a.setUserId(archive.getUserId());
  a.setPassword(archive.getPassword());
  a.setAndroidId(service.getAndroidID());
  a.saveCredentials();
  return service.getAndroidID();
}

Fixed version (ground truth):
@Override protected String doInBackground() throws Exception {
  publish("String_Node_Str");
  GooglePlayAPI service=App.createConnection(archive);
  service.setLocalization(Locale.getDefault().getCountry());
  if ("String_Node_Str".equals(archive.getAndroidId())) {
    service.checkin();
    service.login();
    service.uploadDeviceConfig();
  }
 else {
    service.login();
  }
  Archive a=new Archive(archive.getRoot());
  a.setUserId(archive.getUserId());
  a.setPassword(archive.getPassword());
  a.setAndroidId(service.getAndroidID());
  a.saveCredentials();
  return service.getAndroidID();
}
Program: 113189
Project: 113189
Buggy source:
protected void doSearch(){
  if (query.getText().length() == 0) {
    doMessage("String_Node_Str");
  }
 else {
    query.setEnabled(false);
    page.setEnabled(false);
    cardLayout.show(main,CARDPROGRESS);
    int offset=(Integer)page.getValue();
    offset=(offset - 1) * 10;
    new SearchWorker(archive,query.getText(),this).withOffset(offset).withLimit(offset + 10).execute();
  }
}

Fixed version (ground truth):
protected void doSearch(){
  if (query.getText().length() == 0) {
    doMessage("String_Node_Str");
  }
 else {
    query.setEnabled(false);
    page.setEnabled(false);
    cardLayout.show(main,CARDPROGRESS);
    int offset=(Integer)page.getValue();
    offset=(offset - 1) * 10;
    new SearchWorker(archive,query.getText(),this).withOffset(offset).withLimit(10).execute();
  }
}
Program: 113190
Project: 113190
Buggy source:
protected void doSearch(){
  query.setEnabled(false);
  page.setEnabled(false);
  cardLayout.show(main,CARDPROGRESS);
  int offset=(Integer)page.getValue();
  offset=(offset - 1) * 10;
  new SearchWorker(archive,query.getText(),this).withOffset(offset).withLimit(offset + 10).execute();
}

Fixed version (ground truth):
protected void doSearch(){
  if (query.getText().length() == 0) {
    return;
  }
  query.setEnabled(false);
  page.setEnabled(false);
  cardLayout.show(main,CARDPROGRESS);
  int offset=(Integer)page.getValue();
  offset=(offset - 1) * 10;
  new SearchWorker(archive,query.getText(),this).withOffset(offset).withLimit(offset + 10).execute();
}
Program: 113191
Project: 113191
Buggy source:
private boolean flush(){
  final int size=featureEvents.size();
  if (size == 0) {
    return true;
  }
  int adds=0, removes=0;
  for (Iterator<FeatureEvent> it=featureEvents.values().iterator(); it.hasNext(); ) {
    FeatureEvent fe=it.next();
    it.remove();
    NodeRef left=fe.left;
    NodeRef right=fe.right;
    if (left == null)     adds++;
    if (right == null)     removes++;
    if (!super.feature(left,right)) {
      return false;
    }
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",size,totalFeatureEvents,adds,removes,totalMerged,maxHeldFeatures));
  }
  return true;
}

Fixed version (ground truth):
private boolean flush(){
  final int size=featureEvents.size();
  if (size == 0) {
    return true;
  }
  int adds=0, removes=0;
  for (Iterator<FeatureEvent> it=featureEvents.values().iterator(); it.hasNext(); ) {
    FeatureEvent fe=it.next();
    it.remove();
    NodeRef left=fe.left;
    NodeRef right=fe.right;
    if (left == null)     adds++;
    if (right == null)     removes++;
    if (!super.feature(left,right)) {
      return false;
    }
  }
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str",size,totalFeatureEvents,adds,removes,totalMerged,maxHeldFeatures));
  }
  return true;
}
Program: 113192
Project: 113192
Buggy source:
public boolean merge(FeatureEvent e){
  if (Objects.equals(left,e.right) || Objects.equals(right,e.left)) {
    return false;
  }
  setLeft(e.left);
  setRight(e.right);
  return true;
}

Fixed version (ground truth):
public boolean merge(FeatureEvent e){
  if ((left != null && left.equals(e.right)) || (right != null && right.equals(e.left))) {
    return false;
  }
  setLeft(e.left);
  setRight(e.right);
  return true;
}
Program: 113193
Project: 113193
Buggy source:
@Override protected boolean canSort(){
  return true;
}

Fixed version (ground truth):
@Override protected boolean canSort(){
  return false;
}
Program: 113194
Project: 113194
Buggy source:
@Override public <T>T get(Object object,String xpath,@Nullable Class<T> target) throws IllegalArgumentException {
  Bounded b=(Bounded)object;
  Object value=null;
  if ("String_Node_Str".equals(xpath)) {
    Optional<Envelope> envelope=b.bounds();
    if (envelope.isPresent()) {
      value=JTS.toGeometry(envelope.get(),BOUNDS_GEOM_FAC);
    }
  }
 else {
    final Node node;
    if (b instanceof NodeRef) {
      node=((NodeRef)b).getNode();
    }
 else     if (b instanceof Node) {
      node=(Node)b;
    }
 else {
      node=null;
    }
    if (node != null) {
      if ("String_Node_Str".equals(xpath)) {
        value=node.getName();
      }
 else {
        value=IndexInfo.getMaterializedAttribute(xpath,node);
      }
    }
    if (value != null && target != null && !target.isInstance(value)) {
      value=Converters.convert(value,target);
    }
  }
  return (T)value;
}

Fixed version (ground truth):
@Override public <T>T get(Object object,String xpath,@Nullable Class<T> target) throws IllegalArgumentException {
  Bounded b=(Bounded)object;
  Object value=null;
  if ("String_Node_Str".equals(xpath)) {
    value=b.bounds().orNull();
  }
 else {
    final Node node;
    if (b instanceof NodeRef) {
      node=((NodeRef)b).getNode();
    }
 else     if (b instanceof Node) {
      node=(Node)b;
    }
 else {
      node=null;
    }
    if (node != null) {
      if ("String_Node_Str".equals(xpath)) {
        value=node.getName();
      }
 else {
        value=IndexInfo.getMaterializedAttribute(xpath,node);
      }
    }
    if (value != null && target != null && !target.isInstance(value)) {
      value=Converters.convert(value,target);
    }
  }
  return (T)value;
}
Program: 113196
Project: 113196
Buggy source:
/** 
 * Determines if the returned iterator shall preserve iteration order among successive calls of the same query. <p> This is the case if: <ul> <li>  {@link #limit} and/or {@link #offset} have been set, since most probably the caller isdoing paging </ul>
 */
private boolean shallPreserveIterationOrder(){
  boolean preserveIterationOrder=false;
  preserveIterationOrder|=limit != null || offset != null;
  return preserveIterationOrder;
}

Fixed version (ground truth):
/** 
 * Determines if the returned iterator shall preserve iteration order among successive calls of the same query. <p> This is the case if: <ul> <li>  {@link #limit} and/or {@link #offset} have been set, since most probably the caller isdoing paging </ul>
 */
private boolean shallPreserveIterationOrder(){
  boolean preserveIterationOrder=false;
  preserveIterationOrder|=limit != null || offset != null;
  return true;
}
Program: 113197
Project: 113197
Buggy source:
@Override public boolean apply(Bounded bounded){
  if (bounded == null) {
    return false;
  }
  if (bounded instanceof Bucket && !(filter instanceof BinarySpatialOperator)) {
    return true;
  }
  if (bounded instanceof NodeRef && ((NodeRef)bounded).getType() == TYPE.TREE) {
    return true;
  }
  return filter.evaluate(bounded);
}

Fixed version (ground truth):
public @Override boolean apply(@Nullable Bounded bounded){
  if (Filter.INCLUDE == filter) {
    return true;
  }
  if (Filter.EXCLUDE == filter) {
    return false;
  }
  if (bounded == null) {
    return false;
  }
  if (bounded instanceof Bucket && !(filter instanceof BinarySpatialOperator)) {
    return true;
  }
  if (bounded instanceof NodeRef && ((NodeRef)bounded).getType() == TYPE.TREE) {
    return true;
  }
  return filter.evaluate(bounded);
}
Program: 113198
Project: 113198
Buggy source:
public static Predicate<Bounded> forFilter(Filter filter){
  if (Filter.INCLUDE.equals(filter)) {
    return Predicates.alwaysTrue();
  }
  if (Filter.EXCLUDE.equals(filter)) {
    return Predicates.alwaysFalse();
  }
  return new PreFilter(filter);
}

Fixed version (ground truth):
public static PreFilter forFilter(Filter filter){
  return Filter.INCLUDE.equals(filter) ? PreFilter.INCLUDE : Filter.EXCLUDE.equals(filter) ? PreFilter.EXCLUDE : new PreFilter(filter);
}
Program: 113199
Project: 113199
Buggy source:
private ImmutableSet<Ref> getChangedRefs(){
  ImmutableSet<Ref> changedRefs=transaction.getChangedRefs();
  return changedRefs;
}

Fixed version (ground truth):
private List<ChangedRef> getChangedRefs(){
  return transaction.changedRefs();
}
Program: 113201
Project: 113201
Buggy source:
/** 
 * The set of refs that have either changed since, or didn't exist at, the time the transaction was created.
 */
public ImmutableSet<Ref> getChangedRefs(){
  Set<String> changedRefNames=transactionRefDatabase.getChangedRefs();
  Set<Ref> changedRefs=new HashSet<Ref>();
  for (  String name : changedRefNames) {
    Ref ref=this.command(RefParse.class).setName(name).call().get();
    changedRefs.add(ref);
  }
  return ImmutableSet.copyOf(changedRefs);
}

Fixed version (ground truth):
/** 
 * The set of refs that have either changed since, or didn't exist at, the time the transaction was created.
 */
public @Deprecated ImmutableSet<Ref> getChangedRefs(){
  Set<String> changedRefNames=transactionRefDatabase.getChangedRefs();
  Set<Ref> changedRefs=new HashSet<Ref>();
  for (  String name : changedRefNames) {
    Ref ref=this.command(RefParse.class).setName(name).call().get();
    changedRefs.add(ref);
  }
  return ImmutableSet.copyOf(changedRefs);
}
Program: 113202
Project: 113202
Buggy source:
/** 
 * Constructs a new   {@code LinearHistoryIterator} with the given parameters.
 * @param tipsList the list of tips to start computing history from
 * @param repo the repository where the commits are stored.
 * @param graphDb
 */
public TopologicalHistoryIterator(final List<ObjectId> tipsList,final Repository repo,GraphDatabase graphDb){
  this.graphDb=graphDb;
  tips=new Stack<RevCommit>();
  stopPoints=Lists.newArrayList();
  for (  ObjectId tip : tipsList) {
    if (!tip.isNull()) {
      final RevCommit commit=repo.getCommit(tip);
      tips.add(commit);
      stopPoints.add(tip);
    }
  }
  this.repo=repo;
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@code LinearHistoryIterator} with the given parameters.
 * @param tipsList the list of tips to start computing history from
 * @param repo the repository where the commits are stored.
 * @param graphDb
 */
public TopologicalHistoryIterator(final List<ObjectId> tipsList,final Repository repo,GraphDatabase graphDb,ObjectId oldestCommitId){
  this.graphDb=graphDb;
  tips=new Stack<RevCommit>();
  stopPoints=Lists.newArrayList();
  stopPoints.add(oldestCommitId);
  this.oldestCommitId=oldestCommitId;
  for (  ObjectId tip : tipsList) {
    if (!tip.isNull()) {
      final RevCommit commit=repo.getCommit(tip);
      tips.add(commit);
      stopPoints.add(tip);
    }
  }
  this.repo=repo;
}
Program: 113205
Project: 113205
Buggy source:
@Test public void testGetParents() throws Exception {
  Repository repo=repoProvider.createGeogig("String_Node_Str",null);
  repoProvider.getTestRepository("String_Node_Str").initializeRpository();
  new TestData(repo).init("String_Node_Str","String_Node_Str").loadDefaultData();
  Iterator<RevCommit> call=repo.command(LogOp.class).call();
  assertTrue(call.hasNext());
  while (call.hasNext()) {
    RevCommit next=call.next();
    ImmutableList<ObjectId> parentIds=next.getParentIds();
    String oid=next.getId().toString();
    MockHttpServletRequestBuilder get=MockMvcRequestBuilders.get("String_Node_Str" + oid);
    String[] actualIds=perform(get).andExpect(status().isOk()).andExpect(content().contentType(MediaType.TEXT_PLAIN)).andReturn().getResponse().getContentAsString().split("String_Node_Str");
    if (actualIds.length == 1 && actualIds[0].isEmpty()) {
      actualIds=new String[0];
    }
    String[] expectedIds=new String[parentIds.size()];
    int i=0;
    for (    ObjectId parentId : parentIds) {
      expectedIds[i++]=parentId.toString();
    }
    assertArrayEquals(expectedIds,actualIds);
  }
  repo.close();
}

Fixed version (ground truth):
@Test public void testGetParents() throws Exception {
  Repository repo=repoProvider.createGeogig("String_Node_Str",null);
  repoProvider.getTestRepository("String_Node_Str").initializeRpository();
  new TestData(repo).init("String_Node_Str","String_Node_Str").loadDefaultData();
  Iterator<RevCommit> call=repo.command(LogOp.class).call();
  assertTrue(call.hasNext());
  while (call.hasNext()) {
    RevCommit next=call.next();
    ImmutableList<ObjectId> parentIds=next.getParentIds();
    String oid=next.getId().toString();
    MockHttpServletRequestBuilder get=MockMvcRequestBuilders.get("String_Node_Str" + oid);
    String response=perform(get).andExpect(status().isOk()).andExpect(content().contentType(MediaType.TEXT_PLAIN)).andReturn().getResponse().getContentAsString();
    String[] actualIds=response.split("String_Node_Str");
    if (actualIds.length == 1 && actualIds[0].isEmpty()) {
      actualIds=new String[0];
    }
    String[] expectedIds=new String[parentIds.size()];
    int i=0;
    for (    ObjectId parentId : parentIds) {
      expectedIds[i++]=parentId.toString();
    }
    assertArrayEquals(expectedIds,actualIds);
  }
  repo.close();
}
Program: 113206
Project: 113206
Buggy source:
protected DataStore getDataStore(String geoJSON) throws FileNotFoundException, IOException {
  try {
    File geoJsonfile=new File(geoJSON);
    checkParameter(geoJsonfile.exists(),"String_Node_Str",geoJsonfile);
    InputStream in=new FileInputStream(geoJsonfile);
    FeatureJSON fjson=new FeatureJSON();
    @SuppressWarnings("String_Node_Str") FeatureCollection fc=fjson.readFeatureCollection(in);
    @SuppressWarnings("String_Node_Str") DataStore dataStore=new MemoryDataStore(fc);
    return dataStore;
  }
 catch (  IOException ioe) {
    throw new CommandFailedException("String_Node_Str" + ioe.getMessage(),ioe);
  }
}

Fixed version (ground truth):
protected DataStore getDataStore(String geoJSON) throws FileNotFoundException, IOException {
  try {
    File geoJsonfile=new File(geoJSON);
    checkParameter(geoJsonfile.exists(),"String_Node_Str",geoJsonfile);
    InputStream in=new FileInputStream(geoJsonfile);
    FeatureJSON fjson=new FeatureJSON();
    @SuppressWarnings("String_Node_Str") FeatureCollection fc=fjson.readFeatureCollection(in);
    MemoryDataStore dataStore=new MemoryDataStore();
    dataStore.addFeatures((SimpleFeatureIterator)fc.features());
    return dataStore;
  }
 catch (  IOException ioe) {
    throw new CommandFailedException("String_Node_Str" + ioe.getMessage(),ioe);
  }
}
Program: 113207
Project: 113207
Buggy source:
@Test public void testImport() throws Exception {
  GeoJsonImport importCommand=new GeoJsonImport();
  importCommand.geoJSONList=new ArrayList<String>();
  importCommand.geoJSONList.add(GeoJsonImport.class.getResource("String_Node_Str").getFile());
  importCommand.run(cli);
}

Fixed version (ground truth):
@Test public void testImport() throws Exception {
  GeoJsonImport importCommand=new GeoJsonImport();
  importCommand.geoJSONList=new ArrayList<String>();
  importCommand.geoJSONList.add(GeoJsonImport.class.getResource("String_Node_Str").getFile());
  importCommand.destTable="String_Node_Str";
  importCommand.run(cli);
  List<NodeRef> nodes=Lists.newArrayList(cli.getGeogig().getRepository().command(LsTreeOp.class).setStrategy(Strategy.DEPTHFIRST).setReference(Ref.WORK_HEAD).call());
  assertEquals(3,nodes.size());
  NodeRef rootNode=nodes.get(0);
  assertEquals("String_Node_Str",rootNode.name());
  assertEquals(TYPE.TREE,rootNode.getType());
  NodeRef feature1=nodes.get(1);
  NodeRef feature2=nodes.get(2);
  ObjectId feature1id;
  ObjectId feature2id;
  if (feature1.name().equals("String_Node_Str")) {
    assertEquals("String_Node_Str",feature2.name());
    feature1id=feature1.getObjectId();
    feature2id=feature2.getObjectId();
  }
 else {
    assertEquals("String_Node_Str",feature1.name());
    assertEquals("String_Node_Str",feature2.name());
    feature1id=feature2.getObjectId();
    feature2id=feature1.getObjectId();
  }
  assertEquals(TYPE.FEATURE,feature1.getType());
  assertEquals(TYPE.FEATURE,feature2.getType());
  assertEquals("String_Node_Str",feature1.getParentPath());
  assertEquals("String_Node_Str",feature2.getParentPath());
  ObjectDatabase odb=cli.getGeogig().getRepository().objectDatabase();
  RevFeature feature1Obj=odb.getFeature(feature1id);
  RevFeature feature2Obj=odb.getFeature(feature2id);
  ImmutableSet<PropertyDescriptor> attributes=cli.getGeogig().command(DescribeFeatureType.class).setFeatureType(odb.getFeatureType(rootNode.getMetadataId())).call();
  assertEquals(3,attributes.size());
  int attributeIndex=0;
  for (  PropertyDescriptor attribute : attributes) {
switch (attribute.getName().toString()) {
case "String_Node_Str":
      assertTrue(LineString.class.isAssignableFrom(attribute.getType().getBinding()));
    assertEquals("String_Node_Str",feature1Obj.get(attributeIndex).get().toString());
  assertEquals("String_Node_Str",feature2Obj.get(attributeIndex).get().toString());
break;
case "String_Node_Str":
assertTrue(String.class.isAssignableFrom(attribute.getType().getBinding()));
assertEquals("String_Node_Str",feature1Obj.get(attributeIndex).get());
assertEquals("String_Node_Str",feature2Obj.get(attributeIndex).get());
break;
case "String_Node_Str":
assertTrue(Double.class.isAssignableFrom(attribute.getType().getBinding()));
assertEquals(0.0,feature1Obj.get(attributeIndex).get());
assertEquals(0.2,feature2Obj.get(attributeIndex).get());
break;
}
attributeIndex++;
}
}
Program: 113208
Project: 113208
Buggy source:
@Override public boolean bucket(NodeRef leftParent,NodeRef rightParent,BucketIndex bucketIndex,Bucket left,Bucket right){
  if (left == null || right == null) {
    Bucket bucket=left == null ? right : left;
    addTreeFeatures(bucket.getObjectId(),left != null,right != null);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean bucket(NodeRef leftParent,NodeRef rightParent,BucketIndex bucketIndex,@Nullable Bucket left,@Nullable Bucket right){
  if (bucketIndex.left().isEmpty() || bucketIndex.right().isEmpty()) {
    Bucket bucket=left == null ? right : left;
    addTreeFeatures(bucket.getObjectId(),left != null,right != null);
    return false;
  }
  return true;
}
Program: 113209
Project: 113209
Buggy source:
@Override public void addConflicts(@Nullable String txId,Iterable<Conflict> conflicts){
  try (RocksDBReference dbRef=getOrCreateDb(txId)){
    ConflictSerializer serializer=new ConflictSerializer();
    try (WriteBatch batch=new WriteBatch()){
      for (      Conflict c : conflicts) {
        byte[] key=key(c.getPath());
        byte[] value=serializer.write(c);
        batch.put(key,value);
      }
      try (WriteOptions writeOptions=new WriteOptions()){
        dbRef.db().write(writeOptions,batch);
      }
     }
 catch (    Exception e) {
      propagate(e);
    }
  }
 }

Fixed version (ground truth):
@Override public void addConflicts(@Nullable String txId,Iterable<Conflict> conflicts){
  try (RocksDBReference dbRef=getOrCreateDb(txId)){
    ConflictSerializer serializer=new ConflictSerializer();
    try (WriteBatch batch=new WriteBatch()){
      for (      Conflict c : conflicts) {
        byte[] key=key(c.getPath());
        byte[] value=serializer.write(c);
        batch.put(key,value);
      }
      try (WriteOptions writeOptions=new WriteOptions()){
        writeOptions.setSync(true);
        dbRef.db().write(writeOptions,batch);
      }
     }
 catch (    Exception e) {
      propagate(e);
    }
  }
 }
Program: 113210
Project: 113210
Buggy source:
@Override public void removeConflict(@Nullable String txId,String path){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  try (RocksDBReference dbRef=dbRefOpt.get()){
    dbRef.db().remove(key(path));
  }
 catch (  RocksDBException e) {
    propagate(e);
  }
}

Fixed version (ground truth):
@Override public void removeConflict(@Nullable String txId,String path){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  try (RocksDBReference dbRef=dbRefOpt.get()){
    dbRef.db().delete(key(path));
  }
 catch (  RocksDBException e) {
    propagate(e);
  }
}
Program: 113211
Project: 113211
Buggy source:
@Override public void removeByPrefix(@Nullable String txId,@Nullable String pathPrefix){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  final @Nullable byte[] prefix=pathPrefix == null ? null : key(pathPrefix + "String_Node_Str");
  try (RocksDBReference dbRef=dbRefOpt.get();WriteBatch batch=new WriteBatch()){
    if (pathPrefix != null) {
      batch.remove(key(pathPrefix));
    }
    try (RocksIterator it=dbRef.db().newIterator()){
      if (prefix == null) {
        it.seekToFirst();
      }
 else {
        it.seek(prefix);
      }
      while (it.isValid()) {
        byte[] key=it.key();
        if (isPrefix(prefix,key)) {
          batch.remove(key);
        }
 else {
          break;
        }
        it.next();
      }
    }
     try (WriteOptions opts=new WriteOptions()){
      dbRef.db().write(opts,batch);
    }
   }
 catch (  RocksDBException e) {
    propagate(e);
  }
}

Fixed version (ground truth):
@Override public void removeByPrefix(@Nullable String txId,@Nullable String pathPrefix){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  final @Nullable byte[] prefix=pathPrefix == null ? null : key(pathPrefix + "String_Node_Str");
  try (RocksDBReference dbRef=dbRefOpt.get();WriteOptions opts=new WriteOptions();WriteBatch batch=new WriteBatch()){
    opts.setSync(true);
    if (pathPrefix != null) {
      batch.remove(key(pathPrefix));
    }
    try (RocksIterator it=dbRef.db().newIterator()){
      if (prefix == null) {
        it.seekToFirst();
      }
 else {
        it.seek(prefix);
      }
      while (it.isValid()) {
        byte[] key=it.key();
        if (isPrefix(prefix,key)) {
          batch.remove(key);
        }
 else {
          break;
        }
        it.next();
      }
    }
     dbRef.db().write(opts,batch);
  }
 catch (  RocksDBException e) {
    propagate(e);
  }
}
Program: 113212
Project: 113212
Buggy source:
@Override public void removeConflicts(@Nullable String txId,Iterable<String> paths){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  try (RocksDBReference dbRef=dbRefOpt.get();WriteOptions writeOptions=new WriteOptions()){
    writeOptions.setSync(false);
    for (    String path : paths) {
      dbRef.db().remove(writeOptions,key(path));
    }
    writeOptions.sync();
  }
 catch (  RocksDBException e) {
    propagate(e);
  }
}

Fixed version (ground truth):
@Override public void removeConflicts(@Nullable String txId,Iterable<String> paths){
  Optional<RocksDBReference> dbRefOpt=getDb(txId);
  if (!dbRefOpt.isPresent()) {
    return;
  }
  try (RocksDBReference dbRef=dbRefOpt.get();WriteOptions writeOptions=new WriteOptions();WriteBatch batch=new WriteBatch()){
    writeOptions.setSync(true);
    for (    String path : paths) {
      batch.remove(key(path));
    }
    dbRef.db().write(writeOptions,batch);
  }
 catch (  RocksDBException e) {
    propagate(e);
  }
}
Program: 113213
Project: 113213
Buggy source:
@Override public boolean put(ObjectId commitId,ImmutableList<ObjectId> parentIds){
  @Nullable NodeData node=getNodeInternal(commitId,false);
  boolean updated=false;
  try (WriteBatch batch=new WriteBatch()){
    if (node == null) {
      node=new NodeData(commitId,parentIds);
      updated=true;
    }
    for (    ObjectId parent : parentIds) {
      if (!node.outgoing.contains(parent)) {
        node.outgoing.add(parent);
        updated=true;
      }
      NodeData parentNode=getNodeInternal(parent,false);
      if (parentNode == null) {
        parentNode=new NodeData(parent);
        updated=true;
      }
      if (!parentNode.incoming.contains(commitId)) {
        parentNode.incoming.add(commitId);
        updated=true;
      }
      batch.put(parent.getRawValue(),BINDING.objectToEntry(parentNode));
    }
    batch.put(commitId.getRawValue(),BINDING.objectToEntry(node));
    try (RocksDBReference dbRef=dbhandle.getReference();WriteOptions wo=new WriteOptions()){
      dbRef.db().write(wo,batch);
    }
   }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
  return updated;
}

Fixed version (ground truth):
@Override public boolean put(ObjectId commitId,ImmutableList<ObjectId> parentIds){
  @Nullable NodeData node=getNodeInternal(commitId,false);
  boolean updated=false;
  try (WriteBatch batch=new WriteBatch()){
    if (node == null) {
      node=new NodeData(commitId,parentIds);
      updated=true;
    }
    for (    ObjectId parent : parentIds) {
      if (!node.outgoing.contains(parent)) {
        node.outgoing.add(parent);
        updated=true;
      }
      NodeData parentNode=getNodeInternal(parent,false);
      if (parentNode == null) {
        parentNode=new NodeData(parent);
        updated=true;
      }
      if (!parentNode.incoming.contains(commitId)) {
        parentNode.incoming.add(commitId);
        updated=true;
      }
      batch.put(parent.getRawValue(),BINDING.objectToEntry(parentNode));
    }
    batch.put(commitId.getRawValue(),BINDING.objectToEntry(node));
    try (RocksDBReference dbRef=dbhandle.getReference();WriteOptions wo=new WriteOptions()){
      wo.setSync(true);
      dbRef.db().write(wo,batch);
    }
   }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
  return updated;
}