nus-yam/ex-repair huggingface dataset:
Program: 4068
Project: 4068
Buggy source:
void setAfterFlushFilter(AfterFlushFilter afterFlushFilter){
  this.isTest=true;
  this.afterFlushFilter=afterFlushFilter;
}

Fixed version (ground truth):
void setAfterFlushFilter(AfterFlushFilter afterFlushFilter){
  isTest=true;
  this.afterFlushFilter=afterFlushFilter;
}
Program: 4069
Project: 4069
Buggy source:
public void initialize(LogHouseConfiguration logHouseConfiguration,LogHouseStorage storage){
  this.isTest=logHouseConfiguration.isTest();
  this.afterFlushFilter=logHouseConfiguration.getAfterFlushFilter();
  this.beforeEmitFilter=logHouseConfiguration.getBeforeEmitFilter();
  this.storage=storage;
  this.conf=configure(new Configuration());
}

Fixed version (ground truth):
public void initialize(LogHouseConfiguration logHouseConfiguration,LogHouseStorage storage){
  this.afterFlushFilter=logHouseConfiguration.getAfterFlushFilter();
  this.beforeEmitFilter=logHouseConfiguration.getBeforeEmitFilter();
  this.storage=storage;
  this.conf=configure(new Configuration());
}
Program: 4070
Project: 4070
Buggy source:
public void shouldBe(Matcher matcher){
synchronized (LOCK) {
    final CountDownLatch latch=new CountDownLatch(logs.size());
    final List<JSONObject> results=new ArrayList<>();
    final String[] compareInfoMessage={"String_Node_Str"};
    conf.setAfterFlushFilter(new AfterFlushFilter(){
      @Override public void call(      String type,      List<JSONObject> serializedLogs){
        compareInfoMessage[0]+="String_Node_Str" + target + "String_Node_Str"+ type+ "String_Node_Str";
        if (target.equals(type)) {
          results.addAll(serializedLogs);
        }
        latch.countDown();
      }
    }
);
    initializeLogHouse(conf);
    putLogs(logs);
    try {
      latch.await(1000,TimeUnit.MILLISECONDS);
      matcher.expect(results);
    }
 catch (    AssertionFailedError e) {
      Records records=LogHouse.getBufferedLogs();
      String message=LogDumper.buildMessage(records);
      throw new AssertionFailedError(e.getMessage() + "String_Node_Str" + compareInfoMessage[0]+ "String_Node_Str"+ results.size()+ "String_Node_Str"+ message);
    }
catch (    JSONException|InterruptedException e) {
      throw new RuntimeException(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void shouldBe(Matcher matcher){
synchronized (LOCK) {
    final CountDownLatch latch=new CountDownLatch(logs.size());
    final List<JSONObject> results=new ArrayList<>();
    final String[] compareInfoMessage={"String_Node_Str"};
    conf.setAfterFlushFilter(new AfterFlushFilter(){
      @Override public void call(      String type,      List<JSONObject> serializedLogs){
        compareInfoMessage[0]+="String_Node_Str" + target + "String_Node_Str"+ type+ "String_Node_Str";
        if (target.equals(type)) {
          results.addAll(serializedLogs);
        }
        latch.countDown();
      }
    }
);
    initializeLogHouse(conf);
    putLogs(logs);
    try {
      latch.await(1000,TimeUnit.MILLISECONDS);
      matcher.expect(results);
    }
 catch (    AssertionFailedError e) {
      throw new AssertionFailedError(e.getMessage() + "String_Node_Str" + compareInfoMessage[0]+ "String_Node_Str"+ results.size());
    }
catch (    JSONException|InterruptedException e) {
      throw new RuntimeException(e.getMessage());
    }
  }
}
Program: 4071
Project: 4071
Buggy source:
public void flushSync(){
  Records records=getRecordsFromStorage();
  if (records.isEmpty()) {
    return;
  }
  while (!records.isEmpty()) {
    final List<JSONObject> serializedLogs=records.getSerializedLogs();
    if (!isTest) {
      if (!flushChunkOfLogs(serializedLogs)) {
        lazyTaskRunner.retryLater();
        return;
      }
    }
    afterFlushAction.call(type(),serializedLogs);
    storage.delete(records);
    records=getRecordsFromStorage();
  }
}

Fixed version (ground truth):
public void flushSync(){
  Records records=getRecordsFromStorage();
  if (records.isEmpty()) {
    return;
  }
  while (!records.isEmpty()) {
    final List<JSONObject> serializedLogs=records.getSerializedLogs();
    if (!isTest) {
      boolean isSuccess=flushChunkOfLogs(serializedLogs);
      if (isSuccess) {
        lazyTaskRunner.reset();
      }
 else {
        lazyTaskRunner.retryLater();
        return;
      }
    }
    afterFlushAction.call(type(),serializedLogs);
    storage.delete(records);
    records=getRecordsFromStorage();
  }
}
Program: 4072
Project: 4072
Buggy source:
public LazyTaskRunner(final LazyTask task,final int interval){
  this.interval=interval;
  this.handler=new Handler();
  this.hasAlreadySet=false;
  this.callback=new Runnable(){
    @Override public void run(){
      hasAlreadySet=false;
      retryCount=1;
      task.run();
    }
  }
;
}

Fixed version (ground truth):
public LazyTaskRunner(final LazyTask task,final int interval){
  this.interval=interval;
  this.handler=new Handler();
  this.hasAlreadySet=false;
  this.callback=new Runnable(){
    @Override public void run(){
      task.run();
    }
  }
;
}
Program: 4073
Project: 4073
Buggy source:
public synchronized void tryToStart(){
  if (hasAlreadySet && retryCount == 1) {
    return;
  }
  retryCount=1;
  startDelayed();
}

Fixed version (ground truth):
public synchronized void tryToStart(){
  if (hasAlreadySet && retryCount == 0) {
    return;
  }
  retryCount=0;
  startDelayed();
}
Program: 4074
Project: 4074
Buggy source:
private synchronized void startDelayed(){
  handler.removeCallbacks(callback);
  int buckOffTime=interval * retryCount;
  handler.postDelayed(callback,buckOffTime);
  hasAlreadySet=true;
}

Fixed version (ground truth):
private synchronized void startDelayed(){
  handler.removeCallbacks(callback);
  int buckOffTime=interval * retryCount;
  handler.postDelayed(callback,interval + buckOffTime);
  hasAlreadySet=true;
}
Program: 4075
Project: 4075
Buggy source:
@Override public void run(){
  hasAlreadySet=false;
  retryCount=1;
  task.run();
}

Fixed version (ground truth):
@Override public void run(){
  task.run();
}
Program: 4077
Project: 4077
Buggy source:
/** 
 * This function must be invoked if "default" (1st) constructor is called or if you want to change the blurred layout. <p/> We make a fake ImageView with width and height MATCH_PARENT. This ImageView will host the blurred snapshot/bitmap.
 * @param layout A {@link android.widget.RelativeLayout} to take snapshot of it.
 * @param radius Blur radius
 */
public void init(final View layout,int radius){
  this.mLayout=layout;
  this.radius=radius;
  mBlurredImageView=new ImageView(context);
  RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT);
  mBlurredImageView.setLayoutParams(params);
  mBlurredImageView.setClickable(false);
  mBlurredImageView.setVisibility(View.GONE);
  ((RelativeLayout)this.mLayout).addView(mBlurredImageView);
}

Fixed version (ground truth):
/** 
 * This function must be invoked if "default" (1st) constructor is called or if you want to change the blurred layout. <p/> We make a fake ImageView with width and height MATCH_PARENT. This ImageView will host the blurred snapshot/bitmap.
 * @param layout A {@link android.widget.RelativeLayout} to take snapshot of it.
 * @param radius Blur radius
 */
public void init(final View layout,int radius){
  this.mLayout=layout;
  this.mBlurRadius=radius;
  mBlurredImageView=new ImageView(context);
  RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
  mBlurredImageView.setLayoutParams(params);
  mBlurredImageView.setClickable(false);
  mBlurredImageView.setVisibility(View.GONE);
  mBlurredImageView.setScaleType(ImageView.ScaleType.FIT_XY);
  ((RelativeLayout)this.mLayout).addView(mBlurredImageView);
}
Program: 4078
Project: 4078
Buggy source:
private void handleRecycle(){
  Drawable drawable=mBlurredImageView.getDrawable();
  if (drawable instanceof BitmapDrawable) {
    BitmapDrawable bitmapDrawable=((BitmapDrawable)drawable);
    Bitmap bitmap=bitmapDrawable.getBitmap();
    if (bitmap != null)     bitmap.recycle();
    mBlurredImageView.setImageBitmap(null);
  }
  render=true;
}

Fixed version (ground truth):
private void handleRecycle(){
  Drawable drawable=mBlurredImageView.getDrawable();
  if (drawable instanceof BitmapDrawable) {
    BitmapDrawable bitmapDrawable=((BitmapDrawable)drawable);
    Bitmap bitmap=bitmapDrawable.getBitmap();
    if (bitmap != null)     bitmap.recycle();
    mBlurredImageView.setImageBitmap(null);
  }
  prepareToRender=true;
}
Program: 4079
Project: 4079
Buggy source:
@Override public void onDrawerClosed(View view){
  render=true;
  mBlurredImageView.setVisibility(View.GONE);
}

Fixed version (ground truth):
@Override public void onDrawerClosed(View view){
  prepareToRender=true;
  mBlurredImageView.setVisibility(View.GONE);
}
Program: 4080
Project: 4080
Buggy source:
private Bitmap scaleBitmap(Bitmap myBitmap){
  final int maxSize=250;
  int outWidth;
  int outHeight;
  int inWidth=myBitmap.getWidth();
  int inHeight=myBitmap.getHeight();
  if (inWidth > inHeight) {
    outWidth=maxSize;
    outHeight=(inHeight * maxSize) / inWidth;
  }
 else {
    outHeight=maxSize;
    outWidth=(inWidth * maxSize) / inHeight;
  }
  return Bitmap.createScaledBitmap(myBitmap,outWidth,outHeight,false);
}

Fixed version (ground truth):
private Bitmap scaleBitmap(Bitmap myBitmap){
  int width=(int)(myBitmap.getWidth() / mDownScaleFactor);
  int height=(int)(myBitmap.getHeight() / mDownScaleFactor);
  return Bitmap.createScaledBitmap(myBitmap,width,height,false);
}
Program: 4081
Project: 4081
Buggy source:
/** 
 * Snapshots the specified layout and scale it using scaleBitmap() function then we blur the scaled bitmap with the preferred blur radius. Finally, we post it to our fake   {@link android.widget.ImageView}.
 */
private void render(){
  if (render) {
    render=false;
    Bitmap bitmap=loadBitmapFromView(mLayout);
    bitmap=scaleBitmap(bitmap);
    bitmap=Blur.fastblur(context,bitmap,radius);
    mBlurredImageView.setVisibility(View.VISIBLE);
    mBlurredImageView.setImageBitmap(bitmap);
  }
}

Fixed version (ground truth):
/** 
 * Snapshots the specified layout and scale it using scaleBitmap() function then we blur the scaled bitmap with the preferred blur radius. Finally, we post it to our fake   {@link android.widget.ImageView}.
 */
private void render(){
  if (prepareToRender) {
    prepareToRender=false;
    Bitmap bitmap=loadBitmapFromView(mLayout);
    bitmap=scaleBitmap(bitmap);
    bitmap=Blur.fastblur(context,bitmap,mBlurRadius,false);
    mBlurredImageView.setVisibility(View.VISIBLE);
    mBlurredImageView.setImageBitmap(bitmap);
  }
}
Program: 4082
Project: 4082
Buggy source:
public void setRadius(int radius){
  this.radius=radius;
}

Fixed version (ground truth):
public void setRadius(int radius){
  mBlurRadius=radius < 1 ? 1 : radius;
}
Program: 4083
Project: 4083
Buggy source:
@Override protected void onActivityResult(int requestCode,int resuleCode,Intent intent){
  super.onActivityResult(requestCode,resuleCode,intent);
  if (resuleCode == Activity.RESULT_OK) {
    if (requestCode == INTENT_REQUEST_GET_IMAGES || requestCode == INTENT_REQUEST_GET_N_IMAGES) {
      Parcelable[] parcelableUris=intent.getParcelableArrayExtra(ImagePickerActivity.EXTRA_IMAGE_URIS);
      if (parcelableUris == null) {
        return;
      }
      Uri[] uris=new Uri[parcelableUris.length];
      System.arraycopy(parcelableUris,0,uris,0,parcelableUris.length);
      if (uris != null) {
        for (        Uri uri : uris) {
          Log.i(TAG,"String_Node_Str" + uri);
          mMedia.add(uri);
        }
        showMedia();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resuleCode,Intent intent){
  super.onActivityResult(requestCode,resuleCode,intent);
  if (resuleCode == Activity.RESULT_OK) {
    if (requestCode == INTENT_REQUEST_GET_IMAGES || requestCode == INTENT_REQUEST_GET_N_IMAGES) {
      Parcelable[] parcelableUris=intent.getParcelableArrayExtra(ImagePickerActivity.EXTRA_IMAGE_URIS);
      int[] parcelableOrientations=intent.getIntArrayExtra((ImagePickerActivity.EXTRA_IMAGE_ORIENTATIONS));
      if (parcelableUris == null) {
        return;
      }
      Uri[] uris=new Uri[parcelableUris.length];
      int[] orientations=new int[parcelableUris.length];
      System.arraycopy(parcelableUris,0,uris,0,parcelableUris.length);
      System.arraycopy(parcelableOrientations,0,orientations,0,parcelableOrientations.length);
      if (uris != null) {
        for (int i=0; i < orientations.length; i++) {
          mMediaImages.add(new Image(uris[i],orientations[i]));
        }
        showMedia();
      }
    }
  }
}
Program: 4084
Project: 4084
Buggy source:
private void showMedia(){
  mSelectedImagesContainer.removeAllViews();
  Iterator<Uri> iterator=mMedia.iterator();
  ImageInternalFetcher imageFetcher=new ImageInternalFetcher(this,500);
  while (iterator.hasNext()) {
    Uri uri=iterator.next();
    Log.i(TAG,"String_Node_Str" + uri);
    if (mMedia.size() >= 1) {
      mSelectedImagesContainer.setVisibility(View.VISIBLE);
    }
    View imageHolder=LayoutInflater.from(this).inflate(R.layout.media_layout,null);
    ImageView thumbnail=(ImageView)imageHolder.findViewById(R.id.media_image);
    if (!uri.toString().contains("String_Node_Str")) {
      uri=Uri.fromFile(new File(uri.toString()));
    }
    imageFetcher.loadImage(uri,thumbnail);
    mSelectedImagesContainer.addView(imageHolder);
    int wdpx=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,300,getResources().getDisplayMetrics());
    int htpx=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,200,getResources().getDisplayMetrics());
    thumbnail.setLayoutParams(new FrameLayout.LayoutParams(wdpx,htpx));
  }
}

Fixed version (ground truth):
private void showMedia(){
  mSelectedImagesContainer.removeAllViews();
  Iterator<Image> iterator=mMediaImages.iterator();
  ImageInternalFetcher imageFetcher=new ImageInternalFetcher(this,500);
  while (iterator.hasNext()) {
    Image image=iterator.next();
    Log.i(TAG,"String_Node_Str" + image);
    if (mMedia.size() >= 1) {
      mSelectedImagesContainer.setVisibility(View.VISIBLE);
    }
    View imageHolder=LayoutInflater.from(this).inflate(R.layout.media_layout,null);
    ImageView thumbnail=(ImageView)imageHolder.findViewById(R.id.media_image);
    if (!image.mUri.toString().contains("String_Node_Str")) {
      image.mUri=Uri.fromFile(new File(image.mUri.toString()));
    }
    imageFetcher.loadImage(image.mUri,thumbnail,image.mOrientation);
    mSelectedImagesContainer.addView(imageHolder);
    int wdpx=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,300,getResources().getDisplayMetrics());
    int htpx=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,200,getResources().getDisplayMetrics());
    thumbnail.setLayoutParams(new FrameLayout.LayoutParams(wdpx,htpx));
  }
}
Program: 4085
Project: 4085
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  ViewHolder holder;
  if (convertView == null) {
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.pp__grid_item_gallery_thumbnail,null);
    holder=new ViewHolder();
    holder.mThumbnail=(ImageView)convertView.findViewById(R.id.pp__thumbnail_image);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  Image image=getItem(position);
  boolean isSelected=mActivity.containsImage(image);
  ((FrameLayout)convertView).setForeground(isSelected ? getResources().getDrawable(R.drawable.gallery_photo_selected) : null);
  if (holder.mImage == null || !holder.mImage.equals(image)) {
    mActivity.mImageFetcher.loadImage(image.mUri,holder.mThumbnail);
    holder.mImage=image;
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  ViewHolder holder;
  if (convertView == null) {
    convertView=LayoutInflater.from(getContext()).inflate(R.layout.pp__grid_item_gallery_thumbnail,null);
    holder=new ViewHolder();
    holder.mThumbnail=(ImageView)convertView.findViewById(R.id.pp__thumbnail_image);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  Image image=getItem(position);
  boolean isSelected=mActivity.containsImage(image);
  ((FrameLayout)convertView).setForeground(isSelected ? getResources().getDrawable(R.drawable.gallery_photo_selected) : null);
  if (holder.mImage == null || !holder.mImage.equals(image)) {
    mActivity.mImageFetcher.loadImage(image.mUri,holder.mThumbnail,image.mOrientation);
    holder.mImage=image;
  }
  return convertView;
}
Program: 4086
Project: 4086
Buggy source:
@Override public void onClick(View view){
  if (view.getId() == R.id.pp__btn_done) {
    Uri[] uris=new Uri[mSelectedImages.size()];
    int i=0;
    for (    Image img : mSelectedImages) {
      uris[i++]=img.mUri;
    }
    Intent intent=new Intent();
    intent.putExtra(EXTRA_IMAGE_URIS,uris);
    setResult(Activity.RESULT_OK,intent);
  }
 else   if (view.getId() == R.id.pp__btn_cancel) {
    setResult(Activity.RESULT_CANCELED);
  }
  finish();
}

Fixed version (ground truth):
@Override public void onClick(View view){
  if (view.getId() == R.id.pp__btn_done) {
    Uri[] uris=new Uri[mSelectedImages.size()];
    int[] orientations=new int[mSelectedImages.size()];
    int i=0;
    for (    Image img : mSelectedImages) {
      uris[i]=img.mUri;
      orientations[i++]=img.mOrientation;
    }
    Intent intent=new Intent();
    intent.putExtra(EXTRA_IMAGE_URIS,uris);
    intent.putExtra(EXTRA_IMAGE_ORIENTATIONS,orientations);
    setResult(Activity.RESULT_OK,intent);
  }
 else   if (view.getId() == R.id.pp__btn_cancel) {
    setResult(Activity.RESULT_CANCELED);
  }
  finish();
}
Program: 4087
Project: 4087
Buggy source:
public boolean addImage(Image image){
  if (mSelectedImages == null) {
    mSelectedImages=new HashSet<Image>();
  }
  if (mSelectedImages.size() == mConfig.getSelectionLimit()) {
    Toast.makeText(this,getString(R.string.n_images_selected,mConfig.getSelectionLimit()),Toast.LENGTH_SHORT).show();
    return false;
  }
 else {
    if (mSelectedImages.add(image)) {
      View rootView=LayoutInflater.from(ImagePickerActivity.this).inflate(R.layout.pp__list_item_selected_thumbnail,null);
      ImageView thumbnail=(ImageView)rootView.findViewById(R.id.pp__selected_photo);
      rootView.setTag(image.mUri);
      mImageFetcher.loadImage(image.mUri,thumbnail);
      mSelectedImagesContainer.addView(rootView,0);
      int px=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,60,getResources().getDisplayMetrics());
      thumbnail.setLayoutParams(new FrameLayout.LayoutParams(px,px));
      if (mSelectedImages.size() >= 1) {
        mSelectedImagesContainer.setVisibility(View.VISIBLE);
        mSelectedImageEmptyMessage.setVisibility(View.GONE);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean addImage(Image image){
  if (mSelectedImages == null) {
    mSelectedImages=new HashSet<Image>();
  }
  if (mSelectedImages.size() == mConfig.getSelectionLimit()) {
    Toast.makeText(this,getString(R.string.n_images_selected,mConfig.getSelectionLimit()),Toast.LENGTH_SHORT).show();
    return false;
  }
 else {
    if (mSelectedImages.add(image)) {
      View rootView=LayoutInflater.from(ImagePickerActivity.this).inflate(R.layout.pp__list_item_selected_thumbnail,null);
      ImageView thumbnail=(ImageView)rootView.findViewById(R.id.pp__selected_photo);
      rootView.setTag(image.mUri);
      mImageFetcher.loadImage(image.mUri,thumbnail,image.mOrientation);
      mSelectedImagesContainer.addView(rootView,0);
      int px=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,60,getResources().getDisplayMetrics());
      thumbnail.setLayoutParams(new FrameLayout.LayoutParams(px,px));
      if (mSelectedImages.size() >= 1) {
        mSelectedImagesContainer.setVisibility(View.VISIBLE);
        mSelectedImageEmptyMessage.setVisibility(View.GONE);
      }
      return true;
    }
  }
  return false;
}
Program: 4088
Project: 4088
Buggy source:
/** 
 * Load an image specified by the data parameter into an ImageView (override  {@link changer.nl.polypicker.utils.ImageWorker#processBitmap(Object)} to define the processing logic). A memory anddisk cache will be used if an  {@link nl.changer.polypicker.utils.ImageCache} has been added using{@link changer.nl.polypicker.utils.ImageWorker#addImageCache(android.support.v4.app.FragmentManager,nl.changer.polypicker.utils.ImageCache.ImageCacheParams)}. If the image is found in the memory cache, it is set immediately, otherwise an   {@link nl.changer.polypicker.utils.AsyncTask}will be created to asynchronously load the bitmap.
 * @param data The URL of the image to download.
 * @param imageView The ImageView to bind the downloaded image to.
 */
public void loadImage(Object data,ImageView imageView){
  if (data == null) {
    return;
  }
  BitmapDrawable value=null;
  if (mImageCache != null) {
    value=mImageCache.getBitmapFromMemCache(String.valueOf(data));
  }
  if (value != null) {
    imageView.setImageDrawable(value);
  }
 else   if (cancelPotentialWork(data,imageView)) {
    final BitmapWorkerTask task=new BitmapWorkerTask(data,imageView);
    final AsyncDrawable asyncDrawable=new AsyncDrawable(mResources,mLoadingBitmap,task);
    imageView.setImageDrawable(asyncDrawable);
    task.executeOnExecutor(AsyncTask.DUAL_THREAD_EXECUTOR);
  }
}

Fixed version (ground truth):
/** 
 * Load an image specified by the data parameter into an ImageView (override  {@link changer.nl.polypicker.utils.ImageWorker#processBitmap(Object)} to define the processing logic). A memory anddisk cache will be used if an  {@link nl.changer.polypicker.utils.ImageCache} has been added using{@link changer.nl.polypicker.utils.ImageWorker#addImageCache(android.support.v4.app.FragmentManager,nl.changer.polypicker.utils.ImageCache.ImageCacheParams)}. If the image is found in the memory cache, it is set immediately, otherwise an   {@link nl.changer.polypicker.utils.AsyncTask}will be created to asynchronously load the bitmap.
 * @param data The URL of the image to download.
 * @param imageView The ImageView to bind the downloaded image to.
 */
public void loadImage(Object data,ImageView imageView,int orientation){
  if (data == null) {
    return;
  }
  BitmapDrawable value=null;
  if (mImageCache != null) {
    value=mImageCache.getBitmapFromMemCache(String.valueOf(data));
  }
  if (value != null) {
    imageView.setImageDrawable(value);
    imageView.setRotation(orientation);
  }
 else   if (cancelPotentialWork(data,imageView)) {
    final BitmapWorkerTask task=new BitmapWorkerTask(data,imageView);
    final AsyncDrawable asyncDrawable=new AsyncDrawable(mResources,mLoadingBitmap,task);
    imageView.setImageDrawable(asyncDrawable);
    imageView.setRotation(orientation);
    task.executeOnExecutor(AsyncTask.DUAL_THREAD_EXECUTOR);
  }
}
Program: 4089
Project: 4089
Buggy source:
@Override public void close(){
  cleaner.clean();
}

Fixed version (ground truth):
@Override public void close(){
  if (cleaner != null)   cleaner.clean();
}
Program: 4090
Project: 4090
Buggy source:
public DatenFilm(){
  setupArr();
  filmSize=new MSLong(0);
  databaseFilmNumber=FILM_COUNTER.getAndIncrement();
  DatenFilmCleanupTask task=new DatenFilmCleanupTask(databaseFilmNumber);
  cleaner=Cleaner.create(this,task);
}

Fixed version (ground truth):
public DatenFilm(){
  setupArr();
  filmSize=new MSLong(0);
  databaseFilmNumber=FILM_COUNTER.getAndIncrement();
  if (Functions.getOs() != Functions.OperatingSystemType.WIN32) {
    DatenFilmCleanupTask task=new DatenFilmCleanupTask(databaseFilmNumber);
    cleaner=Cleaner.create(this,task);
  }
}
Program: 4092
Project: 4092
Buggy source:
/** 
 * Main filtering routine
 */
@SuppressWarnings("String_Node_Str") public synchronized void filterListe(){
  final ListeFilme listeFilme=Daten.listeFilme;
  final ListeFilme listeRet=Daten.listeFilmeNachBlackList;
  loadCurrentFilterSettings();
  Duration.counterStart("String_Node_Str");
  listeRet.clear();
  if (listeFilme != null) {
    listeRet.setMeta(listeFilme);
    forEach(entry -> {
      entry.toLower();
      entry.hasPattern();
    }
);
    listeRet.neueFilme=false;
    Stream<DatenFilm> initialStream=listeFilme.parallelStream().filter(this::checkDate);
    filterList.clear();
    if (blacklistIsActive) {
      if (!doNotShowGeoBlockedFilms)       filterList.add(this::checkGeoBlockedFilm);
      if (!doNotShowFutureFilms)       filterList.add(this::checkIfFilmIsInFuture);
      filterList.add(this::checkFilmLength);
      if (!isEmpty())       filterList.add(this::applyBlacklistFilters);
      for (      Predicate pred : filterList) {
        initialStream=initialStream.filter(pred);
      }
    }
    final List<DatenFilm> col=initialStream.collect(Collectors.toList());
    col.parallelStream().filter(DatenFilm::isNew).findFirst().ifPresent(ignored -> listeRet.neueFilme=true);
    listeRet.addAll(col);
    col.clear();
    listeRet.themenLaden();
  }
  Duration.counterStop("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Main filtering routine
 */
@SuppressWarnings("String_Node_Str") public synchronized void filterListe(){
  final ListeFilme listeFilme=Daten.listeFilme;
  final ListeFilme listeRet=Daten.listeFilmeNachBlackList;
  loadCurrentFilterSettings();
  Duration.counterStart("String_Node_Str");
  listeRet.clear();
  if (listeFilme != null) {
    listeRet.setMeta(listeFilme);
    forEach(entry -> {
      entry.toLower();
      entry.hasPattern();
    }
);
    listeRet.neueFilme=false;
    Stream<DatenFilm> initialStream=listeFilme.parallelStream().filter(this::checkDate);
    filterList.clear();
    if (blacklistIsActive) {
      if (doNotShowGeoBlockedFilms)       filterList.add(this::checkGeoBlockedFilm);
      if (doNotShowFutureFilms)       filterList.add(this::checkIfFilmIsInFuture);
      filterList.add(this::checkFilmLength);
      if (!isEmpty())       filterList.add(this::applyBlacklistFilters);
      for (      Predicate pred : filterList) {
        initialStream=initialStream.filter(pred);
      }
    }
    final List<DatenFilm> col=initialStream.collect(Collectors.toList());
    col.parallelStream().filter(DatenFilm::isNew).findFirst().ifPresent(ignored -> listeRet.neueFilme=true);
    listeRet.addAll(col);
    col.clear();
    listeRet.themenLaden();
  }
  Duration.counterStop("String_Node_Str");
}
Program: 4093
Project: 4093
Buggy source:
private void hide(MVFrame frame,PanelVorlage panelVorlage){
  panelVorlage.solo=true;
  if (frame != null) {
    frame.dispose();
    frame=null;
  }
  if (tabContain(panelVorlage)) {
    jTabbedPane.remove(panelVorlage);
  }
}

Fixed version (ground truth):
private void hide(MVFrame frame,PanelVorlage panelVorlage){
  panelVorlage.solo=true;
  if (frame != null) {
    frame.dispose();
  }
  if (tabContain(panelVorlage)) {
    jTabbedPane.remove(panelVorlage);
  }
}
Program: 4094
Project: 4094
Buggy source:
public ArrayList<String> getPfade(){
  ArrayList<String> pfade=new ArrayList<>();
  for (  DatenAbo abo : this) {
    String s=abo.arr[DatenAbo.ABO_ZIELPFAD];
    if (!pfade.contains(s)) {
      pfade.add(abo.arr[DatenAbo.ABO_ZIELPFAD]);
    }
  }
  GermanStringSorter sorter=GermanStringSorter.getInstance();
  Collections.sort(pfade,sorter);
  return pfade;
}

Fixed version (ground truth):
public ArrayList<String> getPfade(){
  ArrayList<String> pfade=new ArrayList<>();
  for (  DatenAbo abo : this) {
    String s=abo.arr[DatenAbo.ABO_ZIELPFAD];
    if (!pfade.contains(s)) {
      pfade.add(abo.arr[DatenAbo.ABO_ZIELPFAD]);
    }
  }
  GermanStringSorter sorter=GermanStringSorter.getInstance();
  pfade.sort(sorter);
  return pfade;
}
Program: 4095
Project: 4095
Buggy source:
public void setAboFuerFilm(ListeFilme listeFilme,boolean aboLoeschen){
  Duration.counterStart("String_Node_Str");
  if (this.isEmpty() && aboLoeschen) {
    DatenFilm datenFilm;
    Iterator<DatenFilm> iteratorFilm=listeFilme.iterator();
    while (iteratorFilm.hasNext()) {
      datenFilm=iteratorFilm.next();
      datenFilm.arr[DatenFilm.FILM_ABO_NAME]="String_Node_Str";
      datenFilm.abo=null;
    }
    return;
  }
  this.stream().filter((datenAbo) -> (datenAbo.isEmpty())).forEach((datenAbo) -> {
    this.remove(datenAbo);
  }
);
  this.stream().forEach(datenAbo -> {
    if (datenAbo.arr[DatenAbo.ABO_TITEL].isEmpty()) {
      datenAbo.titel=LEER;
    }
 else {
      datenAbo.titel=Filter.isPattern(datenAbo.arr[DatenAbo.ABO_TITEL]) ? new String[]{datenAbo.arr[DatenAbo.ABO_TITEL]} : datenAbo.arr[DatenAbo.ABO_TITEL].toLowerCase().split("String_Node_Str");
    }
    if (datenAbo.arr[DatenAbo.ABO_THEMA_TITEL].isEmpty()) {
      datenAbo.thema=LEER;
    }
 else {
      datenAbo.thema=Filter.isPattern(datenAbo.arr[DatenAbo.ABO_THEMA_TITEL]) ? new String[]{datenAbo.arr[DatenAbo.ABO_THEMA_TITEL]} : datenAbo.arr[DatenAbo.ABO_THEMA_TITEL].toLowerCase().split("String_Node_Str");
    }
    if (datenAbo.arr[DatenAbo.ABO_IRGENDWO].isEmpty()) {
      datenAbo.irgendwo=LEER;
    }
 else {
      datenAbo.irgendwo=Filter.isPattern(datenAbo.arr[DatenAbo.ABO_IRGENDWO]) ? new String[]{datenAbo.arr[DatenAbo.ABO_IRGENDWO]} : datenAbo.arr[DatenAbo.ABO_IRGENDWO].toLowerCase().split("String_Node_Str");
    }
  }
);
  listeFilme.stream().parallel().forEach(film -> {
    film.arr[DatenFilm.FILM_ABO_NAME]="String_Node_Str";
    film.abo=null;
    try {
      DatenAbo aa=this.stream().filter(abo -> Filter.filterAufFilmPruefen(abo.arr[DatenAbo.ABO_SENDER],abo.arr[DatenAbo.ABO_THEMA],abo.titel,abo.thema,abo.irgendwo,abo.mindestdauerMinuten,abo.min,film,false)).findFirst().get();
      if (aa != null) {
        if (!Filter.laengePruefen(aa.mindestdauerMinuten,film.dauerL,aa.min)) {
          film.arr[DatenFilm.FILM_ABO_NAME]=aa.arr[DatenAbo.ABO_NAME] + (aa.min ? "String_Node_Str" : "String_Node_Str");
          film.abo=aa;
        }
 else {
          film.arr[DatenFilm.FILM_ABO_NAME]=aa.arr[DatenAbo.ABO_NAME];
          film.abo=aa;
        }
      }
    }
 catch (    NoSuchElementException ignore) {
    }
  }
);
  this.stream().forEach(datenAbo -> {
    datenAbo.titel=LEER;
    datenAbo.thema=LEER;
    datenAbo.irgendwo=LEER;
  }
);
  Duration.counterStop("String_Node_Str");
}

Fixed version (ground truth):
public void setAboFuerFilm(ListeFilme listeFilme,boolean aboLoeschen){
  Duration.counterStart("String_Node_Str");
  if (this.isEmpty() && aboLoeschen) {
    listeFilme.parallelStream().forEach(this::deleteAboInFilm);
    return;
  }
  this.stream().filter((datenAbo) -> (datenAbo.isEmpty())).forEach(this::remove);
  forEach(this::createAbo);
  listeFilme.parallelStream().forEach(this::assignAboToFilm);
  forEach(datenAbo -> {
    datenAbo.titel=LEER;
    datenAbo.thema=LEER;
    datenAbo.irgendwo=LEER;
  }
);
  Duration.counterStop("String_Node_Str");
}
Program: 4096
Project: 4096
Buggy source:
public void addObjectData(TModelAbo model,String sender){
  Object[] object;
  DatenAbo datenAbo;
  model.setRowCount(0);
  Iterator<DatenAbo> iterator=this.iterator();
  object=new Object[DatenAbo.MAX_ELEM];
  while (iterator.hasNext()) {
    datenAbo=iterator.next();
    if (sender.isEmpty() || sender.equals(datenAbo.arr[DatenAbo.ABO_SENDER])) {
      for (int m=0; m < DatenAbo.MAX_ELEM; ++m) {
        if (m == DatenAbo.ABO_NR) {
          object[m]=datenAbo.nr;
        }
 else         if (m == DatenAbo.ABO_MINDESTDAUER) {
          object[m]=datenAbo.mindestdauerMinuten;
        }
 else         if (m == DatenAbo.ABO_DOWN_DATUM) {
          object[m]=getDatumForObject(datenAbo.arr[DatenAbo.ABO_DOWN_DATUM]);
        }
 else         if (m == DatenAbo.ABO_EINGESCHALTET) {
          object[m]="String_Node_Str";
        }
 else         if (m == DatenAbo.ABO_MIN) {
          object[m]=datenAbo.min ? "String_Node_Str" : "String_Node_Str";
        }
 else         if (m != DatenAbo.ABO_NAME && !DatenAbo.anzeigen(m)) {
          object[m]="String_Node_Str";
        }
 else {
          object[m]=datenAbo.arr[m];
        }
      }
      model.addRow(object);
    }
  }
}

Fixed version (ground truth):
public void addObjectData(TModelAbo model,String sender){
  model.setRowCount(0);
  Object[] object=new Object[DatenAbo.MAX_ELEM];
  for (  DatenAbo datenAbo : this) {
    if (sender.isEmpty() || sender.equals(datenAbo.arr[DatenAbo.ABO_SENDER])) {
      for (int m=0; m < DatenAbo.MAX_ELEM; ++m) {
        if (m == DatenAbo.ABO_NR) {
          object[m]=datenAbo.nr;
        }
 else         if (m == DatenAbo.ABO_MINDESTDAUER) {
          object[m]=datenAbo.mindestdauerMinuten;
        }
 else         if (m == DatenAbo.ABO_DOWN_DATUM) {
          object[m]=getDatumForObject(datenAbo.arr[DatenAbo.ABO_DOWN_DATUM]);
        }
 else         if (m == DatenAbo.ABO_EINGESCHALTET) {
          object[m]="String_Node_Str";
        }
 else         if (m == DatenAbo.ABO_MIN) {
          object[m]=datenAbo.min ? "String_Node_Str" : "String_Node_Str";
        }
 else         if (m != DatenAbo.ABO_NAME && !DatenAbo.anzeigen(m)) {
          object[m]="String_Node_Str";
        }
 else {
          object[m]=datenAbo.arr[m];
        }
      }
      model.addRow(object);
    }
  }
}
Program: 4097
Project: 4097
Buggy source:
/** 
 * Return the number of Starts, which are queued in state INIT or RUN.
 * @return number of queued Starts.
 */
public synchronized int getNumberOfStartsNotFinished(){
  Iterator<DatenDownload> it=this.iterator();
  while (it.hasNext()) {
    Start s=it.next().start;
    if (s != null) {
      if (s.status < Start.STATUS_FERTIG) {
        return this.size();
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Return the number of Starts, which are queued in state INIT or RUN.
 * @return number of queued Starts.
 */
public synchronized int getNumberOfStartsNotFinished(){
  for (  DatenDownload datenDownload : this) {
    Start s=datenDownload.start;
    if (s != null) {
      if (s.status < Start.STATUS_FERTIG) {
        return this.size();
      }
    }
  }
  return 0;
}
Program: 4098
Project: 4098
Buggy source:
private boolean getDown(int max){
  int count=0;
  Iterator<DatenDownload> it=this.iterator();
  while (it.hasNext()) {
    Start s=it.next().start;
    if (s != null) {
      if (s.status == Start.STATUS_RUN) {
        ++count;
        if (count >= max) {
          return false;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean getDown(int max){
  int count=0;
  for (  DatenDownload datenDownload : this) {
    Start s=datenDownload.start;
    if (s != null) {
      if (s.status == Start.STATUS_RUN) {
        ++count;
        if (count >= max) {
          return false;
        }
      }
    }
  }
  return true;
}
Program: 4099
Project: 4099
Buggy source:
public ResetSettingsPanel(JFrame pparent,Daten ddaten){
  initComponents();
  parent=pparent;
  daten=ddaten;
  jButtonHilfeReset.setIcon(Icons.ICON_BUTTON_HELP);
  jButtonHilfeReset.addActionListener(e -> new DialogHilfe(Daten.mediathekGui,true,new GetFile().getHilfeSuchen(GetFile.PFAD_HILFETEXT_RESET)).setVisible(true));
  jButtonResetSets.addActionListener(e -> {
    Daten.listePset.clear();
    GuiFunktionenProgramme.addSetVorlagen(parent,daten,ListePsetVorlagen.getStandarset(parent,daten,true),false,true);
    Listener.notify(Listener.EREIGNIS_LISTE_PSET,ResetSettingsPanel.class.getSimpleName());
  }
);
  jButtonResetAll.addActionListener(e -> {
    int ret=JOptionPane.showConfirmDialog(parent,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
    if (ret == JOptionPane.OK_OPTION) {
      Daten.RESET=true;
      Daten.mediathekGui.beenden(false,false);
    }
  }
);
}

Fixed version (ground truth):
public ResetSettingsPanel(JFrame pparent,Daten ddaten){
  initComponents();
  parent=pparent;
  daten=ddaten;
  jButtonHilfeReset.setIcon(Icons.ICON_BUTTON_HELP);
  jButtonHilfeReset.addActionListener(e -> new DialogHilfe(parent,true,new GetFile().getHilfeSuchen(GetFile.PFAD_HILFETEXT_RESET)).setVisible(true));
  jButtonResetSets.addActionListener(e -> {
    Daten.listePset.clear();
    GuiFunktionenProgramme.addSetVorlagen(parent,daten,ListePsetVorlagen.getStandarset(parent,daten,true),false,true);
    Listener.notify(Listener.EREIGNIS_LISTE_PSET,ResetSettingsPanel.class.getSimpleName());
  }
);
  jButtonResetAll.addActionListener(e -> {
    int ret=JOptionPane.showConfirmDialog(parent,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION);
    if (ret == JOptionPane.OK_OPTION) {
      Daten.RESET=true;
      Daten.mediathekGui.beenden(false,false);
    }
  }
);
}
Program: 4100
Project: 4100
Buggy source:
public static final Daten getInstance(){
  return instance == null ? new Daten() : instance;
}

Fixed version (ground truth):
public static final Daten getInstance(){
  return instance == null ? instance=new Daten() : instance;
}
Program: 4101
Project: 4101
Buggy source:
public PanelFilmBeschreibung(JFrame pparent,Daten dd){
  initComponents();
  parent=pparent;
  daten=dd;
  jCheckBoxBeschreibung.setIcon(GetIcon.getProgramIcon("String_Node_Str"));
  jCheckBoxBeschreibung.addActionListener(e -> {
    Daten.mVConfig.add(MVConfig.SYSTEM_PANEL_BESCHREIBUNG_ANZEIGEN,Boolean.FALSE.toString());
    ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_PANEL_BESCHREIBUNG_ANZEIGEN,PanelFilmBeschreibung.class.getSimpleName());
  }
);
  jXHyperlinkWebsite.addMouseListener(new BeobMausUrl(jXHyperlinkWebsite));
  jCheckBoxChange.setIcon(GetIcon.getProgramIcon("String_Node_Str"));
  jCheckBoxChange.addActionListener(e -> {
    if (aktFilm != null) {
      String akt=aktFilm.arr[DatenFilm.FILM_BESCHREIBUNG_NR];
      new DialogFilmBeschreibung(parent,daten,aktFilm).setVisible(true);
      if (!aktFilm.arr[DatenFilm.FILM_BESCHREIBUNG_NR].equals(akt)) {
        setText();
        Daten.filmlisteSpeichern();
        ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_BESCHREIBUNG,PanelFilmBeschreibung.class.getSimpleName());
      }
    }
  }
);
  ListenerMediathekView.addListener(new ListenerMediathekView(ListenerMediathekView.EREIGNIS_FONT,PanelFilmBeschreibung.class.getSimpleName()){
    @Override public void ping(){
      setText();
    }
  }
);
}

Fixed version (ground truth):
public PanelFilmBeschreibung(JFrame pparent,Daten dd){
  initComponents();
  parent=pparent;
  daten=dd;
  jCheckBoxBeschreibung.setIcon(GetIcon.getProgramIcon("String_Node_Str"));
  jCheckBoxBeschreibung.addActionListener(e -> {
    Daten.mVConfig.add(MVConfig.SYSTEM_PANEL_BESCHREIBUNG_ANZEIGEN,Boolean.FALSE.toString());
    ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_PANEL_BESCHREIBUNG_ANZEIGEN,PanelFilmBeschreibung.class.getSimpleName());
  }
);
  try {
    jXHyperlinkWebsite.setAction(new UrlHyperlinkAction(parent,"String_Node_Str"));
  }
 catch (  URISyntaxException ignored) {
    jXHyperlinkWebsite.setText("String_Node_Str");
  }
  jXHyperlinkWebsite.addMouseListener(new BeobMausUrl(jXHyperlinkWebsite));
  jCheckBoxChange.setIcon(GetIcon.getProgramIcon("String_Node_Str"));
  jCheckBoxChange.addActionListener(e -> {
    if (aktFilm != null) {
      String akt=aktFilm.arr[DatenFilm.FILM_BESCHREIBUNG_NR];
      new DialogFilmBeschreibung(parent,daten,aktFilm).setVisible(true);
      if (!aktFilm.arr[DatenFilm.FILM_BESCHREIBUNG_NR].equals(akt)) {
        setText();
        Daten.filmlisteSpeichern();
        ListenerMediathekView.notify(ListenerMediathekView.EREIGNIS_BESCHREIBUNG,PanelFilmBeschreibung.class.getSimpleName());
      }
    }
  }
);
  ListenerMediathekView.addListener(new ListenerMediathekView(ListenerMediathekView.EREIGNIS_FONT,PanelFilmBeschreibung.class.getSimpleName()){
    @Override public void ping(){
      setText();
    }
  }
);
}
Program: 4102
Project: 4102
Buggy source:
/** 
 * like this @section('sidebar')
 */
private void collectOverwrittenSection(final PsiElement psiElement,@NotNull Collection<LineMarkerInfo> collection,@NotNull String sectionName,@NotNull LazyVirtualFileTemplateResolver resolver){
  final List<GotoRelatedItem> gotoRelatedItems=new ArrayList<>();
  for (  PsiElement psiElement1 : psiElement.getContainingFile().getChildren()) {
    PsiElement extendDirective=psiElement1.getFirstChild();
    if (extendDirective != null && extendDirective.getNode().getElementType() == BladeTokenTypes.EXTENDS_DIRECTIVE) {
      PsiElement bladeParameter=extendDirective.getNextSibling();
      if (bladeParameter instanceof BladePsiDirectiveParameter) {
        String extendTemplate=BladePsiUtil.getSection(bladeParameter);
        if (extendTemplate != null) {
          for (          VirtualFile virtualFile : resolver.resolveTemplateName(psiElement.getProject(),extendTemplate)) {
            PsiFile psiFile=PsiManager.getInstance(psiElement.getProject()).findFile(virtualFile);
            if (psiFile != null) {
              visitOverwrittenTemplateFile(psiFile,gotoRelatedItems,sectionName,resolver);
            }
          }
        }
      }
    }
  }
  if (gotoRelatedItems.size() == 0) {
    return;
  }
  collection.add(getRelatedPopover("String_Node_Str","String_Node_Str",psiElement,gotoRelatedItems,PhpIcons.OVERRIDES));
}

Fixed version (ground truth):
/** 
 * Like this @section('sidebar')
 */
@NotNull private Collection<LineMarkerInfo> collectOverwrittenSection(@NotNull LeafPsiElement psiElement,@NotNull String sectionName,@NotNull LazyVirtualFileTemplateResolver resolver){
  List<GotoRelatedItem> gotoRelatedItems=new ArrayList<>();
  for (  PsiElement psiElement1 : psiElement.getContainingFile().getChildren()) {
    PsiElement extendDirective=psiElement1.getFirstChild();
    if (extendDirective != null && extendDirective.getNode().getElementType() == BladeTokenTypes.EXTENDS_DIRECTIVE) {
      PsiElement bladeParameter=extendDirective.getNextSibling();
      if (bladeParameter instanceof BladePsiDirectiveParameter) {
        String extendTemplate=BladePsiUtil.getSection(bladeParameter);
        if (extendTemplate != null) {
          for (          VirtualFile virtualFile : resolver.resolveTemplateName(psiElement.getProject(),extendTemplate)) {
            PsiFile psiFile=PsiManager.getInstance(psiElement.getProject()).findFile(virtualFile);
            if (psiFile != null) {
              visitOverwrittenTemplateFile(psiFile,gotoRelatedItems,sectionName,resolver);
            }
          }
        }
      }
    }
  }
  if (gotoRelatedItems.size() == 0) {
    return Collections.emptyList();
  }
  return Collections.singletonList(getRelatedPopover("String_Node_Str","String_Node_Str",psiElement,gotoRelatedItems,PhpIcons.OVERRIDES));
}
Program: 4103
Project: 4103
Buggy source:
private LineMarkerInfo getRelatedPopover(String singleItemTitle,String singleItemTooltipPrefix,PsiElement lineMarkerTarget,Collection<GotoRelatedItem> gotoRelatedItems,Icon icon){
  String title=singleItemTitle;
  if (gotoRelatedItems.size() == 1) {
    String customName=gotoRelatedItems.iterator().next().getCustomName();
    if (customName != null) {
      title=String.format(singleItemTooltipPrefix,customName);
    }
  }
  return new LineMarkerInfo<>(lineMarkerTarget,lineMarkerTarget.getTextRange(),icon,6,new ConstantFunction<>(title),new RelatedPopupGotoLineMarker.NavigationHandler(gotoRelatedItems),GutterIconRenderer.Alignment.RIGHT);
}

Fixed version (ground truth):
@NotNull private LineMarkerInfo getRelatedPopover(@NotNull String singleItemTitle,@NotNull String singleItemTooltipPrefix,@NotNull PsiElement lineMarkerTarget,@NotNull Collection<GotoRelatedItem> gotoRelatedItems,@NotNull Icon icon){
  String title=singleItemTitle;
  if (gotoRelatedItems.size() == 1) {
    String customName=gotoRelatedItems.iterator().next().getCustomName();
    if (customName != null) {
      title=String.format(singleItemTooltipPrefix,customName);
    }
  }
  return new LineMarkerInfo<>(lineMarkerTarget,lineMarkerTarget.getTextRange(),icon,6,new ConstantFunction<>(title),new RelatedPopupGotoLineMarker.NavigationHandler(gotoRelatedItems),GutterIconRenderer.Alignment.RIGHT);
}
Program: 4104
Project: 4104
Buggy source:
/** 
 * Support: @stack('foobar')
 */
private void collectStackImplements(@NotNull PsiElement psiElement,@NotNull Collection<LineMarkerInfo> collection,@NotNull String sectionName,@NotNull LazyVirtualFileTemplateResolver resolver){
  Collection<String> templateNames=resolver.resolveTemplateName(psiElement.getContainingFile());
  if (templateNames.size() == 0) {
    return;
  }
  final List<GotoRelatedItem> gotoRelatedItems=new ArrayList<>();
  Set<VirtualFile> virtualFiles=BladeTemplateUtil.getExtendsImplementations(psiElement.getProject(),templateNames);
  if (virtualFiles.size() == 0) {
    return;
  }
  for (  VirtualFile virtualFile : virtualFiles) {
    PsiFile psiFile=PsiManager.getInstance(psiElement.getProject()).findFile(virtualFile);
    if (psiFile != null) {
      BladeTemplateUtil.visit(psiFile,BladeTokenTypes.PUSH_DIRECTIVE,parameter -> {
        if (sectionName.equalsIgnoreCase(parameter.getContent())) {
          gotoRelatedItems.add(new RelatedPopupGotoLineMarker.PopupGotoRelatedItem(parameter.getPsiElement()).withIcon(LaravelIcons.LARAVEL,LaravelIcons.LARAVEL));
        }
      }
);
    }
  }
  if (gotoRelatedItems.size() == 0) {
    return;
  }
  collection.add(getRelatedPopover("String_Node_Str","String_Node_Str",psiElement,gotoRelatedItems,PhpIcons.IMPLEMENTED));
}

Fixed version (ground truth):
/** 
 * Support: @stack('foobar')
 */
@NotNull private Collection<LineMarkerInfo> collectStackImplements(@NotNull LeafPsiElement psiElement,@NotNull String sectionName,@NotNull LazyVirtualFileTemplateResolver resolver){
  Collection<String> templateNames=resolver.resolveTemplateName(psiElement.getContainingFile());
  if (templateNames.size() == 0) {
    return Collections.emptyList();
  }
  List<GotoRelatedItem> gotoRelatedItems=new ArrayList<>();
  Set<VirtualFile> virtualFiles=BladeTemplateUtil.getExtendsImplementations(psiElement.getProject(),templateNames);
  if (virtualFiles.size() == 0) {
    return Collections.emptyList();
  }
  for (  VirtualFile virtualFile : virtualFiles) {
    PsiFile psiFile=PsiManager.getInstance(psiElement.getProject()).findFile(virtualFile);
    if (psiFile != null) {
      BladeTemplateUtil.visit(psiFile,BladeTokenTypes.PUSH_DIRECTIVE,parameter -> {
        if (sectionName.equalsIgnoreCase(parameter.getContent())) {
          gotoRelatedItems.add(new RelatedPopupGotoLineMarker.PopupGotoRelatedItem(parameter.getPsiElement()).withIcon(LaravelIcons.LARAVEL,LaravelIcons.LARAVEL));
        }
      }
);
    }
  }
  if (gotoRelatedItems.size() == 0) {
    return Collections.emptyList();
  }
  return Collections.singletonList(getRelatedPopover("String_Node_Str","String_Node_Str",psiElement,gotoRelatedItems,PhpIcons.IMPLEMENTED));
}