nus-yam/ex-repair huggingface dataset:
Program: 87273
Project: 87273
Buggy source:
/** 
 * Acquire a shared lock only if it can be done in the given time.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if the exclusive lock was acquired; false o/w or if timeout was <= 0
 * @throws InterruptedException if the thread is interrupted
 */
boolean tryAcquireShared(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  try {
    if (holds.get().count > 0) {
      holds.get().count++;
    }
 else {
      while (!(writeCount.get() == 0 && writeLockedBy.get() == NONE)) {
        if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
          return false;
        }
      }
      holds.get().count=1;
      numberOfThreads++;
    }
  }
  finally {
    monitor.unlock();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Acquire a shared lock only if it can be done in the given time.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if the exclusive lock was acquired; false o/w or if timeout was <= 0
 * @throws InterruptedException if the thread is interrupted
 */
boolean tryAcquireShared(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  try {
    if (holds.get().count > 0) {
      holds.get().count++;
    }
 else {
      while (!(writeCount.get() == 0 && writeLockedBy.get() == NONE)) {
        if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
          return false;
        }
      }
      holds.get().count=1;
      numberOfThreads++;
    }
  }
  finally {
    monitor.unlock();
  }
  return true;
}
Program: 87274
Project: 87274
Buggy source:
@Override public void lockInterruptibly() throws InterruptedException {
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void lockInterruptibly() throws InterruptedException {
  addToQueuedThreads();
  try {
    lockImpl.acquireExclusive();
    writeHolds.get().count++;
  }
  finally {
    removeFromQueuedThreads();
  }
}
Program: 87275
Project: 87275
Buggy source:
public long remainingMillis(){
  return completedMillis - System.currentTimeMillis();
}

Fixed version (ground truth):
public long remainingMillis(){
  long remainingMillis=completedMillis - System.currentTimeMillis();
  return remainingMillis >= 0 ? remainingMillis : 0;
}
Program: 87276
Project: 87276
Buggy source:
/** 
 * Release a read or write lock.
 * @throws IllegalMonitorStateException if the current thread holds no locks
 */
void release(){
  monitor.lock();
  try {
    if (holds.get().tryDecrement() == 0) {
      numberOfThreads--;
      writeLockedBy=NONE;
      isWriteLocked.set(FALSE);
      holds.remove();
      lockAvailable.signalAll();
    }
  }
  finally {
    monitor.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Release a read or write lock.
 * @throws IllegalMonitorStateException if the current thread holds no locks
 */
void release(){
  monitor.lock();
  try {
    if (holds.get().tryDecrement() == 0) {
      numberOfThreads.decrementAndGet();
      writeLockedBy=NONE;
      isWriteLocked.set(FALSE);
      holds.remove();
      lockAvailable.signalAll();
    }
  }
  finally {
    monitor.unlock();
  }
}
Program: 87277
Project: 87277
Buggy source:
/** 
 * Acquire a read lock.
 * @throws InterruptedException if the current thread is interrupted
 */
void acquireShared() throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  monitor.lockInterruptibly();
  if (holds.get().count > 0) {
    holds.get().count++;
  }
 else {
    while (!(writersWaiting.get() == 0 && isWriteLocked.get() == FALSE)) {
      lockAvailable.await();
    }
    holds.get().count=1;
    numberOfThreads++;
  }
  monitor.unlock();
}

Fixed version (ground truth):
/** 
 * Acquire a read lock.
 * @throws InterruptedException if the current thread is interrupted
 */
void acquireShared() throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  monitor.lockInterruptibly();
  if (holds.get().count > 0) {
    holds.get().count++;
  }
 else {
    while (!(writersWaiting.get() == 0 && isWriteLocked.get() == FALSE)) {
      lockAvailable.await();
    }
    holds.get().count=1;
    numberOfThreads.incrementAndGet();
  }
  monitor.unlock();
}
Program: 87278
Project: 87278
Buggy source:
/** 
 * Try and acquire an exclusive lock if it can be done in the time allowed.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if lock acquired; false o/w or if timeout is <= 0
 * @throws InterruptedException
 */
boolean tryAcquireExclusive(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  final long tid=getThread().getId();
  if (writeLockedBy == tid) {
    holds.get().count++;
  }
 else {
    writersWaiting.incrementAndGet();
    while (numberOfThreads > 0) {
      try {
        if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
          writersWaiting.decrementAndGet();
          monitor.unlock();
          return false;
        }
      }
 catch (      InterruptedException e) {
        writersWaiting.decrementAndGet();
        throw e;
      }
    }
    writersWaiting.decrementAndGet();
    holds.get().count=1;
    writeLockedBy=tid;
    isWriteLocked.set(TRUE);
    numberOfThreads++;
  }
  monitor.unlock();
  return true;
}

Fixed version (ground truth):
/** 
 * Try and acquire an exclusive lock if it can be done in the time allowed.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if lock acquired; false o/w or if timeout is <= 0
 * @throws InterruptedException
 */
boolean tryAcquireExclusive(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  final long tid=getThread().getId();
  if (writeLockedBy == tid) {
    holds.get().count++;
  }
 else {
    writersWaiting.incrementAndGet();
    while (numberOfThreads.get() > 0) {
      try {
        if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
          writersWaiting.decrementAndGet();
          monitor.unlock();
          return false;
        }
      }
 catch (      InterruptedException e) {
        writersWaiting.decrementAndGet();
        throw e;
      }
    }
    writersWaiting.decrementAndGet();
    holds.get().count=1;
    writeLockedBy=tid;
    isWriteLocked.set(TRUE);
    numberOfThreads.incrementAndGet();
  }
  monitor.unlock();
  return true;
}
Program: 87279
Project: 87279
Buggy source:
/** 
 * Acquire a write lock.
 * @throws InterruptedException if the current thread is interrupted
 */
void acquireExclusive() throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  monitor.lockInterruptibly();
  final long tid=getThread().getId();
  if (writeLockedBy == tid) {
    holds.get().count++;
  }
 else {
    writersWaiting.incrementAndGet();
    while (numberOfThreads > 0) {
      try {
        lockAvailable.await();
      }
 catch (      InterruptedException e) {
        writersWaiting.decrementAndGet();
        throw e;
      }
    }
    writersWaiting.decrementAndGet();
    holds.get().count=1;
    writeLockedBy=tid;
    isWriteLocked.set(TRUE);
    numberOfThreads++;
  }
  monitor.unlock();
}

Fixed version (ground truth):
/** 
 * Acquire a write lock.
 * @throws InterruptedException if the current thread is interrupted
 */
void acquireExclusive() throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  monitor.lockInterruptibly();
  final long tid=getThread().getId();
  if (writeLockedBy == tid) {
    holds.get().count++;
  }
 else {
    writersWaiting.incrementAndGet();
    while (numberOfThreads.get() > 0) {
      try {
        lockAvailable.await();
      }
 catch (      InterruptedException e) {
        writersWaiting.decrementAndGet();
        throw e;
      }
    }
    writersWaiting.decrementAndGet();
    holds.get().count=1;
    writeLockedBy=tid;
    isWriteLocked.set(TRUE);
    numberOfThreads.incrementAndGet();
  }
  monitor.unlock();
}
Program: 87280
Project: 87280
Buggy source:
void forceUnlock(){
  monitor.lock();
  try {
    isWriteLocked.set(FALSE);
    lockAvailable.signalAll();
  }
  finally {
    monitor.unlock();
  }
}

Fixed version (ground truth):
void forceUnlock(){
  monitor.lock();
  try {
    isWriteLocked.set(FALSE);
    numberOfThreads.decrementAndGet();
    lockAvailable.signalAll();
  }
  finally {
    monitor.unlock();
  }
}
Program: 87281
Project: 87281
Buggy source:
LockImpl(final DistributedDataStructureFactory grid,final String lockName){
  this.monitor=grid.getLock(getMonitorName(lockName));
  this.lockAvailable=grid.getCondition(monitor,getConditionName(lockName));
  this.writersWaiting=grid.getAtomicLong(getWritersWaitingName(lockName));
  this.isWriteLocked=grid.getAtomicLong(getIsWriteLockedName(lockName));
}

Fixed version (ground truth):
LockImpl(final DistributedDataStructureFactory grid,final String lockName){
  this.monitor=grid.getLock(getMonitorName(lockName));
  this.lockAvailable=grid.getCondition(monitor,getConditionName(lockName));
  this.writersWaiting=grid.getAtomicLong(getWritersWaitingName(lockName));
  this.isWriteLocked=grid.getAtomicLong(getIsWriteLockedName(lockName));
  this.numberOfThreads=grid.getAtomicLong(getNumberOfThreadsName(lockName));
}
Program: 87282
Project: 87282
Buggy source:
/** 
 * Acquire a shared lock only if it can be done in the given time.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if the exclusive lock was acquired; false o/w or if timeout was <= 0
 * @throws InterruptedException if the thread is interrupted
 */
boolean tryAcquireShared(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  if (holds.get().count > 0) {
    holds.get().count++;
  }
 else {
    while (!(writersWaiting.get() == 0 && isWriteLocked.get() == FALSE)) {
      if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
        monitor.unlock();
        return false;
      }
    }
    holds.get().count=1;
    numberOfThreads++;
  }
  monitor.unlock();
  return true;
}

Fixed version (ground truth):
/** 
 * Acquire a shared lock only if it can be done in the given time.
 * @param l timeout amount
 * @param timeUnit timeout units
 * @return true if the exclusive lock was acquired; false o/w or if timeout was <= 0
 * @throws InterruptedException if the thread is interrupted
 */
boolean tryAcquireShared(final long l,final TimeUnit timeUnit) throws InterruptedException {
  if (getThread().isInterrupted())   throw new InterruptedException();
  if (l <= 0)   return false;
  final ElapsedTimer timer=new ElapsedTimer(timeUnit.toMillis(l));
  if (!monitor.tryLock(timer.remainingMillis(),TimeUnit.MILLISECONDS))   return false;
  if (holds.get().count > 0) {
    holds.get().count++;
  }
 else {
    while (!(writersWaiting.get() == 0 && isWriteLocked.get() == FALSE)) {
      if (!lockAvailable.await(timer.remainingMillis(),TimeUnit.MILLISECONDS)) {
        monitor.unlock();
        return false;
      }
    }
    holds.get().count=1;
    numberOfThreads.incrementAndGet();
  }
  monitor.unlock();
  return true;
}
Program: 87283
Project: 87283
Buggy source:
/** 
 * Sets the opacity of the blurred View
 * @param opacity	Specifies the opacity the blurred View should be set to. Range between 0f and 1f.
 */
public void setBlurOpacity(float opacity){
  if (mBlurredBitmap == null) {
    mBlurredBitmap=applyBlur();
    mBlurImageView.setImageBitmap(mBlurredBitmap);
  }
  if (opacity < 0f)   opacity=0f;
 else   if (opacity > 1f)   opacity=1f;
  mBlurImageView.clearAnimation();
  ViewHelper.setAlpha(mBlurImageView,opacity);
  if (opacity == 0f)   resetBlur();
}

Fixed version (ground truth):
/** 
 * Sets the opacity of the blurred View
 * @param opacity	Specifies the opacity the blurred View should be set to. Range between 0f and 1f.
 */
public void setBlurOpacity(float opacity){
  if (mBlurredBitmap == null) {
    mBlurredBitmap=applyBlur();
    mBlurImageView.setImageBitmap(mBlurredBitmap);
  }
  if (opacity < 0f)   opacity=0f;
 else   if (opacity > 1f)   opacity=1f;
  mBlurImageView.clearAnimation();
  ViewHelper.setAlpha(mBlurImageView,opacity);
  if (opacity == 0f)   reset();
}
Program: 87284
Project: 87284
Buggy source:
/** 
 * Applies the blur
 */
private Bitmap applyBlur(){
  mOriginalView.buildDrawingCache();
  Bitmap originalBitmap=mOriginalView.getDrawingCache().copy(Config.ARGB_8888,true);
  mOriginalView.destroyDrawingCache();
  Bitmap resultBitmap=Bitmap.createScaledBitmap(originalBitmap,originalBitmap.getWidth() / mScaleSize,originalBitmap.getHeight() / mScaleSize,true);
  if (mBlurRadius > 0f) {
    RenderScript renderScript=RenderScript.create(mContext);
    final Allocation input=Allocation.createFromBitmap(renderScript,resultBitmap,Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED);
    final Allocation output=Allocation.createFromBitmap(renderScript,resultBitmap,Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED);
    final ScriptIntrinsicBlur script=ScriptIntrinsicBlur.create(renderScript,Element.U8_4(renderScript));
    script.setRadius(mBlurRadius);
    script.setInput(input);
    script.forEach(output);
    renderScript.finish();
    output.copyTo(resultBitmap);
    renderScript.destroy();
    renderScript=null;
  }
  return resultBitmap;
}

Fixed version (ground truth):
/** 
 * Applies the blur
 */
private Bitmap applyBlur(){
  Bitmap resultBitmap=null;
  try {
    System.gc();
    mOriginalView.buildDrawingCache();
    Bitmap originalBitmap=mOriginalView.getDrawingCache().copy(Config.ARGB_8888,true);
    mOriginalView.destroyDrawingCache();
    resultBitmap=Bitmap.createScaledBitmap(originalBitmap,originalBitmap.getWidth() / mScaleSize,originalBitmap.getHeight() / mScaleSize,true);
    originalBitmap.recycle();
    originalBitmap=null;
    if (mBlurRadius > 0f) {
      RenderScript renderScript=RenderScript.create(mContext);
      final Allocation input=Allocation.createFromBitmap(renderScript,resultBitmap,Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED);
      final Allocation output=Allocation.createFromBitmap(renderScript,resultBitmap,Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED);
      final ScriptIntrinsicBlur script=ScriptIntrinsicBlur.create(renderScript,Element.U8_4(renderScript));
      script.setRadius(mBlurRadius);
      script.setInput(input);
      script.forEach(output);
      renderScript.finish();
      output.copyTo(resultBitmap);
      renderScript.destroy();
      renderScript=null;
    }
  }
 catch (  OutOfMemoryError e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  System.gc();
  return resultBitmap;
}
Program: 87285
Project: 87285
Buggy source:
/** 
 * Sets the opacity of the blurred View with an animation
 * @param opacity	Specifies the opacity the blurred View should be set to. Range between 0f and 1f.
 * @param duration	Specifies the duration of the animation (in milliseconds)
 */
public void animateBlurOpacity(float opacity,long duration){
  if (mBlurredBitmap == null) {
    mBlurredBitmap=applyBlur();
    mBlurImageView.setImageBitmap(mBlurredBitmap);
  }
  if (opacity < 0f)   opacity=0f;
 else   if (opacity > 1f)   opacity=1f;
  AlphaAnimation alphaAnimation=new AlphaAnimation(ViewHelper.getAlpha(mBlurImageView),opacity);
  alphaAnimation.setDuration(duration);
  alphaAnimation.setFillAfter(true);
  ViewHelper.setAlpha(mBlurImageView,1f);
  mBlurImageView.clearAnimation();
  mBlurImageView.startAnimation(alphaAnimation);
  if (opacity == 0f)   resetBlur();
}

Fixed version (ground truth):
/** 
 * Sets the opacity of the blurred View with an animation
 * @param opacity	Specifies the opacity the blurred View should be set to. Range between 0f and 1f.
 * @param duration	Specifies the duration of the animation (in milliseconds)
 */
public void animateBlurOpacity(float opacity,long duration){
  if (mBlurredBitmap == null) {
    mBlurredBitmap=applyBlur();
    mBlurImageView.setImageBitmap(mBlurredBitmap);
  }
  if (opacity < 0f)   opacity=0f;
 else   if (opacity > 1f)   opacity=1f;
  AlphaAnimation alphaAnimation=new AlphaAnimation(ViewHelper.getAlpha(mBlurImageView),opacity);
  alphaAnimation.setDuration(duration);
  alphaAnimation.setFillAfter(true);
  ViewHelper.setAlpha(mBlurImageView,1f);
  mBlurImageView.clearAnimation();
  mBlurImageView.startAnimation(alphaAnimation);
  if (opacity == 0f)   reset();
}
Program: 87286
Project: 87286
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_pip_test);
  Intent intent=getIntent();
  SAMPLE=intent.getStringExtra(Constant.FILE_MSG);
  mSurfaceView=(SurfaceView)findViewById(R.id.surfaceView);
  mSurfaceView.getHolder().addCallback(callback);
  mSettingUtil=new SettingUtil(this);
  mHWCodecEnable=mSettingUtil.isHWCodecEnable();
  mMediaPlayer=new MediaPlayer(this,mHWCodecEnable == 1);
  setupView();
  setupLisenner();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_pip_test);
  Intent intent=getIntent();
  SAMPLE=intent.getStringExtra(Constant.FILE_MSG);
  mSettingUtil=new SettingUtil(this);
  mHWCodecEnable=mSettingUtil.isHWCodecEnable();
  mMediaPlayer=new MediaPlayer(this,mHWCodecEnable == 1);
  setupView();
  setupLisenner();
}
Program: 87287
Project: 87287
Buggy source:
private void setupView(){
  mCtlPanel=(LinearLayout)findViewById(R.id.control_panel);
  mCtlPanel.setVisibility(View.VISIBLE);
  mCtlBar=(RelativeLayout)findViewById(R.id.control_bar);
  mCtlBar.setVisibility(View.VISIBLE);
  mPauseButton=(ImageButton)findViewById(R.id.btn_pause);
  mNextButton=(ImageButton)findViewById(R.id.btn_next);
  mInfoButton=(ImageButton)findViewById(R.id.btn_info);
  mRatioButton=(ImageButton)findViewById(R.id.btn_ratio);
  mSeekBarProgress=(SeekBar)findViewById(R.id.seekbar_time);
  mTextViewCurTime=(TextView)findViewById(R.id.txt_cur);
  mTextViewDuration=(TextView)findViewById(R.id.txt_dur);
  mTextViewInfo=(TextView)findViewById(R.id.txt_info);
  mImageViewSub=(ImageView)findViewById(R.id.iv_sub);
  mImageViewSub.setVisibility(View.VISIBLE);
  DisplayMetrics displayMetrics=new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
  mScreenWidth=displayMetrics.widthPixels;
  mScreenHeight=displayMetrics.heightPixels;
}

Fixed version (ground truth):
private void setupView(){
  mSurfaceView=(SurfaceView)findViewById(R.id.surfaceView);
  mSurfaceView.getHolder().addCallback(callback);
  mCtlPanel=(LinearLayout)findViewById(R.id.control_panel);
  mCtlPanel.setVisibility(View.VISIBLE);
  mCtlBar=(RelativeLayout)findViewById(R.id.control_bar);
  mCtlBar.setVisibility(View.VISIBLE);
  mPauseButton=(ImageButton)findViewById(R.id.btn_pause);
  mNextButton=(ImageButton)findViewById(R.id.btn_next);
  mInfoButton=(ImageButton)findViewById(R.id.btn_info);
  mRatioButton=(ImageButton)findViewById(R.id.btn_ratio);
  mSeekBarProgress=(SeekBar)findViewById(R.id.seekbar_time);
  mTextViewCurTime=(TextView)findViewById(R.id.txt_cur);
  mTextViewDuration=(TextView)findViewById(R.id.txt_dur);
  mTextViewInfo=(TextView)findViewById(R.id.txt_info);
  mImageViewSub=(ImageView)findViewById(R.id.iv_sub);
  mImageViewSub.setVisibility(View.VISIBLE);
  DisplayMetrics displayMetrics=new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
  mScreenWidth=displayMetrics.widthPixels;
  mScreenHeight=displayMetrics.heightPixels;
}
Program: 87288
Project: 87288
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_pip_test);
  mSurfaceView=(SurfaceView)findViewById(R.id.surfaceView);
  mSurfaceView.getHolder().addCallback(callback);
  mMediaPlayer=new MediaPlayer(this,true);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_pip_test);
  Intent intent=getIntent();
  SAMPLE=intent.getStringExtra(Constant.FILE_MSG);
  mSurfaceView=(SurfaceView)findViewById(R.id.surfaceView);
  mSurfaceView.getHolder().addCallback(callback);
  mMediaPlayer=new MediaPlayer(this,true);
}
Program: 87289
Project: 87289
Buggy source:
public void beginToPlayer(Context cr,String uri,String name,int type){
  Intent intent=new Intent();
  intent.putExtra(Constant.FILE_MSG,uri);
  intent.putExtra(Constant.FILE_TYPE,type);
  intent.putExtra(Constant.MEIDA_NAME_STR,name);
  intent.setClass(cr,VideoPlayerActivity.class);
  cr.startActivity(intent);
}

Fixed version (ground truth):
public void beginToPlayer(Context cr,String uri,String name,int type){
  Intent intent=new Intent();
  intent.putExtra(Constant.FILE_MSG,uri);
  intent.putExtra(Constant.FILE_TYPE,type);
  intent.putExtra(Constant.MEIDA_NAME_STR,name);
  intent.setClass(cr,PipTestActivity.class);
  cr.startActivity(intent);
}
Program: 87291
Project: 87291
Buggy source:
@Override public void onPause(){
  super.onPause();
  mLoadCancel=true;
  SharedPreferences settings=getSharedPreferences("String_Node_Str",Activity.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.putString("String_Node_Str",mCurrentPath);
  editor.commit();
  if (mListLoaded)   mListLoaded=false;
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  Log.i(TAG,"String_Node_Str");
  mLoadCancel=true;
  SharedPreferences settings=getSharedPreferences("String_Node_Str",Activity.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.putString("String_Node_Str",mCurrentPath);
  editor.commit();
  if (mListLoaded)   mListLoaded=false;
}
Program: 87292
Project: 87292
Buggy source:
@Override public void onResume(){
  super.onResume();
  mProgressHandler=new Handler(){
    @Override public void handleMessage(    Message msg){
      super.handleMessage(msg);
switch (msg.what) {
case FILEBROWSER_MESSAGE_UPDATE_LIST:
        if (mListLoaded == false) {
          break;
        }
      mListView.setAdapter(getFileListAdapterSorted(mCurrentPath,mSortType));
    mListLoaded=false;
  break;
default :
break;
}
}
}
;
if (mListLoaded == true) {
mListLoaded=false;
}
if (mCurrentPath.equals(ROOT)) {
DeviceScan();
}
 else {
mListView.setAdapter(getFileListAdapterSorted(mCurrentPath,mSortType));
}
mListView.setSelectionFromTop(mItemSelected,mItemTop);
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  mLoadCancel=false;
  Log.i(TAG,"String_Node_Str");
  if (mCurrentPath.equals(ROOT)) {
    mListView.setAdapter(getDeviceListAdapter());
  }
 else {
    mListView.setAdapter(getFileListAdapterSorted(mCurrentPath,mSortType));
  }
  mListView.setSelectionFromTop(mItemSelected,mItemTop);
}
Program: 87293
Project: 87293
Buggy source:
private List<Map<String,Object>> getFileListDataSorted(String path,int sort_type){
  updatePathShow(path);
  if (!mListLoaded) {
    mListLoaded=true;
    final String ppath=path;
    final int ssort_type=sort_type;
    new Thread("String_Node_Str"){
      @Override public void run(){
        mList=getFileListDataSortedAsync(ppath,ssort_type);
        if (null != mProgressHandler) {
          mProgressHandler.sendMessage(Message.obtain(mProgressHandler,FILEBROWSER_MESSAGE_UPDATE_LIST));
        }
      }
    }
.start();
    return new ArrayList<Map<String,Object>>();
  }
 else {
    return mList;
  }
}

Fixed version (ground truth):
private List<Map<String,Object>> getFileListDataSorted(String path,int sort_type){
  updatePathShow(path);
  return getFileListDataSortedAsync(path,sort_type);
}
Program: 87294
Project: 87294
Buggy source:
@Override public void onPrepared(DtPlayer mp){
  Log.i(Constant.LOGTAG,"String_Node_Str");
  mState=PLAYER_PREPARED;
  dtPlayer.start();
  mState=PLAYER_RUNNING;
  int duration=mp.getDuration();
  if (duration > 0) {
    mTextViewDuration.setText(TimesUtil.getTime(duration));
    mSeekBarProgress.setMax(duration);
  }
  startTimerTask();
}

Fixed version (ground truth):
@Override public void onPrepared(DtPlayer mp){
  Log.i(TAG,"String_Node_Str");
  mState=PLAYER_PREPARED;
  dtPlayer.start();
  mState=PLAYER_RUNNING;
  int duration=mp.getDuration();
  if (duration > 0) {
    mTextViewDuration.setText(TimesUtil.getTime(duration));
    mSeekBarProgress.setMax(duration);
  }
  startTimerTask();
}
Program: 87295
Project: 87295
Buggy source:
private void handlePausePlay(){
  try {
    if (dtPlayer.isPlaying()) {
      dtPlayer.pause();
      pauseBtn.setBackgroundResource(R.drawable.btn_mu_pause);
    }
 else {
      dtPlayer.start();
      pauseBtn.setBackgroundResource(R.drawable.btn_mu_play);
    }
  }
 catch (  IllegalStateException e) {
  }
catch (  Exception e) {
  }
}

Fixed version (ground truth):
private void handlePausePlay(){
  try {
    if (dtPlayer.isPlaying()) {
      dtPlayer.pause();
      pauseBtn.setBackgroundResource(R.drawable.btn_mu_pause);
    }
 else {
      dtPlayer.pause();
      pauseBtn.setBackgroundResource(R.drawable.btn_mu_play);
    }
  }
 catch (  IllegalStateException e) {
  }
catch (  Exception e) {
  }
}
Program: 87296
Project: 87296
Buggy source:
@Override public R sync() throws Exception {
  SynchronousListener<R> syncListener=new SynchronousListener<R>();
  this.addListener(syncListener);
  return syncListener.sync();
}

Fixed version (ground truth):
public R sync(boolean canInterrupt) throws Exception {
  SynchronousListener<R> syncListener=new SynchronousListener<R>();
  this.addListener(syncListener);
  return syncListener.sync(canInterrupt);
}
Program: 87297
Project: 87297
Buggy source:
private void waitUntilFinished() throws InterruptedException {
  while (state == WaitState.UNFINISHED) {
    try {
      peopleWaiting++;
      localMonitor.wait(WAIT_TIMEOUT);
    }
 catch (    InterruptedException ie) {
    }
 finally {
      peopleWaiting--;
    }
  }
}

Fixed version (ground truth):
private void waitUntilFinished(boolean canInterrupt) throws InterruptedException {
  while (state == WaitState.UNFINISHED) {
    try {
      peopleWaiting++;
      localMonitor.wait(WAIT_TIMEOUT);
    }
 catch (    InterruptedException ie) {
      if (canInterrupt)       throw new InterruptedException();
    }
 finally {
      peopleWaiting--;
    }
  }
}
Program: 87298
Project: 87298
Buggy source:
@Override public ResponseMessage sendAndReceive(Envelope e) throws PEException {
  e.from(getReplyAddress());
  send(e);
  return receive();
}

Fixed version (ground truth):
@Override public ResponseMessage sendAndReceive(Envelope msg) throws PEException {
  SMQEnvelope env=(SMQEnvelope)msg;
  env.from(getReplyAddress());
  send(env);
  try {
    return env.sync(true);
  }
 catch (  InterruptedException ie) {
    markForTermination();
    throw new PEException("String_Node_Str",ie);
  }
catch (  PEException e) {
    throw e;
  }
catch (  Exception e) {
    if (e.getCause() instanceof PEException)     throw (PEException)e.getCause();
 else     throw new PEException(e);
  }
}
Program: 87299
Project: 87299
Buggy source:
@Override public void returnResponse(Envelope requestEnvelope,ResponseMessage resp) throws PEException {
  SMQEnvelope env=(SMQEnvelope)requestEnvelope;
  if (env.getFromAddress() != null) {
    try {
      SMQEnvelope retEnv=new SMQEnvelope(env,resp);
      retEnv.to(env.getFromAddress()).from(getAddress());
      retEnv.setExceptionFrame(env.getExceptionFrame());
      agentMap.get(retEnv.getToAddress()).put(retEnv);
      if (loggerDebug)       try {
        logger.debug(retEnv.display(new StringBuilder(theAgent.getName()).append("String_Node_Str")));
      }
 catch (      Throwable t) {
        logger.fatal("String_Node_Str" + requestEnvelope + "String_Node_Str"+ retEnv,t);
      }
    }
 catch (    InterruptedException e1) {
      markForTermination();
      throw new PEException("String_Node_Str",e1);
    }
  }
}

Fixed version (ground truth):
@Override public void returnResponse(Envelope requestEnvelope,ResponseMessage resp) throws PEException {
  SMQEnvelope env=(SMQEnvelope)requestEnvelope;
  env.deliverResponse(resp);
}
Program: 87300
Project: 87300
Buggy source:
public void cmd_merge_corpus(Scanner scanner) throws Throwable {
  final File corpusFile=scanFile(scanner,"String_Node_Str");
  final MultiMap<Class<?>,File> varargs=scanFilesByTypeOptionalMulti(scanner,Collections.<Class<?>>singleton(DbAnalyzerCorpus.class));
  final Collection<File> mergedCorpusFiles=varargs.values();
  if (mergedCorpusFiles.size() < 2) {
    throw new PEException("String_Node_Str");
  }
  final Map<String,HasStatement> nonDmlPopulations=new HashMap<String,HasStatement>();
  final Map<String,HasStatement> dmlPopulations=new HashMap<String,HasStatement>();
  final StringBuilder description=new StringBuilder();
  for (  final File cf : mergedCorpusFiles) {
    final DbAnalyzerCorpus input=PEXmlUtils.unmarshalJAXB(cf,DbAnalyzerCorpus.class);
    countCorpusStatements(input,nonDmlPopulations,dmlPopulations);
    if (description.length() > 0) {
      description.append("String_Node_Str");
    }
 else {
      description.append("String_Node_Str");
    }
    description.append(input.getDescription());
  }
  final DbAnalyzerCorpus output=new DbAnalyzerCorpus();
  output.getNonDml().addAll((Collection<? extends StatementNonDMLType>)nonDmlPopulations.values());
  output.getPopulation().addAll((Collection<? extends StatementPopulationType>)dmlPopulations.values());
  output.setDescription(description.toString());
  final String corpusString=PEXmlUtils.marshalJAXB(output);
  writeToFileOrScreen(corpusFile,corpusString);
}

Fixed version (ground truth):
public void cmd_merge_corpus(Scanner scanner) throws Throwable {
  final File corpusFile=scanFile(scanner,"String_Node_Str");
  final MultiMap<Class<?>,File> varargs=scanFilesByTypeOptionalMulti(scanner,Collections.<Class<?>>singleton(DbAnalyzerCorpus.class));
  final Collection<File> mergedCorpusFiles=varargs.values();
  if (mergedCorpusFiles.size() < 2) {
    throw new PEException("String_Node_Str");
  }
  final Map<String,StatementNonDMLType> nonDmlPopulations=new HashMap<String,StatementNonDMLType>();
  final Map<String,StatementPopulationType> dmlPopulations=new HashMap<String,StatementPopulationType>();
  final StringBuilder description=new StringBuilder();
  for (  final File cf : mergedCorpusFiles) {
    final DbAnalyzerCorpus input=PEXmlUtils.unmarshalJAXB(cf,DbAnalyzerCorpus.class);
    countCorpusStatements(input,nonDmlPopulations,dmlPopulations);
    if (description.length() > 0) {
      description.append("String_Node_Str");
    }
 else {
      description.append("String_Node_Str");
    }
    description.append(input.getDescription());
  }
  final DbAnalyzerCorpus output=new DbAnalyzerCorpus();
  output.getNonDml().addAll(nonDmlPopulations.values());
  output.getPopulation().addAll(dmlPopulations.values());
  output.setDescription(description.toString());
  final String corpusString=PEXmlUtils.marshalJAXB(output);
  writeToFileOrScreen(corpusFile,corpusString);
}
Program: 87301
Project: 87301
Buggy source:
private static <T extends HasStatement>void countFrequencies(final List<T> stmts,final Map<String,HasStatement> container){
  for (  final T entry : stmts) {
    bumpFrequency(entry,container);
  }
}

Fixed version (ground truth):
private static <T extends HasStatement>void countFrequencies(final List<T> stmts,final Map<String,T> container){
  for (  final T entry : stmts) {
    bumpFrequency(entry,container);
  }
}
Program: 87302
Project: 87302
Buggy source:
private static void countCorpusStatements(final DbAnalyzerCorpus corpus,final Map<String,HasStatement> nonDml,final Map<String,HasStatement> dml){
  countFrequencies(corpus.getNonDml(),nonDml);
  countFrequencies(corpus.getPopulation(),dml);
}

Fixed version (ground truth):
private static void countCorpusStatements(final DbAnalyzerCorpus corpus,final Map<String,StatementNonDMLType> nonDmlPopulations,final Map<String,StatementPopulationType> dmlPopulations){
  countFrequencies(corpus.getNonDml(),nonDmlPopulations);
  countFrequencies(corpus.getPopulation(),dmlPopulations);
}
Program: 87303
Project: 87303
Buggy source:
public boolean sendInsert(WorkerGroup.MappingSolution mappingSolution,MyBinaryResultRow binRow) throws PEException {
  if (alreadyFailed)   return false;
  Collection<RedistTargetSite> allTargetSites=chooseTargetSites(mappingSolution);
  boolean flushedOne=false;
  for (  RedistTargetSite siteCtx : allTargetSites) {
    flushedOne=flushedOne || siteCtx.append(binRow);
    if (!siteCtx.willAcceptMoreRows()) {
      blockedTargetSites.put(siteCtx,siteCtx);
    }
  }
  if (!blockedTargetSites.isEmpty()) {
    pauseSourceStreams();
  }
  return flushedOne;
}

Fixed version (ground truth):
public boolean sendInsert(WorkerGroup.MappingSolution mappingSolution,MyBinaryResultRow binRow) throws PEException {
  if (alreadyFailed || alreadyClosed)   return false;
  Collection<RedistTargetSite> allTargetSites=chooseTargetSites(mappingSolution);
  boolean flushedOne=false;
  for (  RedistTargetSite siteCtx : allTargetSites) {
    flushedOne=flushedOne || siteCtx.append(binRow);
  }
  return flushedOne;
}
Program: 87304
Project: 87304
Buggy source:
public RedistTargetSet(WorkerGroup targetWG,RedistTargetSite.InsertWatcher watcher,RedistTargetSite.InsertPolicy policy,RedistTargetSite.SourceControl sourceControl) throws PEException {
  this.targetWG=targetWG;
  this.watcher=watcher;
  this.policy=policy;
  this.sourceControl=sourceControl;
  Collection<Worker> targetWorkers=targetWG.getTargetWorkers(WorkerGroup.MappingSolution.AllWorkers);
  for (  Worker targetWorker : targetWorkers) {
    CommandChannel directChannel=targetWorker.getDirectChannel();
    StorageSite site=directChannel.getStorageSite();
    RedistTargetSite siteCtx=new RedistTargetSite(this,directChannel,this);
    siteCtxBySite.put(site,siteCtx);
  }
}

Fixed version (ground truth):
public RedistTargetSet(WorkerGroup targetWG,RedistTargetSite.InsertWatcher watcher,RedistTargetSite.InsertPolicy policy,FlowControl sourceControl) throws PEException {
  this.targetWG=targetWG;
  this.watcher=watcher;
  this.policy=policy;
  siteFlowControl.setUpstreamControl(sourceControl);
  Collection<Worker> targetWorkers=targetWG.getTargetWorkers(WorkerGroup.MappingSolution.AllWorkers);
  for (  Worker targetWorker : targetWorkers) {
    CommandChannel directChannel=targetWorker.getDirectChannel();
    StorageSite site=directChannel.getStorageSite();
    RedistTargetSite siteCtx=new RedistTargetSite(this,directChannel,this);
    siteFlowControl.register(siteCtx);
    siteCtxBySite.put(site,siteCtx);
  }
}
Program: 87305
Project: 87305
Buggy source:
public void close(){
  for (  RedistTargetSite siteCtx : siteCtxBySite.values()) {
    siteCtx.close();
  }
}

Fixed version (ground truth):
public void close(){
  for (  RedistTargetSite siteCtx : siteCtxBySite.values()) {
    siteCtx.close();
    siteFlowControl.unregister(siteCtx);
  }
  alreadyClosed=true;
}
Program: 87306
Project: 87306
Buggy source:
@Override public void insertOK(RedistTargetSite siteCtx,MyOKResponse okPacket){
  if (alreadyFailed)   return;
  long affectedRows=okPacket.getAffectedRows();
  try {
    int rowCount=(int)affectedRows;
    insertedRows+=rowCount;
  }
  finally {
    checkIfSitesAreUnblocked();
    watcher.insertOK(siteCtx,okPacket);
  }
}

Fixed version (ground truth):
@Override public void insertOK(RedistTargetSite siteCtx,MyOKResponse okPacket){
  if (alreadyFailed || alreadyClosed)   return;
  long affectedRows=okPacket.getAffectedRows();
  try {
    int rowCount=(int)affectedRows;
    insertedRows+=rowCount;
  }
  finally {
    watcher.insertOK(siteCtx,okPacket);
  }
}
Program: 87308
Project: 87308
Buggy source:
protected void prepareFinished(long stmtID,int tupleCount){
  this.waitingForPrepare=false;
  this.pstmtId=(int)stmtID;
  this.pstmtTupleCount=tupleCount;
}

Fixed version (ground truth):
protected void prepareFinished(long stmtID,int tupleCount){
  this.pstmtId=(int)stmtID;
  this.pstmtTupleCount=tupleCount;
  shouldResumeInput();
}
Program: 87309
Project: 87309
Buggy source:
protected void prepareFailed(MyErrorResponse error){
  this.waitingForPrepare=false;
  watcher.insertFailed(this,error);
}

Fixed version (ground truth):
protected void prepareFailed(MyErrorResponse error){
  watcher.insertFailed(this,error);
  shouldResumeInput();
}
Program: 87310
Project: 87310
Buggy source:
private void executePendingInsert(){
  BufferedExecute buffersToFlush=pendingFlush;
  int currentStatementID=this.pstmtId;
  buffersToFlush.setStmtID(currentStatementID);
  buffersToFlush.setNeedsNewParams(true);
  buffersToFlush.setColumnsPerTuple(columnsPerTuple);
  int rowsWritten=buffersToFlush.size();
  this.channel.writeAndFlush(buffersToFlush,constructInsertHandler());
  this.pendingFlush=null;
  this.queuedRowSetCount.getAndAdd(-rowsWritten);
}

Fixed version (ground truth):
private void executePendingInsert(){
  BufferedExecute buffersToFlush=pendingFlush;
  int currentStatementID=this.pstmtId;
  buffersToFlush.setStmtID(currentStatementID);
  buffersToFlush.setNeedsNewParams(true);
  buffersToFlush.setColumnsPerTuple(columnsPerTuple);
  int rowsWritten=buffersToFlush.size();
  this.channel.writeAndFlush(buffersToFlush,constructInsertHandler());
  this.pendingFlush=null;
  this.queuedRowSetCount.getAndAdd(-rowsWritten);
  shouldResumeInput();
}
Program: 87311
Project: 87311
Buggy source:
private MysqlCommandResultsProcessor constructInsertHandler(){
  return new MysqlCommandResultsProcessor(){
    @Override public void active(    ChannelHandlerContext ctx){
    }
    @Override public boolean processPacket(    ChannelHandlerContext ctx,    MyMessage message) throws PEException {
      if (message instanceof MyOKResponse) {
        RedistTargetSite.this.pendingStatementCount.decrementAndGet();
        watcher.insertOK(RedistTargetSite.this,(MyOKResponse)message);
      }
 else       if (message instanceof MyErrorResponse) {
        RedistTargetSite.this.pendingStatementCount.decrementAndGet();
        watcher.insertFailed(RedistTargetSite.this,(MyErrorResponse)message);
      }
 else {
        Exception weirdPacket=new PEException("String_Node_Str" + (message == null ? "String_Node_Str" : message.getClass().getSimpleName()));
        watcher.insertFailed(RedistTargetSite.this,weirdPacket);
      }
      return false;
    }
    @Override public void packetStall(    ChannelHandlerContext ctx) throws PEException {
    }
    @Override public void failure(    Exception e){
      watcher.insertFailed(RedistTargetSite.this,e);
    }
    @Override public void end(    ChannelHandlerContext ctx){
    }
  }
;
}

Fixed version (ground truth):
private MysqlCommandResultsProcessor constructInsertHandler(){
  return new MysqlCommandResultsProcessor(){
    @Override public void active(    ChannelHandlerContext ctx){
    }
    @Override public boolean processPacket(    ChannelHandlerContext ctx,    MyMessage message) throws PEException {
      if (message instanceof MyOKResponse) {
        RedistTargetSite.this.pendingStatementCount.decrementAndGet();
        watcher.insertOK(RedistTargetSite.this,(MyOKResponse)message);
      }
 else       if (message instanceof MyErrorResponse) {
        RedistTargetSite.this.pendingStatementCount.decrementAndGet();
        watcher.insertFailed(RedistTargetSite.this,(MyErrorResponse)message);
      }
 else {
        Exception weirdPacket=new PEException("String_Node_Str" + (message == null ? "String_Node_Str" : message.getClass().getSimpleName()));
        watcher.insertFailed(RedistTargetSite.this,weirdPacket);
      }
      return false;
    }
    @Override public void packetStall(    ChannelHandlerContext ctx) throws PEException {
    }
    @Override public void failure(    Exception e){
      shouldResumeInput();
      watcher.insertFailed(RedistTargetSite.this,e);
    }
    @Override public void end(    ChannelHandlerContext ctx){
    }
  }
;
}
Program: 87312
Project: 87312
Buggy source:
@Override public void failure(Exception e){
  watcher.insertFailed(RedistTargetSite.this,e);
}

Fixed version (ground truth):
@Override public void failure(Exception e){
  shouldResumeInput();
  watcher.insertFailed(RedistTargetSite.this,e);
}
Program: 87313
Project: 87313
Buggy source:
@Override public void pauseSourceStreams(){
  sourcePaused=true;
  for (  ChannelHandlerContext ctx : sourceSites.keySet()) {
    StreamValve.pipelinePause(ctx.pipeline());
  }
}

Fixed version (ground truth):
@Override public void pauseSourceStreams(){
  if (!(lastPacketSent || failedRedist))   upstreamSet.pauseSourceStreams();
}
Program: 87314
Project: 87314
Buggy source:
@Override public void resumeSourceStreams(){
  if (sourcePaused) {
    sourcePaused=false;
    for (    ChannelHandlerContext ctx : sourceSites.keySet()) {
      StreamValve.pipelineResume(ctx.pipeline());
    }
  }
}

Fixed version (ground truth):
@Override public void resumeSourceStreams(){
  upstreamSet.resumeSourceStreams();
}
Program: 87315
Project: 87315
Buggy source:
public void sourceActive(ChannelHandlerContext ctx){
  if (sourceSites.get(ctx) == null) {
    sourceSites.put(ctx,ctx);
    if (sourcePaused) {
      StreamValve.pipelinePause(ctx.pipeline());
    }
  }
}

Fixed version (ground truth):
public void sourceActive(ChannelHandlerContext ctx){
  upstreamSet.register(ctx);
}
Program: 87317
Project: 87317
Buggy source:
private void handleSetVariableExpression(SchemaContext pc,SetVariableExpression sve,VariableManager vm,ExecutionSequence es) throws PEException {
  VariableInstance vi=sve.getVariable();
  List<ExpressionNode> value=sve.getValue();
  ExpressionNode rhs=value.get(0);
  VariableValueSource nva=getRHSSource(pc,rhs);
  if (nva != null) {
    final String variableName=vi.getVariableName().get();
    if (nva.isConstant()) {
      final VariableHandler<?> vh=vm.lookup(variableName);
      if ((vh != null) && vh.getMetadata().isNumeric() && PEStringUtils.isQuoted(String.valueOf(sve.getVariableExpr()))) {
        throw new PESQLStateException(1232,"String_Node_Str","String_Node_Str" + variableName + "String_Node_Str");
      }
    }
    es.append(new SetVariableExecutionStep(vi.getScope(),variableName,nva,pc.getPersistentGroup()));
  }
 else {
    handleComplexSetVariableExpression(pc,vi,rhs,es);
  }
}

Fixed version (ground truth):
private void handleSetVariableExpression(SchemaContext pc,SetVariableExpression sve,VariableManager vm,ExecutionSequence es) throws PEException {
  VariableInstance vi=sve.getVariable();
  List<ExpressionNode> value=sve.getValue();
  ExpressionNode rhs=value.get(0);
  VariableValueSource nva=getRHSSource(pc,rhs);
  if (nva != null) {
    final String variableName=vi.getVariableName().get();
    if (nva.isConstant()) {
      final VariableHandler<?> vh=vm.lookup(variableName);
      if ((vh != null) && vh.getMetadata().isNumeric() && PEStringUtils.isQuoted(String.valueOf(sve.getVariableExpr()))) {
        throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_TYPE_FOR_VARIABLE,variableName));
      }
    }
    es.append(new SetVariableExecutionStep(vi.getScope(),variableName,nva,pc.getPersistentGroup()));
  }
 else {
    handleComplexSetVariableExpression(pc,vi,rhs,es);
  }
}
Program: 87318
Project: 87318
Buggy source:
@Override public Boolean convertToInternal(String varName,String in) throws PEException {
  String lc=in.trim().toLowerCase();
  if (trueMap.contains(lc))   return true;
  if (falseMap.contains(lc))   return false;
  throw new PEException(String.format("String_Node_Str",in,varName));
}

Fixed version (ground truth):
@Override public Boolean convertToInternal(String varName,String in) throws PEException {
  String lc=in.trim().toLowerCase();
  if (trueMap.contains(lc))   return true;
  if (falseMap.contains(lc))   return false;
  throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_VALUE_FOR_VARIABLE,varName,lc));
}
Program: 87319
Project: 87319
Buggy source:
@Override public E convertToInternal(String varName,String in) throws PEException {
  String deq=PEStringUtils.dequote(in);
  E any=universe.get(deq);
  if (any == null)   throw new PEException("String_Node_Str" + varName + "String_Node_Str"+ StringUtils.join(universe.keySet(),"String_Node_Str")+ "String_Node_Str");
  return any;
}

Fixed version (ground truth):
@Override public E convertToInternal(String varName,String in) throws PEException {
  String deq=PEStringUtils.dequote(in);
  E any=universe.get(deq);
  if (any == null) {
    throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_VALUE_FOR_VARIABLE,varName,deq));
  }
  return any;
}
Program: 87320
Project: 87320
Buggy source:
@Override public Double convertToInternal(String varName,String in) throws PEException {
  try {
    return Double.valueOf(in);
  }
 catch (  NumberFormatException nfe) {
    throw new PEException("String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public Double convertToInternal(String varName,String in) throws PEException {
  try {
    return Double.valueOf(in);
  }
 catch (  final NumberFormatException nfe) {
    throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_TYPE_FOR_VARIABLE,varName));
  }
}
Program: 87321
Project: 87321
Buggy source:
@Override public Long convertToInternal(String varName,String in) throws PEException {
  if (in == null)   return null;
  try {
    return Long.parseLong(in);
  }
 catch (  NumberFormatException nfe) {
    throw new PEException("String_Node_Str" + in + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public Long convertToInternal(String varName,String in) throws PEException {
  if (in == null)   return null;
  try {
    return Long.parseLong(in);
  }
 catch (  final NumberFormatException nfe) {
    throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_TYPE_FOR_VARIABLE,varName));
  }
}
Program: 87322
Project: 87322
Buggy source:
public Type toInternal(String in) throws PEException {
  if (in == null || NULL_VALUE.equals(in)) {
    if (options.contains(VariableOption.NULLABLE))     return null;
    throw new PEException(String.format("String_Node_Str",getName()));
  }
  return getMetadata().convertToInternal(getName(),in);
}

Fixed version (ground truth):
public Type toInternal(String in) throws PEException {
  if (in == null || NULL_VALUE.equals(in)) {
    if (options.contains(VariableOption.NULLABLE))     return null;
    throw new SchemaException(new ErrorInfo(DVEErrors.WRONG_VALUE_FOR_VARIABLE,this.getName(),"String_Node_Str"));
  }
  return getMetadata().convertToInternal(getName(),in);
}