nus-yam/ex-repair huggingface dataset:
Program: 36704
Project: 36704
Buggy source:
@Override public <E extends Exception>Future<T> trap(Class<E> exceptionClass,ExceptionTrapper<E,T> trapper){
  FutureWithTrigger<T> nextFuture=new FutureWithTrigger<>();
  FutureWithTrigger.this.callbackLink.setCallbackTo(new Callback<T>(){
    @Override public void completed(    T result){
    }
    @Override public void failed(    Exception throwable){
      if (exceptionClass.isAssignableFrom(throwable.getClass())) {
        try {
          T res=trapper.trap((E)throwable);
          nextFuture.getTrigger().completed(res);
        }
 catch (        Exception ex) {
          nextFuture.getTrigger().failed(throwable);
        }
      }
    }
  }
);
  return nextFuture.getFuture();
}

Fixed version (ground truth):
@Override public <E extends Exception>Future<T> trap(Class<E> exceptionClass,ExceptionTrapper<E,T> trapper){
  FutureWithTrigger<T> nextFuture=new FutureWithTrigger<>();
  FutureWithTrigger.this.callbackLink.setCallbackTo(new Callback<T>(){
    @Override public void completed(    T result){
    }
    @Override public void failed(    Exception throwable){
      if (exceptionClass.isAssignableFrom(throwable.getClass())) {
        try {
          T res=trapper.trap((E)throwable);
          nextFuture.getTrigger().completed(res);
        }
 catch (        Exception ex) {
          nextFuture.getTrigger().failed(throwable);
        }
      }
 else {
        nextFuture.getTrigger().failed(throwable);
      }
    }
  }
);
  return nextFuture.getFuture();
}
Program: 36705
Project: 36705
Buggy source:
public void run() throws Exception {
  EventLoopGroup bossGroup=new NioEventLoopGroup(1);
  EventLoopGroup workerGroup=new NioEventLoopGroup();
  try {
    ServerBootstrap b=new ServerBootstrap();
    b.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).childHandler(new HttpStaticFileServerInitializer());
    b.bind(port).sync().channel().closeFuture().sync();
    System.out.println("String_Node_Str" + port + '.');
  }
  finally {
    bossGroup.shutdownGracefully();
    workerGroup.shutdownGracefully();
  }
}

Fixed version (ground truth):
public void run() throws Exception {
  EventLoopGroup bossGroup=new NioEventLoopGroup(1);
  EventLoopGroup workerGroup=new NioEventLoopGroup();
  try {
    ServerBootstrap b=new ServerBootstrap();
    b.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).childHandler(new HttpStaticFileServerInitializer());
    Channel ch=b.bind(port).sync().channel();
    System.out.println("String_Node_Str" + port + '.');
    ch.closeFuture().sync();
  }
  finally {
    bossGroup.shutdownGracefully();
    workerGroup.shutdownGracefully();
  }
}
Program: 36706
Project: 36706
Buggy source:
/** 
 * Parses out the HEADLINE element, which is a parse of the dateline if it exists. Assumes the position of vn is at a "DOC" tag
 */
private String parseHeadline(VTDNav vn) throws NavException {
  require(vn.matchElement(AgigaConstants.DOC));
  if (!vn.toElement(VTDNav.FIRST_CHILD,AgigaConstants.HEADLINE)) {
    log.finer("String_Node_Str");
    return null;
  }
  return vn.toString(vn.getText()).trim();
}

Fixed version (ground truth):
/** 
 * Parses out the HEADLINE element, which is a parse of the dateline if it exists. Assumes the position of vn is at a "DOC" tag
 */
private String parseHeadline(VTDNav vn) throws NavException {
  require(vn.matchElement(AgigaConstants.DOC));
  if (!vn.toElement(VTDNav.FIRST_CHILD,AgigaConstants.HEADLINE) || vn.getText() == -1) {
    log.finer("String_Node_Str");
    return null;
  }
  return vn.toString(vn.getText()).trim();
}
Program: 36707
Project: 36707
Buggy source:
/** 
 * Parses out the DATELINE element, which is a parse of the dateline if it exists. Assumes the position of vn is at a "DOC" tag
 */
private String parseDateline(VTDNav vn) throws NavException {
  require(vn.matchElement(AgigaConstants.DOC));
  if (!vn.toElement(VTDNav.FIRST_CHILD,AgigaConstants.DATELINE)) {
    log.finer("String_Node_Str");
    return null;
  }
  return vn.toString(vn.getText()).trim();
}

Fixed version (ground truth):
/** 
 * Parses out the DATELINE element, which is a parse of the dateline if it exists. Assumes the position of vn is at a "DOC" tag
 */
private String parseDateline(VTDNav vn) throws NavException {
  require(vn.matchElement(AgigaConstants.DOC));
  if (!vn.toElement(VTDNav.FIRST_CHILD,AgigaConstants.DATELINE) || vn.getText() == -1) {
    log.finer("String_Node_Str");
    return null;
  }
  return vn.toString(vn.getText()).trim();
}
Program: 36709
Project: 36709
Buggy source:
public String getParseText(){
  return parseText;
}

Fixed version (ground truth):
public String getParseText(){
  final String nbsp="String_Node_Str";
  final Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(parseText);
  int ptr=0;
  StringBuilder sb=null;
  while (m.find()) {
    if (sb == null)     sb=new StringBuilder();
    int s=m.start();
    int e=m.end();
    sb.append(parseText.substring(ptr,s));
    String mid=parseText.substring(s,e);
    int mid_space=mid.indexOf("String_Node_Str");
    sb.append(mid.substring(0,mid_space + 1));
    sb.append(mid.substring(mid_space + 1).replaceAll("String_Node_Str",nbsp));
    ptr=e;
  }
  if (sb == null)   return parseText;
 else {
    sb.append(parseText.substring(ptr));
    return sb.toString();
  }
}
Program: 36710
Project: 36710
Buggy source:
@Override public Uri getUri(){
  return UriUtilities.getUri(mContext,ProductTaskStateViewModel.Paths.PRODUCT_TASK_STATE);
}

Fixed version (ground truth):
@Override public Uri getUri(){
  return SampleUriUtilities.getUri(mContext,ProductTaskStateViewModel.Paths.PRODUCT_TASK_STATE);
}
Program: 36711
Project: 36711
Buggy source:
@Override public Uri getUri(){
  return UriUtilities.getUri(mContext,ProductViewModel.Paths.PRODUCT_VIEW_MODEL);
}

Fixed version (ground truth):
@Override public Uri getUri(){
  return SampleUriUtilities.getUri(mContext,ProductViewModel.Paths.PRODUCT_VIEW_MODEL);
}
Program: 36712
Project: 36712
Buggy source:
@Override protected void onExecuteTask(final Context context) throws Exception {
  final Uri uri=UriUtilities.getUri(SCHEME,AUTHORITY,Paths.PRODUCTS);
  final String url=uri.toString();
  final ProductResponse productResponse=getProductResponse(url);
  final Uri tableUri=UriUtilities.getUri(context,ProductTable.Paths.PRODUCT_TABLE);
  final ArrayList<ContentProviderOperation> contentProviderOperations=new ArrayList<ContentProviderOperation>();
  final ContentProviderOperation deleteContentProviderOperation=ContentProviderOperation.newDelete(tableUri).build();
  contentProviderOperations.add(deleteContentProviderOperation);
  final ArrayList<Product> products=productResponse.getProducts();
  for (  final Product product : products) {
    final ContentValues contentValues=ProductTable.getContentValues(product);
    final ContentProviderOperation insertContentProviderOperation=ContentProviderOperation.newInsert(tableUri).withValues(contentValues).build();
    contentProviderOperations.add(insertContentProviderOperation);
  }
  final Resources resources=context.getResources();
  final String authority=resources.getString(R.string.authority);
  final ContentResolver contentResolver=context.getContentResolver();
  contentResolver.applyBatch(authority,contentProviderOperations);
  final Uri modelViewUri=UriUtilities.getUri(context,ProductViewModel.Paths.PRODUCT_VIEW_MODEL);
  contentResolver.notifyChange(modelViewUri,null);
}

Fixed version (ground truth):
@Override protected void onExecuteTask(final Context context) throws Exception {
  final Uri uri=SampleUriUtilities.getUri(SCHEME,AUTHORITY,Paths.PRODUCTS);
  final String url=uri.toString();
  final ProductResponse productResponse=getProductResponse(url);
  final Uri tableUri=SampleUriUtilities.getUri(context,ProductTable.Paths.PRODUCT_TABLE);
  final ArrayList<ContentProviderOperation> contentProviderOperations=new ArrayList<ContentProviderOperation>();
  final ContentProviderOperation deleteContentProviderOperation=ContentProviderOperation.newDelete(tableUri).build();
  contentProviderOperations.add(deleteContentProviderOperation);
  final ArrayList<Product> products=productResponse.getProducts();
  for (  final Product product : products) {
    final ContentValues contentValues=ProductTable.getContentValues(product);
    final ContentProviderOperation insertContentProviderOperation=ContentProviderOperation.newInsert(tableUri).withValues(contentValues).build();
    contentProviderOperations.add(insertContentProviderOperation);
  }
  final Resources resources=context.getResources();
  final String authority=resources.getString(R.string.authority);
  final ContentResolver contentResolver=context.getContentResolver();
  contentResolver.applyBatch(authority,contentProviderOperations);
  final Uri modelViewUri=SampleUriUtilities.getUri(context,ProductViewModel.Paths.PRODUCT_VIEW_MODEL);
  contentResolver.notifyChange(modelViewUri,null);
}
Program: 36714
Project: 36714
Buggy source:
@Override public void onBlockPlacedBy(IBlockState state,@Nullable EntityLivingBase placer,ItemStack stack){
  if (placer != null && this instanceof ITrackKitReversible) {
    int dir=MathHelper.floor_double((double)((placer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
    ((ITrackKitReversible)this).setReversed(dir == 0 || dir == 1);
  }
  switchTrack(state,true);
  testPower(state);
  markBlockNeedsUpdate();
}

Fixed version (ground truth):
@Override public void onBlockPlacedBy(IBlockState state,@Nullable EntityLivingBase placer,ItemStack stack){
  if (placer != null && this instanceof ITrackKitReversible) {
    int dir=MathHelper.floor((double)((placer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
    ((ITrackKitReversible)this).setReversed(dir == 0 || dir == 1);
  }
  switchTrack(state,true);
  testPower(state);
  markBlockNeedsUpdate();
}
Program: 36715
Project: 36715
Buggy source:
public boolean createSignalBlock(SignalBlock other){
  if (other == this) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  printDebugPair("String_Node_Str",other.tile);
  locateTrack();
  other.locateTrack();
  WorldCoordinate myTrack=getTrackLocation();
  WorldCoordinate otherTrack=other.getTrackLocation();
  if (myTrack == null || otherTrack == null) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  TrackScanner.ScanResult scan=TrackScanner.scanStraightTrackSection(tile.getWorldObj(),myTrack.x,myTrack.y,myTrack.z,otherTrack.x,otherTrack.y,otherTrack.z);
  if (!scan.areConnected) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  addPairing(other.getCoords());
  other.addPairing(getCoords());
  endPairing();
  other.endPairing();
  trackScans.put(otherTrack,scan);
  printDebugPair("String_Node_Str",other.tile);
  return true;
}

Fixed version (ground truth):
public boolean createSignalBlock(SignalBlock other){
  if (other == this) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  printDebugPair("String_Node_Str",other.tile);
  Status myTrackStatus=getTrackStatus();
  Status otherTrackStatus=other.getTrackStatus();
  if (myTrackStatus == Status.INVALID || otherTrackStatus == Status.INVALID) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  WorldCoordinate myTrack=getTrackLocation();
  WorldCoordinate otherTrack=other.getTrackLocation();
  TrackScanner.ScanResult scan=TrackScanner.scanStraightTrackSection(tile.getWorldObj(),myTrack.x,myTrack.y,myTrack.z,otherTrack.x,otherTrack.y,otherTrack.z);
  if (!scan.areConnected) {
    printDebugPair("String_Node_Str",other.tile);
    return false;
  }
  addPairing(other.getCoords());
  other.addPairing(getCoords());
  endPairing();
  other.endPairing();
  trackScans.put(otherTrack,scan);
  printDebugPair("String_Node_Str",other.tile);
  return true;
}
Program: 36716
Project: 36716
Buggy source:
private TrackValidationStatus isSignalBlockValid(WorldCoordinate other){
  if (other == null)   return new TrackValidationStatus(true,"String_Node_Str");
  SignalBlock otherSignalBlock=getSignalAt(other);
  if (otherSignalBlock == null)   return new TrackValidationStatus(true,"String_Node_Str");
  WorldCoordinate myTrack=getTrackLocation();
  if (myTrack == null)   return new TrackValidationStatus(false,"String_Node_Str");
  Status otherTrackStatus=otherSignalBlock.getTrackStatus();
  if (otherTrackStatus == Status.INVALID)   return new TrackValidationStatus(false,"String_Node_Str");
  WorldCoordinate otherTrack=trackCache.get(other);
  if (otherTrackStatus == Status.UNKNOWN) {
    if (otherTrack == null)     return new TrackValidationStatus(true,"String_Node_Str");
  }
 else {
    otherTrack=otherSignalBlock.getTrackLocation();
    if (otherTrack != null)     trackCache.put(other,otherTrack);
  }
  if (otherTrack == null)   return new TrackValidationStatus(true,"String_Node_Str");
  TrackScanner.ScanResult scan=TrackScanner.scanStraightTrackSection(tile.getWorldObj(),myTrack.x,myTrack.y,myTrack.z,otherTrack.x,otherTrack.y,otherTrack.z);
  trackScans.put(otherTrack,scan);
  if (scan.verdict == TrackScanner.ScanResult.Verdict.VALID)   return new TrackValidationStatus(true,"String_Node_Str");
  if (scan.verdict == TrackScanner.ScanResult.Verdict.UNKNOWN)   return new TrackValidationStatus(true,"String_Node_Str");
  return new TrackValidationStatus(false,"String_Node_Str" + scan.verdict.name());
}

Fixed version (ground truth):
private TrackValidationStatus isSignalBlockValid(WorldCoordinate other){
  if (other == null)   return new TrackValidationStatus(true,"String_Node_Str");
  SignalBlock otherSignalBlock=getSignalAt(other);
  if (otherSignalBlock == null)   return new TrackValidationStatus(true,"String_Node_Str");
  Status trackStatus=getTrackStatus();
  if (trackStatus == Status.INVALID)   return new TrackValidationStatus(false,"String_Node_Str");
  Status otherTrackStatus=otherSignalBlock.getTrackStatus();
  if (otherTrackStatus == Status.INVALID)   return new TrackValidationStatus(false,"String_Node_Str");
  WorldCoordinate otherTrack=trackCache.get(other);
  if (otherTrackStatus == Status.UNKNOWN) {
    if (otherTrack == null)     return new TrackValidationStatus(true,"String_Node_Str");
  }
 else {
    otherTrack=otherSignalBlock.getTrackLocation();
    if (otherTrack != null)     trackCache.put(other,otherTrack);
  }
  if (otherTrack == null)   return new TrackValidationStatus(true,"String_Node_Str");
  WorldCoordinate myTrack=getTrackLocation();
  TrackScanner.ScanResult scan=TrackScanner.scanStraightTrackSection(tile.getWorldObj(),myTrack.x,myTrack.y,myTrack.z,otherTrack.x,otherTrack.y,otherTrack.z);
  trackScans.put(otherTrack,scan);
  if (scan.verdict == TrackScanner.ScanResult.Verdict.VALID)   return new TrackValidationStatus(true,"String_Node_Str");
  if (scan.verdict == TrackScanner.ScanResult.Verdict.UNKNOWN)   return new TrackValidationStatus(true,"String_Node_Str");
  return new TrackValidationStatus(false,"String_Node_Str" + scan.verdict.name());
}
Program: 36717
Project: 36717
Buggy source:
private Status getTrackStatus(){
  if (trackLocation == null)   return locateTrack();
  if (!tile.getWorldObj().blockExists(trackLocation.x,trackLocation.y,trackLocation.z))   return Status.UNKNOWN;
  if (!RailTools.isRailBlockAt(tile.getWorldObj(),trackLocation.x,trackLocation.y,trackLocation.z)) {
    trackLocation=null;
    return Status.INVALID;
  }
  return Status.VALID;
}

Fixed version (ground truth):
public Status getTrackStatus(){
  if (trackLocation == null)   return locateTrack();
  if (!tile.getWorldObj().blockExists(trackLocation.x,trackLocation.y,trackLocation.z))   return Status.UNKNOWN;
  if (!RailTools.isRailBlockAt(tile.getWorldObj(),trackLocation.x,trackLocation.y,trackLocation.z)) {
    trackLocation=null;
    return locateTrack();
  }
  return Status.VALID;
}
Program: 36718
Project: 36718
Buggy source:
public void cleanPairings(){
  boolean changed=pairings.removeAll(invalidPairings);
  invalidPairings.clear();
  if (changed)   SignalTools.packetBuilder.sendPairPacketUpdate(this);
}

Fixed version (ground truth):
public void cleanPairings(){
  if (invalidPairings.isEmpty())   return;
  boolean changed=pairings.removeAll(invalidPairings);
  invalidPairings.clear();
  if (changed)   SignalTools.packetBuilder.sendPairPacketUpdate(this);
}
Program: 36719
Project: 36719
Buggy source:
protected TileEntity getPairAt(WorldCoordinate coord){
  if (!pairings.contains(coord))   return null;
  if (coord.y < 0) {
    clearPairing(coord);
    return null;
  }
  int x=coord.x;
  int y=coord.y;
  int z=coord.z;
  if (!tile.getWorldObj().blockExists(x,y,z))   return null;
  TileEntity target=tile.getWorldObj().getTileEntity(x,y,z);
  if (isValidPair(coord,target))   return target;
  clearPairing(coord);
  return null;
}

Fixed version (ground truth):
protected TileEntity getPairAt(WorldCoordinate coord){
  if (!pairings.contains(coord))   return null;
  int x=coord.x;
  int y=coord.y;
  int z=coord.z;
  TileEntity cacheTarget=tileCache.get(coord);
  if (cacheTarget != null) {
    if (cacheTarget.isInvalid() || cacheTarget.xCoord != x || cacheTarget.yCoord != y || cacheTarget.zCoord != z) {
      tileCache.remove(coord);
    }
 else     if (isValidPair(coord,cacheTarget))     return cacheTarget;
  }
  if (y < 0) {
    clearPairing(coord);
    return null;
  }
  World world=tile.getWorldObj();
  if (!world.blockExists(x,y,z))   return null;
  Block block=world.getBlock(x,y,z);
  int meta=world.getBlockMetadata(x,y,z);
  if (!block.hasTileEntity(meta)) {
    pairingsToTest.add(coord);
    return null;
  }
  TileEntity target=world.getTileEntity(x,y,z);
  if (target != null && !isValidPair(coord,target)) {
    pairingsToTest.add(coord);
    return null;
  }
  if (target != null) {
    tileCache.put(coord,target);
  }
  return target;
}
Program: 36720
Project: 36720
Buggy source:
protected void validatePairings(){
  for (  WorldCoordinate coord : pairings) {
    getPairAt(coord);
  }
  cleanPairings();
}

Fixed version (ground truth):
protected void validatePairings(){
  if (!pairingsToTestNext.isEmpty()) {
    pairingsToTestNext.retainAll(pairings);
    for (    WorldCoordinate coord : pairingsToTestNext) {
      int x=coord.x;
      int y=coord.y;
      int z=coord.z;
      World world=tile.getWorldObj();
      if (!world.blockExists(x,y,z))       continue;
      Block block=world.getBlock(x,y,z);
      int meta=world.getBlockMetadata(x,y,z);
      if (!block.hasTileEntity(meta)) {
        clearPairing(coord);
        continue;
      }
      TileEntity target=world.getTileEntity(x,y,z);
      if (target != null && !isValidPair(coord,target))       clearPairing(coord);
    }
    pairingsToTestNext.clear();
  }
  cleanPairings();
  for (  WorldCoordinate coord : pairings) {
    getPairAt(coord);
  }
  pairingsToTestNext.addAll(pairingsToTest);
  pairingsToTest.clear();
}
Program: 36721
Project: 36721
Buggy source:
private void updateReceiver(){
  for (  WorldCoordinate recv : getPairs()) {
    SignalReceiver receiver=getReceiverAt(recv);
    if (receiver != null) {
      receiver.onControllerAspectChange(this,aspect);
    }
  }
  cleanPairings();
}

Fixed version (ground truth):
private void updateReceiver(){
  for (  WorldCoordinate recv : getPairs()) {
    SignalReceiver receiver=getReceiverAt(recv);
    if (receiver != null) {
      receiver.onControllerAspectChange(this,aspect);
    }
  }
}
Program: 36722
Project: 36722
Buggy source:
/** 
 * If you want to be able to draw power from the track, this function needs to be called once per tick. Server side only. Generally this means overriding the EnityMinecart.func_145821_a() function. You don't have to call this function if you don't care about drawing from tracks. <p> <blockquote><pre>  {@code protected void func_145821_a(int trackX, int trackY, int trackZ, double maxSpeed, double slopeAdjustement, Block trackBlock, int trackMeta)}{ super.func_145821_a(trackX, trackY, trackZ, maxSpeed, slopeAdjustement, trackBlock, trackMeta); chargeHandler.tickOnTrack(trackX, trackY, trackZ); } } </pre></blockquote>
 */
public void tickOnTrack(int trackX,int trackY,int trackZ){
  if (type == Type.USER && charge < capacity && clock % DRAW_INTERVAL == 0) {
    IElectricGrid track=RailTools.getTrackObjectAt(minecart.worldObj,trackX,trackY,trackZ,IElectricGrid.class);
    if (track != null) {
      charge+=track.getChargeHandler().removeCharge(capacity - charge);
      drewFromTrack=DRAW_INTERVAL * 4;
    }
  }
}

Fixed version (ground truth):
/** 
 * If you want to be able to draw power from the track, this function needs to be called once per tick. Server side only. Generally this means overriding the EnityMinecart.func_145821_a() function. You don't have to call this function if you don't care about drawing from tracks. <p> <blockquote><pre>  {@code protected void func_145821_a(int trackX, int trackY, int trackZ, double maxSpeed, double slopeAdjustement, Block trackBlock, int trackMeta)}{ super.func_145821_a(trackX, trackY, trackZ, maxSpeed, slopeAdjustement, trackBlock, trackMeta); chargeHandler.tickOnTrack(trackX, trackY, trackZ); } } </pre></blockquote>
 */
public void tickOnTrack(int trackX,int trackY,int trackZ){
  if (type == Type.USER && charge < capacity && clock % DRAW_INTERVAL == 0) {
    IElectricGrid track=RailTools.getTrackObjectAt(minecart.worldObj,trackX,trackY,trackZ,IElectricGrid.class);
    if (track != null) {
      double draw=track.getChargeHandler().removeCharge(capacity - charge);
      if (draw > 0.0)       drewFromTrack=DRAW_INTERVAL * 4;
      charge+=draw;
    }
  }
}
Program: 36723
Project: 36723
Buggy source:
public void setJudgmentsEnrichmentTagsPageSize(int judgmentsEnrichmentTagsPageSize){
  this.judgmentsEnrichmentTagsPageSize=judgmentsEnrichmentTagsPageSize;
}

Fixed version (ground truth):
@Value("String_Node_Str") public void setJudgmentsEnrichmentTagsPageSize(int judgmentsEnrichmentTagsPageSize){
  this.judgmentsEnrichmentTagsPageSize=judgmentsEnrichmentTagsPageSize;
}
Program: 36724
Project: 36724
Buggy source:
public String getFilename(){
  return filename;
}

Fixed version (ground truth):
/** 
 * Returns name of file
 */
String getFilename();
Program: 36725
Project: 36725
Buggy source:
public InputStream getInputStream(){
  return inputStream;
}

Fixed version (ground truth):
/** 
 * Returns input stream that contains file content
 */
InputStream getInputStream() throws IOException ;
Program: 36726
Project: 36726
Buggy source:
/** 
 * Extracts judgment content file from archive file. Looks in the given archiveFile for a file with a name (without extension) equal to judgmentSourceId. At the moment only zip archive files are supported.
 * @param archiveFile - archive file from which judgment content file can be extracted
 * @param judgmentSourceId - source id of judgment.
 * @return 
 * @throws IOException - when I/O error has occurred
 * @throws ImportException - when archive is of not supported type or it doesn't containproper judgment content file
 */
public InputStreamWithFilename extractJudgmentContent(File archiveFile,String judgmentSourceId) throws IOException {
  if (FilenameUtils.getExtension(archiveFile.getName()).equals("String_Node_Str")) {
    ZipInputStream inputStream=null;
    try {
      inputStream=new ZipInputStream(new FileInputStream(archiveFile));
      ZipEntry entry=inputStream.getNextEntry();
      while (true) {
        if (entry == null) {
          break;
        }
        if (FilenameUtils.getBaseName(entry.getName()).equals(judgmentSourceId)) {
          return new InputStreamWithFilename(inputStream,entry.getName());
        }
        entry=inputStream.getNextEntry();
      }
      throw new ImportException("String_Node_Str" + judgmentSourceId + "String_Node_Str"+ archiveFile.getName());
    }
 catch (    IOException|ImportException e) {
      if (inputStream != null) {
        inputStream.close();
      }
      throw e;
    }
  }
  throw new ImportException("String_Node_Str" + archiveFile.getName() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Extracts judgment content file from archive file. Looks in the given archiveFile for a file with a name (without extension) equal to judgmentSourceId. At the moment only zip archive files are supported.
 * @param archiveFile - archive file from which judgment content file can be extracted
 * @param judgmentSourceId - source id of judgment.
 * @return 
 * @throws IOException - when I/O error has occurred
 * @throws ImportException - when archive is of not supported type or it doesn't containproper judgment content file
 */
public InputStreamWithFilename extractJudgmentContent(File archiveFile,String judgmentSourceId) throws IOException {
  if (FilenameUtils.getExtension(archiveFile.getName()).equals("String_Node_Str")) {
    ZipFile file=null;
    file=new ZipFile(archiveFile);
    final Enumeration<? extends ZipEntry> entries=file.entries();
    while (entries.hasMoreElements()) {
      final ZipEntry entry=entries.nextElement();
      if (FilenameUtils.getBaseName(entry.getName()).equals(judgmentSourceId)) {
        return new ZipEntryBasedInputStreamWithFilename(file,entry);
      }
    }
    file.close();
    throw new ImportException("String_Node_Str" + judgmentSourceId + "String_Node_Str"+ archiveFile.getName());
  }
  throw new ImportException("String_Node_Str" + archiveFile.getName() + "String_Node_Str");
}
Program: 36727
Project: 36727
Buggy source:
@Bean public HighlightingParams judgmentsHighlightParams(){
  HighlightingParams params=new HighlightingParams();
  params.addParam(HighlightParams.SIMPLE_PRE,"String_Node_Str");
  params.addParam(HighlightParams.SIMPLE_POST,"String_Node_Str");
  params.addParam(HighlightParams.MERGE_CONTIGUOUS_FRAGMENTS,"String_Node_Str");
  HighlightingFieldParams contentFieldParams=new HighlightingFieldParams(JudgmentIndexField.CONTENT.getFieldName());
  contentFieldParams.addParam(HighlightParams.FRAGSIZE,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.SNIPPETS,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.ALTERNATE_FIELD,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.ALTERNATE_FIELD_LENGTH,"String_Node_Str");
  params.addFieldParams(contentFieldParams);
  return params;
}

Fixed version (ground truth):
@Bean public HighlightingParams judgmentsHighlightParams(){
  HighlightingParams params=new HighlightingParams();
  params.addParam(HighlightParams.SIMPLE_PRE,"String_Node_Str");
  params.addParam(HighlightParams.SIMPLE_POST,"String_Node_Str");
  params.addParam(HighlightParams.MERGE_CONTIGUOUS_FRAGMENTS,"String_Node_Str");
  params.addParam(HighlightParams.FIELD_MATCH,"String_Node_Str");
  HighlightingFieldParams contentFieldParams=new HighlightingFieldParams(JudgmentIndexField.CONTENT.getFieldName());
  contentFieldParams.addParam(HighlightParams.FRAGSIZE,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.SNIPPETS,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.ALTERNATE_FIELD,"String_Node_Str");
  contentFieldParams.addParam(HighlightParams.ALTERNATE_FIELD_LENGTH,"String_Node_Str");
  params.addFieldParams(contentFieldParams);
  return params;
}
Program: 36728
Project: 36728
Buggy source:
private SolrInputDocument fetchScJudgmentDoc(){
  SolrInputDocument doc=new SolrInputDocument();
  doc.addField("String_Node_Str",UUID.randomUUID());
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  return doc;
}

Fixed version (ground truth):
private SolrInputDocument fetchScJudgmentDoc(){
  SolrInputDocument doc=new SolrInputDocument();
  doc.addField("String_Node_Str",UUID.randomUUID());
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  doc.addField("String_Node_Str","String_Node_Str");
  return doc;
}
Program: 36729
Project: 36729
Buggy source:
private void translateSupremeCourt(SolrDocument document,JudgmentSearchResult result){
  String personnelType=fieldFetcher.fetchValue(document,JudgmentIndexField.SC_PERSONNEL_TYPE);
  result.setPersonnelType(personnelType);
  List<Pair<String,List<String>>> chambers=fieldFetcher.fetchValuesWithAttributes(document,JudgmentIndexField.SC_CHAMBER);
  List<SupremeCourtChamberResult> chambersResult=Lists.newLinkedList();
  chambers.forEach(x -> chambersResult.add(new SupremeCourtChamberResult(Integer.valueOf(x.getLeft()),x.getRight().get(0))));
  result.setCourtChambers(chambersResult);
  Integer divisionId=fieldFetcher.fetchIntValue(document,JudgmentIndexField.SC_DIVISION_ID);
  String divisionName=fieldFetcher.fetchValue(document,JudgmentIndexField.SC_DIVISION_NAME);
  result.setCourtChamberDivisionId(divisionId);
  result.setCourtChamberDivisionName(divisionName);
}

Fixed version (ground truth):
private void translateSupremeCourt(SolrDocument document,JudgmentSearchResult result){
  String personnelType=fieldFetcher.fetchValue(document,JudgmentIndexField.SC_PERSONNEL_TYPE);
  result.setPersonnelType(personnelType);
  List<Pair<String,List<String>>> chambers=fieldFetcher.fetchValuesWithAttributes(document,JudgmentIndexField.SC_CHAMBER);
  List<SupremeCourtChamberResult> chambersResult=Lists.newLinkedList();
  chambers.stream().filter(x -> x.getRight().size() > 0).forEach(x -> chambersResult.add(new SupremeCourtChamberResult(Integer.parseInt(x.getLeft()),x.getRight().get(0))));
  result.setCourtChambers(chambersResult);
  Integer divisionId=fieldFetcher.fetchIntValue(document,JudgmentIndexField.SC_DIVISION_ID);
  String divisionName=fieldFetcher.fetchValue(document,JudgmentIndexField.SC_DIVISION_NAME);
  result.setCourtChamberDivisionId(divisionId);
  result.setCourtChamberDivisionName(divisionName);
}
Program: 36730
Project: 36730
Buggy source:
@PostConstruct public void init(){
  judgmentIndexFieldsFillers=new HashMap<>();
  judgmentIndexFieldsFillers.put(CommonCourtJudgment.class,ccJudgmentIndexFieldsFillerProcessor);
}

Fixed version (ground truth):
@PostConstruct public void init(){
  judgmentIndexFieldsFillers=new HashMap<>();
  judgmentIndexFieldsFillers.put(CommonCourtJudgment.class,ccJudgmentIndexFieldsFiller);
}
Program: 36731
Project: 36731
Buggy source:
@SuppressWarnings("String_Node_Str") private void fillJudgmentFields(SolrInputDocument doc,Judgment item){
  if (judgmentIndexFieldsFillers.containsKey(item.getClass())) {
    JudgmentIndexFieldsFiller<Judgment> judgmentSpecificProcessor=(JudgmentIndexFieldsFiller<Judgment>)judgmentIndexFieldsFillers.get(item.getClass());
    judgmentSpecificProcessor.fillFields(doc,item);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void fillJudgmentFields(SolrInputDocument doc,Judgment item){
  if (judgmentIndexFieldsFillers.containsKey(item.getClass())) {
    JudgmentIndexFieldsFiller<Judgment> judgmentSpecificProcessor=(JudgmentIndexFieldsFiller<Judgment>)judgmentIndexFieldsFillers.get(item.getClass());
    judgmentSpecificProcessor.fillFields(doc,item);
  }
 else {
    throw new RuntimeException("String_Node_Str" + item.getClass());
  }
}
Program: 36732
Project: 36732
Buggy source:
@Override public Judgment read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {
  if (judgments.isEmpty()) {
    judgments=Lists.newLinkedList(judgmentRepository.findAllToIndex(new PageRequest(pageNo,pageSize)).getContent());
    if (judgments.isEmpty()) {
      return null;
    }
    log.debug("String_Node_Str",judgments.size());
    pageNo++;
  }
  Judgment commonCourtJudgment=judgments.poll();
  return commonCourtJudgment;
}

Fixed version (ground truth):
@Override public Judgment read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {
  if (judgments.isEmpty() && !allRead) {
    judgments=Lists.newLinkedList(judgmentRepository.findAllToIndex(new PageRequest(0,pageSize)).getContent());
    if (judgments.size() < pageSize) {
      allRead=true;
    }
    if (judgments.isEmpty()) {
      return null;
    }
    log.debug("String_Node_Str",judgments.size());
  }
  Judgment commonCourtJudgment=judgments.poll();
  return commonCourtJudgment;
}
Program: 36733
Project: 36733
Buggy source:
@Override public void open(ExecutionContext executionContext) throws ItemStreamException {
  judgments=Lists.newLinkedList();
}

Fixed version (ground truth):
@Override public void open(ExecutionContext executionContext) throws ItemStreamException {
  judgments=Lists.newLinkedList();
  allRead=false;
}
Program: 36734
Project: 36734
Buggy source:
@Before public void setUp(){
  judgmentIndexingProcessor.setCcJudgmentRepository(judgmentRepository);
  judgmentIndexingProcessor.setCcJudgmentIndexingProcessor(ccJudgmentIndexFieldsFiller);
  judgmentIndexingProcessor.init();
}

Fixed version (ground truth):
@Before public void setUp(){
  judgmentIndexingProcessor.setCcJudgmentRepository(judgmentRepository);
  judgmentIndexingProcessor.setCcJudgmentIndexFieldsFiller(ccJudgmentIndexFieldsFiller);
  judgmentIndexingProcessor.init();
}
Program: 36736
Project: 36736
Buggy source:
@Before public void setUp(){
  judgmentIndexingReader.setJudgmentRepository(judgmentRepository);
}

Fixed version (ground truth):
@Before public void setUp(){
  judgmentIndexingReader.setJudgmentRepository(judgmentRepository);
  judgmentIndexingReader.setPageSize(2);
}
Program: 36737
Project: 36737
Buggy source:
/** 
 * Build and return the OpsLogger corresponding to the configuration provided.
 * @param < T > LogMessage enum of all possible logger objects.
 * @return ready to use OpsLogger
 * @throws IOException FIXME: not currently thrown, may be for future OpsLogger back ends.
 */
public <T extends Enum<T> & LogMessage>OpsLogger<T> build() throws IOException {
  Supplier<Map<String,String>> correlationIdSupplier=this.correlationIdSupplier.orElse(EMPTY_CORRELATION_ID_SUPPLIER);
  Consumer<Throwable> errorHandler=this.errorHandler.orElse(DEFAULT_ERROR_HANDLER);
  if (async) {
    AsyncOpsLogger.Destination<T> destination=configureAsyncDestination();
    return new AsyncOpsLogger<>(Clock.systemUTC(),correlationIdSupplier,destination,errorHandler,new LinkedTransferQueue<>(),new AsyncExecutor(Executors.defaultThreadFactory()));
  }
  BasicOpsLogger.Destination<T> destination=configureBasicDestination();
  return new BasicOpsLogger<>(Clock.systemUTC(),correlationIdSupplier,destination,new ReentrantLock(),errorHandler);
}

Fixed version (ground truth):
/** 
 * Build and return the OpsLogger corresponding to the configuration provided.
 * @param < T > LogMessage enum of all possible logger objects.
 * @return ready to use OpsLogger
 * @throws IOException if a problem occurs creating parent directories for log files and/or stack traces
 */
public <T extends Enum<T> & LogMessage>OpsLogger<T> build() throws IOException {
  Supplier<Map<String,String>> correlationIdSupplier=this.correlationIdSupplier.orElse(EMPTY_CORRELATION_ID_SUPPLIER);
  Consumer<Throwable> errorHandler=this.errorHandler.orElse(DEFAULT_ERROR_HANDLER);
  if (async) {
    AsyncOpsLogger.Destination<T> destination=configureAsyncDestination();
    return new AsyncOpsLogger<>(Clock.systemUTC(),correlationIdSupplier,destination,errorHandler,new LinkedTransferQueue<>(),new AsyncExecutor(Executors.defaultThreadFactory()));
  }
  BasicOpsLogger.Destination<T> destination=configureBasicDestination();
  return new BasicOpsLogger<>(Clock.systemUTC(),correlationIdSupplier,destination,new ReentrantLock(),errorHandler);
}
Program: 36738
Project: 36738
Buggy source:
public OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler){
  errorHandler=Optional.of(handler);
  return this;
}

Fixed version (ground truth):
public OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler){
  errorHandler=Optional.ofNullable(handler);
  return this;
}
Program: 36739
Project: 36739
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  BaseApplication.inject(this);
  bus.register(this);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  bus.register(this);
}
Program: 36740
Project: 36740
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  BaseApplication.inject(this);
  bus.register(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  bus.register(this);
}
Program: 36741
Project: 36741
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  detector.startMonitoring();
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Region region=persistentState.getSelectedRegion();
  if (region != null) {
    detector.startMonitoring(region);
  }
}
Program: 36742
Project: 36742
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  dao.open();
  final ActionBar actionBar=getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  mSectionsPagerAdapter=new SectionsPagerAdapter(getFragmentManager());
  mViewPager=(ViewPager)findViewById(R.id.pager);
  mViewPager.setAdapter(mSectionsPagerAdapter);
  mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
    @Override public void onPageSelected(    int position){
      actionBar.setSelectedNavigationItem(position);
    }
  }
);
  for (int i=0; i < mSectionsPagerAdapter.getCount(); i++) {
    actionBar.addTab(actionBar.newTab().setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  dao.open();
  final ActionBar actionBar=getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  mSectionsPagerAdapter=new SectionsPagerAdapter(getFragmentManager());
  mViewPager=(ViewPager)findViewById(R.id.pager);
  mViewPager.setAdapter(mSectionsPagerAdapter);
  mViewPager.setOffscreenPageLimit(5);
  mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
    @Override public void onPageSelected(    int position){
      actionBar.setSelectedNavigationItem(position);
    }
  }
);
  for (int i=0; i < mSectionsPagerAdapter.getCount(); i++) {
    actionBar.addTab(actionBar.newTab().setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
  }
}
Program: 36743
Project: 36743
Buggy source:
@Override public Fragment getItem(int position){
switch (position) {
case 0:
    return ScanFragment.newInstance();
case 1:
  return BeaconDataFragment.newInstance();
case 2:
return RegionLogFragment.newInstance();
case 3:
return NotificationFragment.newInstance();
case 4:
return IndoorLocationFragment.newInstance();
default :
throw new RuntimeException("String_Node_Str" + position);
}
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
switch (position) {
case 0:
    return ScanFragment.newInstance();
case 1:
  return BeaconDataFragment.newInstance();
case 2:
return RegionLogFragment.newInstance();
case 3:
return NotificationFragment.newInstance();
case 4:
return LocationFragment.newInstance();
default :
throw new RuntimeException("String_Node_Str" + position);
}
}
Program: 36744
Project: 36744
Buggy source:
@Subscribe public void fullScanRequested(RequestFullScanEvent event){
  if (scanner.isFullScanning())   return;
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.stopMonitoring();
      scanner.stopRanging();
      scanner.startFullScan();
    }
  }
);
}

Fixed version (ground truth):
@Subscribe public void fullScanRequested(RequestFullScanEvent event){
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.startFullScan();
    }
  }
);
}
Program: 36745
Project: 36745
Buggy source:
@Override protected void onStart(){
  super.onStart();
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.setBackgroundMode(false);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  bus.post(new RequestFullScanEvent());
}
Program: 36746
Project: 36746
Buggy source:
@Override public void serviceReady(){
  scanner.stopFullScan();
  scanner.startRanging();
  scanner.startMonitoring();
}

Fixed version (ground truth):
@Override public void serviceReady(){
  scanner.stopFullScan();
}
Program: 36747
Project: 36747
Buggy source:
@Subscribe public void beaconScanRequested(RequestBeaconScanEvent event){
  if (scanner.isRangingSingleBeacon())   return;
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.stopFullScan();
      scanner.startRanging();
      scanner.startMonitoring();
    }
  }
);
}

Fixed version (ground truth):
@Subscribe public void beaconScanRequested(final RequestBeaconScanEvent event){
  if (event.getRegion() == null)   return;
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.startRanging(event.getRegion());
      scanner.startMonitoring(event.getRegion());
    }
  }
);
}
Program: 36748
Project: 36748
Buggy source:
@Override public void onStop(){
  super.onStop();
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.stopRanging();
      scanner.stopFullScan();
      scanner.setBackgroundMode(true);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onStop(){
  super.onStop();
  scanner.connect(new BeaconController.ServiceReadyCallback(){
    @Override public void serviceReady(){
      scanner.setBackgroundMode(true);
    }
  }
);
}
Program: 36749
Project: 36749
Buggy source:
public Cursor getHistory(Region region){
  assertAcccess();
  if (region == null)   return null;
  Cursor c=db.query(false,Database.TABLE_REGIONS,Database.ALL_COLUMNS,Database.COLUMN_UUID + "String_Node_Str" + Database.COLUMN_MAJOR+ "String_Node_Str"+ Database.COLUMN_MINOR+ "String_Node_Str",new String[]{region.getId1().toString(),Integer.toString(region.getId2().toInt()),Integer.toString(region.getId3().toInt())},null,null,null,null);
  c.setNotificationUri(context.getContentResolver(),Uri.parse(TABLE_URI));
  return c;
}

Fixed version (ground truth):
public Cursor getHistory(Region region){
  assertAcccess();
  if (region == null)   return null;
  Cursor c=db.query(false,Database.TABLE_REGIONS,Database.ALL_COLUMNS,Database.COLUMN_UUID + "String_Node_Str" + Database.COLUMN_MAJOR+ "String_Node_Str"+ Database.COLUMN_MINOR+ "String_Node_Str",new String[]{region.getId1().toString(),region.getId2().toString(),region.getId3().toString()},null,null,null,null);
  c.setNotificationUri(context.getContentResolver(),Uri.parse(TABLE_URI));
  return c;
}
Program: 36750
Project: 36750
Buggy source:
public void startFullScan(){
  assertServiceReady();
  if (rangingStarted)   throw new RuntimeException("String_Node_Str");
  if (fullScanStarted)   return;
  beaconManager.setRangeNotifier(new RangeNotifier(){
    @Override public void didRangeBeaconsInRegion(    Collection<Beacon> iBeacons,    Region region){
      postOnMainThread(new FullScanCompleteEvent(iBeacons));
    }
  }
);
  try {
    beaconManager.startRangingBeaconsInRegion(FULL_SCAN_REGION);
    fullScanStarted=true;
    Log.i(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void startFullScan(){
  assertServiceReady();
  if (beaconManager.getRangedRegions().contains(FULL_SCAN_REGION))   return;
  for (  Region r : beaconManager.getRangedRegions()) {
    stopRanging(r);
  }
  beaconManager.setRangeNotifier(new RangeNotifier(){
    @Override public void didRangeBeaconsInRegion(    Collection<Beacon> iBeacons,    Region region){
      postOnMainThread(new FullScanCompleteEvent(iBeacons));
    }
  }
);
  try {
    beaconManager.startRangingBeaconsInRegion(FULL_SCAN_REGION);
    Log.i(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 36751
Project: 36751
Buggy source:
public void stopMonitoring(){
  if (!monitorStarted)   return;
  try {
    beaconManager.stopMonitoringBeaconsInRegion(persistentState.getSelectedRegion());
    monitorStarted=false;
    Log.d(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void stopMonitoring(Region region){
  try {
    beaconManager.stopMonitoringBeaconsInRegion(region);
    Log.d(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 36752
Project: 36752
Buggy source:
public void startMonitoring(){
  assertServiceReady();
  if (monitorStarted)   return;
  beaconManager.setMonitorNotifier(new MonitorNotifier(){
    @Override public void didEnterRegion(    final Region region){
      Log.d(TAG,"String_Node_Str" + region);
      Toast.makeText(context,"String_Node_Str" + region.getUniqueId(),Toast.LENGTH_SHORT).show();
      dao.execute(new Runnable(){
        @Override public void run(){
          currentRegion=dao.enterRegion(region);
        }
      }
);
    }
    @Override public void didExitRegion(    Region region){
      Log.d(TAG,"String_Node_Str" + region);
      Toast.makeText(context,"String_Node_Str" + region.getUniqueId(),Toast.LENGTH_SHORT).show();
      dao.execute(new Runnable(){
        @Override public void run(){
          dao.exitRegion(currentRegion);
        }
      }
);
    }
    @Override public void didDetermineStateForRegion(    int i,    Region region){
    }
  }
);
  try {
    Region selectedRegion=persistentState.getSelectedRegion();
    if (selectedRegion == null)     return;
    beaconManager.startMonitoringBeaconsInRegion(selectedRegion);
    monitorStarted=true;
    Log.i(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void startMonitoring(Region region){
  assertServiceReady();
  if (region.getId1() == null || region.getId2() == null || region.getId3() == null) {
    return;
  }
  if (beaconManager.getMonitoredRegions().contains(region))   return;
  for (  Region r : beaconManager.getMonitoredRegions()) {
    stopMonitoring(r);
  }
  beaconManager.setMonitorNotifier(new MonitorNotifier(){
    @Override public void didEnterRegion(    final Region region){
      Log.d(TAG,"String_Node_Str" + region);
      Toast.makeText(context,"String_Node_Str" + region.getUniqueId(),Toast.LENGTH_SHORT).show();
      dao.execute(new Runnable(){
        @Override public void run(){
          currentRegion=dao.enterRegion(region);
        }
      }
);
    }
    @Override public void didExitRegion(    Region region){
      Log.d(TAG,"String_Node_Str" + region);
      Toast.makeText(context,"String_Node_Str" + region.getUniqueId(),Toast.LENGTH_SHORT).show();
      dao.execute(new Runnable(){
        @Override public void run(){
          dao.exitRegion(currentRegion);
        }
      }
);
    }
    @Override public void didDetermineStateForRegion(    int i,    Region region){
    }
  }
);
  try {
    beaconManager.startMonitoringBeaconsInRegion(region);
    Log.i(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}