nus-yam/ex-repair huggingface dataset:
Program: 80530
Project: 80530
Buggy source:
public NutResource get_material(String media_id){
  String url=String.format("String_Node_Str",getAccessToken());
  Request req=Request.create(url,METHOD.POST);
  req.getParams().put("String_Node_Str",media_id);
  final Response resp=Sender.create(req).send();
  if (!resp.isOK())   throw new IllegalStateException("String_Node_Str" + resp.getStatus());
  String disposition=resp.getHeader().get("String_Node_Str");
  return new WxResource(disposition,resp.getStream());
}

Fixed version (ground truth):
public NutResource get_material(String media_id){
  String url=String.format("String_Node_Str",getAccessToken());
  Request req=Request.create(url,METHOD.POST);
  NutMap body=new NutMap();
  body.put("String_Node_Str",media_id);
  req.setData(Json.toJson(body));
  final Response resp=Sender.create(req).send();
  if (!resp.isOK())   throw new IllegalStateException("String_Node_Str" + resp.getStatus());
  String disposition=resp.getHeader().get("String_Node_Str");
  return new WxResource(disposition,resp.getStream());
}
Program: 80531
Project: 80531
Buggy source:
public WxResp add_news(WxArticle... news){
  return postJson("String_Node_Str",new NutMap().put("String_Node_Str",Arrays.asList(news)));
}

Fixed version (ground truth):
public WxResp add_news(WxMassArticle... news){
  return postJson("String_Node_Str","String_Node_Str",Arrays.asList(news));
}
Program: 80532
Project: 80532
Buggy source:
WxResp add_news(WxArticle... news);

Fixed version (ground truth):
WxResp add_news(WxMassArticle... news);
Program: 80533
Project: 80533
Buggy source:
/** 
 * Test that Share Quota can be set, but only to allowable values.
 * @throws StorageException 
 * @throws URISyntaxException 
 */
@Test public void testCloudFileShareQuota() throws StorageException, URISyntaxException {
  this.share.createIfNotExists();
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  int shareQuota=FileConstants.MAX_SHARE_QUOTA;
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  shareQuota=8;
  this.share.getProperties().setShareQuota(shareQuota);
  this.share.uploadProperties();
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  this.share.delete();
  shareQuota=16;
  this.share=FileTestHelper.getRandomShareReference();
  this.share.getProperties().setShareQuota(shareQuota);
  this.share.create();
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  try {
    shareQuota=FileConstants.MAX_SHARE_QUOTA + 1;
    this.share.getProperties().setShareQuota(shareQuota);
    fail();
  }
 catch (  IllegalArgumentException e) {
    assertEquals(String.format(SR.PARAMETER_NOT_IN_RANGE,"String_Node_Str",1,FileConstants.MAX_SHARE_QUOTA),e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test that Share Quota can be set, but only to allowable values.
 * @throws StorageException 
 * @throws URISyntaxException 
 */
@Test public void testCloudFileShareQuota() throws StorageException, URISyntaxException {
  this.share.createIfNotExists();
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  int shareQuota=FileConstants.MAX_SHARE_QUOTA;
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  shareQuota=8;
  this.share.getProperties().setShareQuota(shareQuota);
  this.share.uploadProperties();
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  this.share.delete();
  shareQuota=16;
  this.share=FileTestHelper.getRandomShareReference();
  this.share.getProperties().setShareQuota(shareQuota);
  this.share.create();
  assertNotNull(this.share.getProperties().getShareQuota());
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  this.share.downloadAttributes();
  assertNotNull(this.share.getProperties().getShareQuota());
  assertEquals(shareQuota,this.share.getProperties().getShareQuota().intValue());
  try {
    shareQuota=FileConstants.MAX_SHARE_QUOTA + 1;
    this.share.getProperties().setShareQuota(shareQuota);
    fail();
  }
 catch (  IllegalArgumentException e) {
    assertEquals(String.format(SR.PARAMETER_NOT_IN_RANGE,"String_Node_Str",1,FileConstants.MAX_SHARE_QUOTA),e.getMessage());
  }
}
Program: 80537
Project: 80537
Buggy source:
/** 
 * Gets the FileShareAttributes from the given request.
 * @param request the request to get attributes from
 * @param usePathStyleUris a value indicating if the account is using pathSytleUris
 * @return the FileShareAttributes from the given request.
 * @throws StorageException
 */
public static FileShareAttributes getFileShareAttributes(final HttpURLConnection request,final boolean usePathStyleUris) throws StorageException {
  final FileShareAttributes shareAttributes=new FileShareAttributes();
  URI tempURI;
  try {
    tempURI=PathUtility.stripSingleURIQueryAndFragment(request.getURL().toURI());
  }
 catch (  final URISyntaxException e) {
    final StorageException wrappedUnexpectedException=Utility.generateNewUnexpectedStorageException(e);
    throw wrappedUnexpectedException;
  }
  shareAttributes.setName(PathUtility.getShareNameFromUri(tempURI,usePathStyleUris));
  final FileShareProperties shareProperties=shareAttributes.getProperties();
  shareProperties.setEtag(BaseResponse.getEtag(request));
  shareProperties.setShareQuota(parseShareQuota(request));
  shareProperties.setLastModified(new Date(request.getLastModified()));
  shareAttributes.setMetadata(getMetadata(request));
  return shareAttributes;
}

Fixed version (ground truth):
/** 
 * Gets the FileShareAttributes from the given request.
 * @param request the request to get attributes from
 * @param usePathStyleUris a value indicating if the account is using pathSytleUris
 * @return the FileShareAttributes from the given request.
 * @throws StorageException
 */
public static FileShareAttributes getFileShareAttributes(final HttpURLConnection request,final boolean usePathStyleUris) throws StorageException {
  final FileShareAttributes shareAttributes=new FileShareAttributes();
  final FileShareProperties shareProperties=shareAttributes.getProperties();
  shareProperties.setEtag(BaseResponse.getEtag(request));
  shareProperties.setShareQuota(parseShareQuota(request));
  shareProperties.setLastModified(new Date(request.getLastModified()));
  shareAttributes.setMetadata(getMetadata(request));
  return shareAttributes;
}
Program: 80538
Project: 80538
Buggy source:
@Override public CartItemInfo addItem(ProductInfo productInfo){
synchronized (LOCK) {
    CartItemInfo cartItemInfo=createCartItemInfo(productInfo);
    CartItem map=mapToCartItem(cartItemInfo);
    if (StringUtils.isEmpty(cartId)) {
      cartId=StringUtils.strip(cartRepository.create(map),"String_Node_Str");
    }
 else {
      cartRepository.add(cartId,map);
    }
    return cartItemInfo;
  }
}

Fixed version (ground truth):
@Override public CartItemInfo addItem(ProductInfo productInfo){
synchronized (lock) {
    CartItemInfo cartItemInfo=createCartItemInfo(productInfo);
    CartItem map=mapToCartItem(cartItemInfo);
    if (StringUtils.isEmpty(cartId)) {
      cartId=StringUtils.strip(cartRepository.create(map),"String_Node_Str");
    }
 else {
      cartRepository.add(cartId,map);
    }
    return cartItemInfo;
  }
}
Program: 80539
Project: 80539
Buggy source:
@Override public void removeItem(CartItemInfo item){
synchronized (LOCK) {
    cartRepository.removeFromCart(cartId,item.getUuid());
  }
}

Fixed version (ground truth):
@Override public void removeItem(CartItemInfo item){
synchronized (lock) {
    cartRepository.removeFromCart(cartId,item.getUuid());
  }
}
Program: 80540
Project: 80540
Buggy source:
@Override public List<CartItemInfo> getAll(){
synchronized (LOCK) {
    return getItems();
  }
}

Fixed version (ground truth):
@Override public List<CartItemInfo> getAll(){
synchronized (lock) {
    return getItems();
  }
}
Program: 80541
Project: 80541
Buggy source:
@Override public boolean isEmpty(){
synchronized (LOCK) {
    return getItems().isEmpty();
  }
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
synchronized (lock) {
    return getItems().isEmpty();
  }
}
Program: 80542
Project: 80542
Buggy source:
@Override public void clearAll(){
synchronized (LOCK) {
    cartRepository.clear(cartId);
    logger.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void clearAll(){
synchronized (lock) {
    cartRepository.clear(cartId);
    logger.info("String_Node_Str");
  }
}
Program: 80543
Project: 80543
Buggy source:
@Override public void clear(){
synchronized (lock) {
    cartRepository.clear(cartId);
    logger.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void clear(){
synchronized (lock) {
    if (StringUtils.isNotEmpty(cartId)) {
      cartRepository.clear(cartId);
      logger.info("String_Node_Str");
    }
  }
}
Program: 80544
Project: 80544
Buggy source:
@Override public void clearAll(){
synchronized (LOCK) {
    getItems().clear();
    logger.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void clearAll(){
synchronized (LOCK) {
    cartRepository.clear(cartId);
    logger.info("String_Node_Str");
  }
}
Program: 80545
Project: 80545
Buggy source:
private Component cartView(){
  ListView<CartItemInfo> cartView=new ListView<CartItemInfo>("String_Node_Str",cartListModel()){
    @Override protected void populateItem(    ListItem<CartItemInfo> item){
      WebMarkupContainer cartItem=new WebMarkupContainer("String_Node_Str");
      cartItem.add(new Label("String_Node_Str",new PropertyModel<String>(item.getModel(),"String_Node_Str")));
      cartItem.add(new IndicatingAjaxLink<Void>("String_Node_Str"){
        @Override public void onClick(        AjaxRequestTarget target){
          send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(item.getModel().getObject(),target));
        }
      }
);
      cartItem.add(new Label("String_Node_Str",new PriceModel(new PropertyModel<>(item.getModel(),"String_Node_Str"))));
      item.add(cartItem);
    }
  }
;
  cartView.setOutputMarkupId(true);
  return cartView;
}

Fixed version (ground truth):
private Component cartView(){
  cartView=new ListView<CartItemInfo>("String_Node_Str",cartListModel()){
    @Override protected void populateItem(    ListItem<CartItemInfo> item){
      WebMarkupContainer cartItem=new WebMarkupContainer("String_Node_Str");
      cartItem.add(new Label("String_Node_Str",new PropertyModel<String>(item.getModel(),"String_Node_Str")));
      cartItem.add(new IndicatingAjaxLink<Void>("String_Node_Str"){
        @Override public void onClick(        AjaxRequestTarget target){
          IModel<CartItemInfo> model=item.getModel();
          send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(model.getObject(),target));
        }
      }
);
      cartItem.add(new Label("String_Node_Str",new PriceModel(new PropertyModel<>(item.getModel(),"String_Node_Str"))));
      item.add(cartItem);
    }
  }
;
  cartView.setReuseItems(false);
  cartView.setOutputMarkupId(true);
  return cartView;
}
Program: 80546
Project: 80546
Buggy source:
@Override public void onClick(AjaxRequestTarget target){
  send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(item.getModel().getObject(),target));
}

Fixed version (ground truth):
@Override public void onClick(AjaxRequestTarget target){
  IModel<CartItemInfo> model=item.getModel();
  send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(model.getObject(),target));
}
Program: 80547
Project: 80547
Buggy source:
@Override protected void populateItem(ListItem<CartItemInfo> item){
  WebMarkupContainer cartItem=new WebMarkupContainer("String_Node_Str");
  cartItem.add(new Label("String_Node_Str",new PropertyModel<String>(item.getModel(),"String_Node_Str")));
  cartItem.add(new IndicatingAjaxLink<Void>("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(item.getModel().getObject(),target));
    }
  }
);
  cartItem.add(new Label("String_Node_Str",new PriceModel(new PropertyModel<>(item.getModel(),"String_Node_Str"))));
  item.add(cartItem);
}

Fixed version (ground truth):
@Override protected void populateItem(ListItem<CartItemInfo> item){
  WebMarkupContainer cartItem=new WebMarkupContainer("String_Node_Str");
  cartItem.add(new Label("String_Node_Str",new PropertyModel<String>(item.getModel(),"String_Node_Str")));
  cartItem.add(new IndicatingAjaxLink<Void>("String_Node_Str"){
    @Override public void onClick(    AjaxRequestTarget target){
      IModel<CartItemInfo> model=item.getModel();
      send(CartPanel.this,Broadcast.BREADTH,new RemoveFromCartEvent(model.getObject(),target));
    }
  }
);
  cartItem.add(new Label("String_Node_Str",new PriceModel(new PropertyModel<>(item.getModel(),"String_Node_Str"))));
  item.add(cartItem);
}
Program: 80548
Project: 80548
Buggy source:
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof CartChangeEvent) {
    ((CartChangeEvent)event.getPayload()).getTarget().add(this);
  }
}

Fixed version (ground truth):
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof CartChangeEvent) {
    cartView.getModel().detach();
    ((CartChangeEvent)event.getPayload()).getTarget().add(this);
  }
}
Program: 80549
Project: 80549
Buggy source:
public void setType(ProductType type){
  this.type=type;
}

Fixed version (ground truth):
public void setType(String type){
  this.type=type;
}
Program: 80550
Project: 80550
Buggy source:
public ProductType getType(){
  return type;
}

Fixed version (ground truth):
public String getType(){
  return type;
}
Program: 80551
Project: 80551
Buggy source:
public static void agentmain(String agentArguments,Instrumentation instrumentation){
  scheduler.scheduleAtFixedRate(new MemoryLoggingTask(),0,1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public static void agentmain(String agentArguments,Instrumentation instrumentation){
  SCHEDULER.scheduleAtFixedRate(new MemoryLoggingTask(),0,1,TimeUnit.SECONDS);
}
Program: 80552
Project: 80552
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,AppsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,AppsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    Exception e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}
Program: 80553
Project: 80553
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}
Program: 80556
Project: 80556
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  Tools.HangarLog("String_Node_Str");
  List<AppsRowItem> appTasks=createAppTasks();
  mAppRowAdapter=new AppsRowAdapter(mContext,appTasks);
  lv.setAdapter(mAppRowAdapter);
  lv.setOnItemClickListener(this);
  mAppRowAdapter.notifyDataSetChanged();
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  Tools.HangarLog("String_Node_Str");
  List<AppsRowItem> appTasks=createAppTasksLoop();
  if (appTasks == null)   return;
  mAppRowAdapter=new AppsRowAdapter(mContext,appTasks);
  lv.setAdapter(mAppRowAdapter);
  lv.setOnItemClickListener(this);
  mAppRowAdapter.notifyDataSetChanged();
}
Program: 80557
Project: 80557
Buggy source:
public static Bitmap drawableToBitmap(Drawable drawable){
  if (drawable instanceof BitmapDrawable) {
    return ((BitmapDrawable)drawable).getBitmap();
  }
  Bitmap bitmap=Bitmap.createBitmap(Tools.dpToPx(mContext,100),Tools.dpToPx(mContext,5),Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
  drawable.draw(canvas);
  return bitmap;
}

Fixed version (ground truth):
public Bitmap drawableToBitmap(Context context,Drawable drawable){
  if (drawable instanceof BitmapDrawable) {
    return ((BitmapDrawable)drawable).getBitmap();
  }
  Bitmap bitmap=Bitmap.createBitmap(Tools.dpToPx(context,100),Tools.dpToPx(context,5),Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
  drawable.draw(canvas);
  return bitmap;
}
Program: 80558
Project: 80558
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,StatsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,StatsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    Exception e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}
Program: 80559
Project: 80559
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}
Program: 80564
Project: 80564
Buggy source:
protected void reorderAndLaunch(ArrayList<Tools.TaskInfo> taskList){
  Tools.HangarLog("String_Node_Str" + taskList.size());
  boolean weightedRecents=prefs.getBoolean(Settings.WEIGHTED_RECENTS_PREFERENCE,Settings.WEIGHTED_RECENTS_DEFAULT);
  boolean isToggled=prefs.getBoolean(Settings.TOGGLE_PREFERENCE,Settings.TOGGLE_DEFAULT);
  int weightPriority=Integer.parseInt(prefs.getString(Settings.WEIGHT_PRIORITY_PREFERENCE,Integer.toString(Settings.WEIGHT_PRIORITY_DEFAULT)));
  if (weightedRecents) {
    taskList=new Tools().reorderTasks(taskList,db,weightPriority);
  }
  if (isToggled)   createNotification(taskList);
  try {
    int ids[]=AppWidgetManager.getInstance(this).getAppWidgetIds(new ComponentName(this,AppsWidget.class));
    if (ids.length > 0)     Tools.reorderWidgetTasks(db,getApplicationContext());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void reorderAndLaunch(ArrayList<Tools.TaskInfo> taskList){
  reorderAndLaunch(taskList,false);
}
Program: 80570
Project: 80570
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,AppsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,AppsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}
Program: 80571
Project: 80571
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}
Program: 80573
Project: 80573
Buggy source:
@Override public void onClick(View v){
  int mAppWidgetId;
  savePrefs();
  if (extras != null) {
    mAppWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
    Intent resultValue=new Intent();
    resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,mAppWidgetId);
    getActivity().setResult(RESULT_OK,resultValue);
    Toast.makeText(mContext,R.string.reconfigure_reminder,Toast.LENGTH_LONG).show();
    getActivity().finish();
  }
 else {
    Tools.updateWidget(mContext);
    getActivity().finish();
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  int mAppWidgetId;
  savePrefs();
  TasksDataSource db=new TasksDataSource(mContext);
  db.open();
  Tools.reorderWidgetTasks(db,mContext);
  db.close();
  if (extras != null) {
    mAppWidgetId=extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,AppWidgetManager.INVALID_APPWIDGET_ID);
    Intent resultValue=new Intent();
    resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,mAppWidgetId);
    getActivity().setResult(RESULT_OK,resultValue);
    Toast.makeText(mContext,R.string.reconfigure_reminder,Toast.LENGTH_LONG).show();
    getActivity().finish();
  }
 else {
    Tools.updateWidget(mContext);
    getActivity().finish();
  }
}
Program: 80575
Project: 80575
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,StatsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  if (mContext == null)   mContext=context;
  AppWidgetManager mgr=AppWidgetManager.getInstance(context);
  int[] ids=mgr.getAppWidgetIds(new ComponentName(context,StatsWidget.class));
  for (  int id : ids) {
    Tools.HangarLog("String_Node_Str" + id);
    try {
      Bundle options=mgr.getAppWidgetOptions(id);
      updateAppWidget(context,mgr,id,options);
    }
 catch (    NullPointerException e) {
      e.printStackTrace();
      Tools.HangarLog("String_Node_Str");
    }
  }
  super.onReceive(context,intent);
}
Program: 80576
Project: 80576
Buggy source:
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}

Fixed version (ground truth):
@Override public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){
  Tools.HangarLog("String_Node_Str" + this.getClass().getCanonicalName() + "String_Node_Str");
  mContext=context;
  Intent intent=new Intent(context,WatchfulService.class);
  context.startService(intent);
}
Program: 80578
Project: 80578
Buggy source:
public TaskComparator(String type,int weight,int num){
  mType=type;
  weightPriority=weight;
  Float calNum=num / 8f;
  baseRecency=(calNum < 2.5) ? 2.5f : calNum;
  numToCompare=baseRecency + 1.5f;
}

Fixed version (ground truth):
public TaskComparator(String type,int weight,int num){
  mType=type;
  weightPriority=weight;
  Float calNum=num / 10f;
  baseRecency=(calNum < 2.5) ? 2.5f : calNum;
  numToCompare=baseRecency + 1.5f;
  HangarLog("String_Node_Str" + num + "String_Node_Str"+ calNum+ "String_Node_Str"+ baseRecency+ "String_Node_Str"+ numToCompare);
}
Program: 80579
Project: 80579
Buggy source:
protected static ArrayList<TaskInfo> reorderTasks(ArrayList<TaskInfo> taskList,TasksDataSource db,int weightPriority){
  return reorderTasks(taskList,db,weightPriority,false);
}

Fixed version (ground truth):
protected ArrayList<TaskInfo> reorderTasks(ArrayList<TaskInfo> taskList,TasksDataSource db,int weightPriority){
  return reorderTasks(taskList,db,weightPriority,false);
}
Program: 80580
Project: 80580
Buggy source:
protected void buildReorderAndLaunch(boolean isToggled){
  if (isToggled) {
    ArrayList<Tools.TaskInfo> taskList;
    taskList=Tools.buildTaskList(getApplicationContext(),db,TASKLIST_QUEUE_SIZE);
    if (taskList.size() == 0) {
      buildBaseTasks();
      taskList=Tools.buildTaskList(getApplicationContext(),db,TASKLIST_QUEUE_SIZE);
    }
    reorderAndLaunch(taskList);
  }
}

Fixed version (ground truth):
protected void buildReorderAndLaunch(boolean isToggled){
  if (isToggled) {
    ArrayList<Tools.TaskInfo> taskList;
    taskList=Tools.buildTaskList(getApplicationContext(),db,Settings.TASKLIST_QUEUE_LIMIT);
    if (taskList.size() == 0) {
      buildBaseTasks();
      taskList=Tools.buildTaskList(getApplicationContext(),db,Settings.TASKLIST_QUEUE_LIMIT);
    }
    reorderAndLaunch(taskList);
  }
}
Program: 80581
Project: 80581
Buggy source:
protected void reorderAndLaunch(ArrayList<Tools.TaskInfo> taskList){
  boolean weightedRecents=prefs.getBoolean(Settings.WEIGHTED_RECENTS_PREFERENCE,Settings.WEIGHTED_RECENTS_DEFAULT);
  boolean isToggled=prefs.getBoolean(Settings.TOGGLE_PREFERENCE,Settings.TOGGLE_DEFAULT);
  int weightPriority=Integer.parseInt(prefs.getString(Settings.WEIGHT_PRIORITY_PREFERENCE,Integer.toString(Settings.WEIGHT_PRIORITY_DEFAULT)));
  if (weightedRecents) {
    taskList=Tools.reorderTasks(taskList,db,weightPriority);
  }
  if (isToggled)   createNotification(taskList);
  reorderWidgetTasks(weightedRecents,weightPriority);
}

Fixed version (ground truth):
protected void reorderAndLaunch(ArrayList<Tools.TaskInfo> taskList){
  boolean weightedRecents=prefs.getBoolean(Settings.WEIGHTED_RECENTS_PREFERENCE,Settings.WEIGHTED_RECENTS_DEFAULT);
  boolean isToggled=prefs.getBoolean(Settings.TOGGLE_PREFERENCE,Settings.TOGGLE_DEFAULT);
  int weightPriority=Integer.parseInt(prefs.getString(Settings.WEIGHT_PRIORITY_PREFERENCE,Integer.toString(Settings.WEIGHT_PRIORITY_DEFAULT)));
  if (weightedRecents) {
    taskList=new Tools().reorderTasks(taskList,db,weightPriority);
  }
  if (isToggled)   createNotification(taskList);
  try {
    int ids[]=AppWidgetManager.getInstance(this).getAppWidgetIds(new ComponentName(this,AppsWidget.class));
    if (ids.length > 0)     Tools.reorderWidgetTasks(db,getApplicationContext());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 80582
Project: 80582
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction() != null && intent.getAction().equals(BCAST_CONFIGCHANGED)) {
    Tools.HangarLog("String_Node_Str" + runningTask.packageName + "String_Node_Str"+ launcherPackage);
    if (runningTask.packageName.equals(launcherPackage)) {
      Tools.updateWidget(context);
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction() != null && intent.getAction().equals(BCAST_CONFIGCHANGED) && runningTask != null && launcherPackage != null) {
    Tools.HangarLog("String_Node_Str" + runningTask.packageName + "String_Node_Str"+ launcherPackage);
    if (runningTask.packageName.equals(launcherPackage)) {
      Tools.updateWidget(context);
    }
  }
}
Program: 80592
Project: 80592
Buggy source:
/** 
 * Add parameter definitions
 */
@Override protected void addParameterDefinitions(List<ParameterDefinition> paramList){
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_DESTINATION_FOLDER,DataTypeDefinition.NODE_REF,false,getParamDisplayLabel(PDFToolkitConstants.PARAM_DESTINATION_FOLDER)));
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_EXTRACT_PAGES,DataTypeDefinition.TEXT,true,getParamDisplayLabel(PDFToolkitConstants.PARAM_DELETE_PAGES)));
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_DESTINATION_NAME,DataTypeDefinition.TEXT,false,getParamDisplayLabel(PDFToolkitConstants.PARAM_DESTINATION_NAME)));
  super.addParameterDefinitions(paramList);
}

Fixed version (ground truth):
/** 
 * Add parameter definitions
 */
@Override protected void addParameterDefinitions(List<ParameterDefinition> paramList){
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_DESTINATION_FOLDER,DataTypeDefinition.NODE_REF,true,getParamDisplayLabel(PDFToolkitConstants.PARAM_DESTINATION_FOLDER)));
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_EXTRACT_PAGES,DataTypeDefinition.TEXT,true,getParamDisplayLabel(PDFToolkitConstants.PARAM_DELETE_PAGES)));
  paramList.add(new ParameterDefinitionImpl(PDFToolkitConstants.PARAM_DESTINATION_NAME,DataTypeDefinition.TEXT,true,getParamDisplayLabel(PDFToolkitConstants.PARAM_DESTINATION_NAME)));
  super.addParameterDefinitions(paramList);
}
Program: 80593
Project: 80593
Buggy source:
@Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  NodeRef result=pdfToolkitService.deletePagesFromPDF(actionedUponNodeRef,action.getParameterValues());
  action.setParameterValue(PARAM_RESULT,result);
}

Fixed version (ground truth):
@Override protected void executeImpl(Action action,NodeRef actionedUponNodeRef){
  NodeRef result=pdfToolkitService.extractPagesFromPDF(actionedUponNodeRef,action.getParameterValues());
  action.setParameterValue(PARAM_RESULT,result);
}
Program: 80594
Project: 80594
Buggy source:
/** 
 * Create a rectangle for the visible signature using the selected position and signature size
 * @param position
 * @param width
 * @param height
 * @return
 */
private Rectangle positionSignature(String position,Rectangle pageRect,int width,int height){
  float pageHeight=pageRect.getHeight();
  float pageWidth=pageRect.getWidth();
  Rectangle r=null;
  if (position.equals(POSITION_BOTTOMLEFT)) {
    r=new Rectangle(0,height,width,0);
  }
 else   if (position.equals(POSITION_BOTTOMRIGHT)) {
    r=new Rectangle(pageWidth - width,pageHeight,pageWidth,pageHeight - height);
  }
 else   if (position.equals(POSITION_TOPLEFT)) {
    r=new Rectangle(0,pageHeight,width,pageHeight - height);
  }
 else   if (position.equals(POSITION_TOPRIGHT)) {
    r=new Rectangle(pageWidth - width,height,pageWidth,0);
  }
 else   if (position.equals(POSITION_CENTER)) {
    r=new Rectangle((pageWidth / 2) - (width / 2),(pageHeight / 2) - (height / 2),(pageWidth / 2) + (width / 2),(pageHeight / 2) + (height / 2));
  }
  return r;
}

Fixed version (ground truth):
/** 
 * Create a rectangle for the visible signature using the selected position and signature size
 * @param position
 * @param width
 * @param height
 * @return
 */
private Rectangle positionSignature(String position,Rectangle pageRect,int width,int height){
  float pageHeight=pageRect.getHeight();
  float pageWidth=pageRect.getWidth();
  Rectangle r=null;
  if (position.equals(POSITION_BOTTOMLEFT)) {
    r=new Rectangle(0,height,width,0);
  }
 else   if (position.equals(POSITION_BOTTOMRIGHT)) {
    r=new Rectangle(pageWidth - width,height,pageWidth,0);
  }
 else   if (position.equals(POSITION_TOPLEFT)) {
    r=new Rectangle(0,pageHeight,width,pageHeight - height);
  }
 else   if (position.equals(POSITION_TOPRIGHT)) {
    r=new Rectangle(pageWidth - width,pageHeight,pageWidth,pageHeight - height);
  }
 else   if (position.equals(POSITION_CENTER)) {
    r=new Rectangle((pageWidth / 2) - (width / 2),(pageHeight / 2) - (height / 2),(pageWidth / 2) + (width / 2),(pageHeight / 2) + (height / 2));
  }
  return r;
}
Program: 80595
Project: 80595
Buggy source:
/** 
 * Determines whether or not a watermark should be applied to a given page
 * @param pages
 * @param current
 * @param numpages
 * @return
 */
protected boolean checkPage(String pages,int current,int numpages){
  boolean markPage=false;
  if (pages.equals(PAGE_EVEN) || pages.equals(PAGE_ODD)) {
    if (current % 2 == 0) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_ODD)) {
    if (current % 2 != 0) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_FIRST)) {
    if (current == 1) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_LAST)) {
    if (current == numpages) {
      markPage=true;
    }
  }
 else {
    markPage=true;
  }
  return markPage;
}

Fixed version (ground truth):
/** 
 * Determines whether or not a watermark should be applied to a given page
 * @param pages
 * @param current
 * @param numpages
 * @return
 */
protected boolean checkPage(String pages,int current,int numpages){
  boolean markPage=false;
  if (pages.equals(PAGE_EVEN)) {
    if (current % 2 == 0) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_ODD)) {
    if (current % 2 != 0) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_FIRST)) {
    if (current == 1) {
      markPage=true;
    }
  }
 else   if (pages.equals(PAGE_LAST)) {
    if (current == numpages) {
      markPage=true;
    }
  }
 else {
    markPage=true;
  }
  return markPage;
}
Program: 80597
Project: 80597
Buggy source:
/** 
 * Randomly swap the haploype
 */
public void randomizeHaplotype(){
  if (rand == null) {
    log.error("String_Node_Str");
    log.error(toString());
    System.exit(1);
  }
  if (rand.nextDouble() > 0.5) {
    return;
  }
  byte tmp=paternal;
  paternal=maternal;
  maternal=tmp;
}

Fixed version (ground truth):
/** 
 * Randomly swap the haploype
 */
public void randomizeHaplotype(){
  if (rand == null) {
    log.error("String_Node_Str");
    log.error(toString());
    System.exit(1);
  }
  isPhased=true;
  if (rand.nextDouble() > 0.5) {
    return;
  }
  byte tmp=paternal;
  paternal=maternal;
  maternal=tmp;
}
Program: 80598
Project: 80598
Buggy source:
/** 
 * this method returns a genotype number -1 for unavailable genotype 0 for reference allele 1 for first alternative allele 2,3,... when paternal genotype is unknown, i.e. -1, then we try to return something meaningful. however this is by no means a very good return value. proper fix involves explicitly handling of missing genotype/phasing information.
 * @return paternal genotype number
 */
public byte getGoodPaternal(){
  if (paternal >= 0)   return paternal;
  if (chr.isMT()) {
    return (byte)0;
  }
  return (byte)(Math.min(1,alts.length));
}

Fixed version (ground truth):
/** 
 * this method returns a genotype number -1 for unavailable genotype 0 for reference allele 1 for first alternative allele 2,3,... when paternal genotype is unknown, i.e. -1, then we try to return something meaningful. however this is by no means a very good return value. proper fix involves explicitly handling of missing genotype/phasing information.
 * @return paternal genotype number
 */
public byte getGoodPaternal(){
  if (paternal >= 0)   return paternal;
  if (chr.isMT() || chr.isX()) {
    return (byte)-1;
  }
  return (byte)(Math.min(1,alts.length));
}
Program: 80599
Project: 80599
Buggy source:
/** 
 * Randomize the genotype
 * @param gender
 */
public void randomizeGenotype(GenderType gender){
  if (rand == null) {
    log.error("String_Node_Str");
    log.error(toString());
    System.exit(1);
  }
  Genotypes g=new Genotypes(chr,gender,alts.length,rand);
  paternal=g.geno[0];
  maternal=g.geno[1];
}

Fixed version (ground truth):
/** 
 * Randomize the genotype
 * @param gender
 */
public void randomizeGenotype(GenderType gender){
  if (rand == null) {
    log.error("String_Node_Str");
    log.error(toString());
    System.exit(1);
  }
  Genotypes g=new Genotypes(chr,gender,alts.length,rand);
  paternal=g.geno[0];
  maternal=g.geno[1];
  isPhased=true;
}
Program: 80600
Project: 80600
Buggy source:
public SimpleInterval1D getGenotypeUnionVariantInterval(){
  return getVariantInterval(getGoodPaternal()).union(getVariantInterval(getGoodMaternal()));
}

Fixed version (ground truth):
public SimpleInterval1D getGenotypeUnionVariantInterval(){
  if (getGoodPaternal() == -1 && getGoodMaternal() == -1) {
    throw new RuntimeException("String_Node_Str" + this.toString());
  }
 else   if (getGoodPaternal() == -1) {
    return getVariantInterval(getGoodMaternal());
  }
 else   if (getGoodMaternal() == -1) {
    return getVariantInterval(getGoodPaternal());
  }
 else {
    return getVariantInterval(getGoodPaternal()).union(getVariantInterval(getGoodMaternal()));
  }
}
Program: 80601
Project: 80601
Buggy source:
/** 
 * this method returns a genotype number -1 for unavailable genotype 0 for reference allele 1 for first alternative allele 2,3,... when maternal genotype is unknown, i.e. -1, then we try to return something meaningful. however this is by no means a very good return value. proper fix involves explicitly handling of missing genotype/phasing information.
 * @return maternal genotype number
 */
public byte getGoodMaternal(){
  if (maternal >= 0)   return maternal;
  if (chr.isMT()) {
    return (byte)(Math.min(1,alts.length));
  }
  if (chr.isY()) {
    return (byte)0;
  }
  return (byte)(Math.min(2,alts.length));
}

Fixed version (ground truth):
/** 
 * this method returns a genotype number -1 for unavailable genotype 0 for reference allele 1 for first alternative allele 2,3,... when maternal genotype is unknown, i.e. -1, then we try to return something meaningful. however this is by no means a very good return value. proper fix involves explicitly handling of missing genotype/phasing information.
 * @return maternal genotype number
 */
public byte getGoodMaternal(){
  if (maternal >= 0)   return maternal;
  if (chr.isMT()) {
    return (byte)(Math.min(1,alts.length));
  }
  if (chr.isY()) {
    return (byte)-1;
  }
  return (byte)(Math.min(2,alts.length));
}
Program: 80604
Project: 80604
Buggy source:
/** 
 * Fills in the insertions sequence with random sequence sampled from known insertions
 * @param var        Variant to be filled in
 * @param insertSeq Sequence on known insertions all concatented together
 * @param geno       allele to be filled in
 */
public void fillInSeq(Variant var,byte[] insertSeq,int geno){
  Alt alt=var.getAlt(geno);
  if (alt != null) {
    if (alt.getSeqType() == FlexSeq.Type.INS) {
      final double NSEGMENTS=10.0;
      int len=alt.length();
      byte newSeq[]=new byte[len];
      final int segLen=(len > insertSeq.length) ? (int)Math.ceil(insertSeq.length / NSEGMENTS) : len;
      for (int i=0; i < len; i+=segLen) {
        int randStart=rand.nextInt(insertSeq.length - segLen);
        System.arraycopy(insertSeq,randStart,newSeq,i,Math.min(segLen,len - i));
      }
      alt=new Alt(new FlexSeq(newSeq));
    }
    var.setAlt(geno,alt);
  }
}

Fixed version (ground truth):
/** 
 * Fills in the insertions sequence with random sequence sampled from known insertions
 * @param var        Variant to be filled in
 * @param insertSeq Sequence on known insertions all concatented together
 * @param geno       allele to be filled in
 */
public void fillInSeq(Variant var,byte[] insertSeq,int geno){
  Alt alt=var.getAlt(geno);
  if (alt != null) {
    if (alt.getSeqType() == FlexSeq.Type.INS) {
      final double NSEGMENTS=10.0;
      int len=alt.length();
      byte newSeq[]=new byte[len];
      final int segLen=(len >= insertSeq.length) ? (int)Math.ceil(insertSeq.length / NSEGMENTS) : len;
      for (int i=0; i < len; i+=segLen) {
        int randStart=rand.nextInt(insertSeq.length - segLen);
        System.arraycopy(insertSeq,randStart,newSeq,i,Math.min(segLen,len - i));
      }
      alt=new Alt(new FlexSeq(newSeq));
    }
    var.setAlt(geno,alt);
  }
}
Program: 80605
Project: 80605
Buggy source:
/** 
 * @param start 0-based start, consistent with BED
 * @param end non-inclusive end, consistent with BED
 * @return number of non-N based in the sequence in the region of interest
 */
public int getNumNonNBases(final int start,final int end){
  int count=0;
  for (int index=start; start < end; index++) {
    if (!isN(_seq[index]))     count++;
  }
  return count;
}

Fixed version (ground truth):
/** 
 * @param start 0-based start, consistent with BED
 * @param end non-inclusive end, consistent with BED
 * @return number of non-N based in the sequence in the region of interest
 */
public int getNumNonNBases(final int start,final int end){
  int count=0;
  for (int index=start; index < end; index++) {
    if (!isN(_seq[index]))     count++;
  }
  return count;
}
Program: 80607
Project: 80607
Buggy source:
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file);
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file)));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null || line.trim().isEmpty()) {
      break;
    }
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file);
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file)));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null)     break;
    if (line.trim().isEmpty())     continue;
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}
Program: 80608
Project: 80608
Buggy source:
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file);
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file)));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null || line.trim().isEmpty()) {
      break;
    }
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
public ReadMap(final File file) throws IOException {
  log.info("String_Node_Str" + file);
  bufferedReader=new BufferedReader(new InputStreamReader(decompressStream(file)));
  while (hasMoreInput()) {
    readLine();
    log.trace("String_Node_Str" + line);
    if (line == null)     break;
    if (line.trim().isEmpty())     continue;
    final ReadMapRecord record=parseLine();
    readMap.put(record.getReadName(),record);
  }
  log.info("String_Node_Str");
}
Program: 80611
Project: 80611
Buggy source:
/** 
 * @return The midpoint of the interval floor((right+left)/2)
 */
public long getCenter(){
  return (((getRight() / 2) + (getLeft() / 2)));
}

Fixed version (ground truth):
/** 
 * @return The midpoint of the interval floor((right+left)/2)
 */
public long getCenter(){
  return Math.round(Math.floor(((getRight() / 2.0) + (getLeft() / 2.0))));
}
Program: 80612
Project: 80612
Buggy source:
CompareParams(String bamFilename,int wiggle,String bedFilename){
  this.bam_filename=bamFilename;
  this.wiggle=wiggle;
  this.bedFilename=bedFilename;
}

Fixed version (ground truth):
CompareParams(String bamFilename,int wiggle,String bedFilename,double identityThreshold){
  this.bamFilename=bamFilename;
  this.wiggle=wiggle;
  this.bedFilename=bedFilename;
  this.identityThreshold=identityThreshold;
}
Program: 80616
Project: 80616
Buggy source:
/** 
 * loosely compare two breakends all fields must be equal except for the exact positions which are allowed to have some shifts
 * @param a
 * @param b
 * @param overlapRatio
 * @param wiggle
 * @return
 */
public static boolean looseEquals(Breakend a,Breakend b,double overlapRatio,int wiggle){
  return a.getChr().equals(b.getChr()) && a.isForward() == b.isForward() && a.isLeft() == b.isLeft() && a.getInterval().intersects(b.getInterval(),overlapRatio,wiggle);
}

Fixed version (ground truth):
/** 
 * loosely compare two breakends all fields must be equal except for the exact positions which are allowed to have some shifts
 * @param a
 * @param b
 * @param overlapRatio
 * @param wiggle
 * @return
 */
public static boolean looseEquals(Breakend a,Breakend b,double overlapRatio,int wiggle){
  if (a == null || b == null) {
    return false;
  }
  return a.getChr().equals(b.getChr()) && a.isForward() == b.isForward() && a.isLeft() == b.isLeft() && a.getInterval().intersects(b.getInterval(),overlapRatio,wiggle);
}