nus-yam/ex-repair huggingface dataset:
Program: 80381
Project: 80381
Buggy source:
@Override public Result<DrivenException> authenticate(GoogleAccountCredential credential,boolean saveCredential){
  Log.i(TAG,"String_Node_Str");
  ResultImpl<DrivenException> result=new ResultImpl<DrivenException>();
  try {
    if (credential == null)     throw new DrivenException(new IllegalArgumentException("String_Node_Str"));
    String accountName=readSavedCredentials(credential.getContext());
    if (credential.getSelectedAccountName() == null && accountName != null) {
      credential.setSelectedAccountName(accountName);
    }
    driveService=DriveUtils.createGoogleDriveService(credential);
    driveUser=new DriveUser(driveService.about().get().setFields("String_Node_Str").execute());
    result.setSuccess(true);
    Log.i(TAG,"String_Node_Str" + driveUser);
    if (saveCredential)     saveCredentials(credential);
  }
 catch (  IOException e) {
    Log.i(TAG,"String_Node_Str" + credential.getSelectedAccountName());
    result.setException(new DrivenException(e));
  }
  return result;
}

Fixed version (ground truth):
@Override public Result<DrivenException> authenticate(GoogleAccountCredential credential,boolean saveCredential){
  Log.i(TAG,"String_Node_Str");
  ResultImpl<DrivenException> result=new ResultImpl<DrivenException>();
  try {
    if (credential == null)     throw new DrivenException(new IllegalArgumentException("String_Node_Str"));
    String accountName=readSavedCredentials(credential.getContext());
    if (credential.getSelectedAccountName() == null && accountName != null) {
      credential.setSelectedAccountName(accountName);
    }
    driveService=DriveUtils.createGoogleDriveService(credential);
    driveUser=new DriveUser(driveService.about().get().setFields("String_Node_Str").execute());
    result.setSuccess(true);
    Log.i(TAG,"String_Node_Str" + driveUser);
    if (saveCredential && credential.getSelectedAccountName() != null)     saveCredentials(credential);
  }
 catch (  IOException e) {
    Log.i(TAG,"String_Node_Str" + credential.getSelectedAccountName());
    result.setException(new DrivenException(e));
  }
  return result;
}
Program: 80383
Project: 80383
Buggy source:
protected Rect growDown(final int w,final int h){
  final Node down=new Node(mRoot.x,mRoot.y + mRoot.height,mRoot.width,h);
  final Node right=mRoot;
  mRoot=new Node(mRoot.x,mRoot.y,mRoot.width,mRoot.height + h);
  mRoot.mRight=right;
  mRoot.mDown=down;
  return down.occupy(w,h);
}

Fixed version (ground truth):
protected Rect growDown(final int w,final int h){
  final Node down=new Node(mRoot.x,mRoot.y + mRoot.height,mRoot.width,h);
  final Node right=mRoot;
  mRoot=new Node(mRoot.x,mRoot.y,mRoot.width,mRoot.height + h);
  mRoot.split(down,right);
  return down.occupy(w,h);
}
Program: 80384
Project: 80384
Buggy source:
protected Rect growRight(final int w,final int h){
  final Node down=mRoot;
  final Node right=new Node(mRoot.x + mRoot.width,mRoot.y,w,mRoot.height);
  mRoot=new Node(mRoot.x,mRoot.y,mRoot.width + w,mRoot.height);
  mRoot.mRight=right;
  mRoot.mDown=down;
  return right.occupy(w,h);
}

Fixed version (ground truth):
protected Rect growRight(final int w,final int h){
  final Node down=mRoot;
  final Node right=new Node(mRoot.x + mRoot.width,mRoot.y,w,mRoot.height);
  mRoot=new Node(mRoot.x,mRoot.y,mRoot.width + w,mRoot.height);
  mRoot.split(down,right);
  return right.occupy(w,h);
}
Program: 80385
Project: 80385
Buggy source:
public Rect occupy(final int w,final int h){
  final Rect rect=new Rect(x,y,x + w,y + h);
  if (height > h) {
    mDown=new Node(x,y + h,width,height - h);
  }
  if (width > w) {
    mRight=new Node(x + w,y,width - w,h);
  }
  return rect;
}

Fixed version (ground truth):
public Rect occupy(final int w,final int h){
  if (mOccupied)   return null;
  final Rect rect=new Rect(x,y,x + w,y + h);
  mOccupied=true;
  if (height > h) {
    mDown=new Node(x,y + h,width,height - h);
  }
  if (width > w) {
    mRight=new Node(x + w,y,width - w,h);
  }
  return rect;
}
Program: 80386
Project: 80386
Buggy source:
public void reset(){
  mDown=mRight=null;
}

Fixed version (ground truth):
public void reset(){
  mDown=mRight=null;
  mOccupied=false;
}
Program: 80387
Project: 80387
Buggy source:
public Node findNode(final int w,final int h){
  if (hasChildren()) {
    if (mRight != null) {
      final Node node=mRight.findNode(w,h);
      if (node != null) {
        return node;
      }
    }
    if (mDown != null) {
      final Node node=mDown.findNode(w,h);
      if (node != null) {
        return node;
      }
    }
  }
 else   if (w <= width && h <= height) {
    return this;
  }
  return null;
}

Fixed version (ground truth):
public Node findNode(final int w,final int h){
  if (mOccupied) {
    if (mRight != null) {
      final Node node=mRight.findNode(w,h);
      if (node != null) {
        return node;
      }
    }
    if (mDown != null) {
      final Node node=mDown.findNode(w,h);
      if (node != null) {
        return node;
      }
    }
  }
 else   if (w <= width && h <= height) {
    return this;
  }
  return null;
}
Program: 80388
Project: 80388
Buggy source:
private void findStartIndex(){
  mStartX=mStartIndex=0;
  if (mContentSize.x <= 0) {
    return;
  }
  int offset=Math.round(mScrollPosition.x % mContentSize.x);
  offset+=(offset < 0) ? mContentSize.x : 0;
  if (offset == 0) {
    return;
  }
  float itemPos=0;
  for (int i=0; i < mNumChildren; i++) {
    if (offset <= itemPos) {
      mStartIndex=i;
      mStartX=itemPos - offset;
      return;
    }
    if (i == mNumChildren - 1) {
      mStartX=mContentSize.x - offset;
    }
 else {
      itemPos+=Math.max(mMinCellSize,mChildren.get(i).getSize().x) + mGap;
    }
  }
}

Fixed version (ground truth):
private void findStartIndex(){
  mStartX=mStartIndex=0;
  if (mContentSize.x <= 0) {
    return;
  }
  float offset=mScrollPosition.x % mContentSize.x;
  offset+=(offset < 0) ? mContentSize.x : 0;
  if (offset == 0) {
    return;
  }
  float itemPos=0;
  for (int i=0; i < mNumChildren; i++) {
    if (offset <= itemPos) {
      mStartIndex=i;
      mStartX=itemPos - offset;
      return;
    }
    if (i == mNumChildren - 1) {
      mStartX=mContentSize.x - offset;
    }
 else {
      itemPos+=Math.max(mMinCellSize,mChildren.get(i).getSize().x) + mGap;
    }
  }
}
Program: 80389
Project: 80389
Buggy source:
private void findStartIndex(){
  mStartY=mStartIndex=0;
  if (mContentSize.y <= 0) {
    return;
  }
  int offset=Math.round(mScrollPosition.y % mContentSize.y);
  offset+=(offset < 0) ? mContentSize.y : 0;
  if (offset == 0) {
    return;
  }
  float itemPos=0;
  for (int i=0; i < mNumChildren; i++) {
    if (offset <= itemPos) {
      mStartIndex=i;
      mStartY=itemPos - offset;
      return;
    }
    if (i == mNumChildren - 1) {
      mStartY=mContentSize.y - offset;
    }
 else {
      itemPos+=getChildHeight(mChildren.get(i)) + mGap;
    }
  }
}

Fixed version (ground truth):
private void findStartIndex(){
  mStartY=mStartIndex=0;
  if (mContentSize.y <= 0) {
    return;
  }
  float offset=mScrollPosition.y % mContentSize.y;
  offset+=(offset < 0) ? mContentSize.y : 0;
  if (offset == 0) {
    return;
  }
  float itemPos=0;
  for (int i=0; i < mNumChildren; i++) {
    if (offset <= itemPos) {
      mStartIndex=i;
      mStartY=itemPos - offset;
      return;
    }
    if (i == mNumChildren - 1) {
      mStartY=mContentSize.y - offset;
    }
 else {
      itemPos+=getChildHeight(mChildren.get(i)) + mGap;
    }
  }
}
Program: 80390
Project: 80390
Buggy source:
@Override public void onPrepared(final MediaPlayer mp){
  if (mMediaEnabled) {
    mMediaPrepared=true;
    mp.start();
  }
}

Fixed version (ground truth):
@Override public void onPrepared(final MediaPlayer mp){
  mMediaPrepared=true;
  if (mMediaEnabled) {
    mp.start();
  }
}
Program: 80391
Project: 80391
Buggy source:
@Override public void setXMLAttributes(final XmlPullParser xmlParser,final UIManager manager){
  super.setXMLAttributes(xmlParser,manager);
  final String align=xmlParser.getAttributeValue(null,ATT_ALIGN);
  if (align != null) {
    setAlignment(UIConfig.getAlignment(align));
  }
  final String repeating=xmlParser.getAttributeValue(null,ATT_REPEATING);
  if (repeating != null) {
    setRepeating(Boolean.valueOf(repeating));
  }
  final String boundsCheck=xmlParser.getAttributeValue(null,ATT_BOUNDS_CHECK_ENABLED);
  if (boundsCheck != null) {
    setBoundsCheckEnabled(Boolean.valueOf(boundsCheck));
  }
  final String autoSleepChildren=xmlParser.getAttributeValue(null,ATT_AUTO_SLEEP_CHILDREN);
  if (autoSleepChildren != null) {
    setAutoSleepChildren(Boolean.valueOf(autoSleepChildren));
  }
  final String minCellSize=xmlParser.getAttributeValue(null,ATT_MIN_CELL_SIZE);
  if (ATT_MIN_CELL_SIZE != null) {
    setMinCellSize(Float.valueOf(minCellSize) * manager.getConfig().screen_scale);
  }
}

Fixed version (ground truth):
@Override public void setXMLAttributes(final XmlPullParser xmlParser,final UIManager manager){
  super.setXMLAttributes(xmlParser,manager);
  final String align=xmlParser.getAttributeValue(null,ATT_ALIGN);
  if (align != null) {
    setAlignment(UIConfig.getAlignment(align));
  }
  final String repeating=xmlParser.getAttributeValue(null,ATT_REPEATING);
  if (repeating != null) {
    setRepeating(Boolean.valueOf(repeating));
  }
  final String boundsCheck=xmlParser.getAttributeValue(null,ATT_BOUNDS_CHECK_ENABLED);
  if (boundsCheck != null) {
    setBoundsCheckEnabled(Boolean.valueOf(boundsCheck));
  }
  final String autoSleepChildren=xmlParser.getAttributeValue(null,ATT_AUTO_SLEEP_CHILDREN);
  if (autoSleepChildren != null) {
    setAutoSleepChildren(Boolean.valueOf(autoSleepChildren));
  }
  final String minCellSize=xmlParser.getAttributeValue(null,ATT_MIN_CELL_SIZE);
  if (minCellSize != null) {
    setMinCellSize(Float.valueOf(minCellSize) * manager.getConfig().screen_scale);
  }
}
Program: 80392
Project: 80392
Buggy source:
@Override protected void updateChildren(final int deltaTime){
  super.updateChildren(deltaTime);
  final boolean forceChildrenConstraints=((mInvalidateFlags & (SIZE | PARENT)) != 0);
  int numDrawingChildren=0;
  Uniable child;
  float temp, sx=mSize.x, sy=mSize.y;
  for (int i=0; i < mNumChildren; i++) {
    child=mChildren.get(i);
    if (forceChildrenConstraints) {
      child.invalidate(PARENT);
    }
    if (child.isAlive()) {
      child.update(deltaTime);
    }
    if (child.shouldDraw() && child.checkCameraClipping(mScene != null ? mScene.getCamera() : null)) {
      if (child instanceof UniContainer) {
        numDrawingChildren+=((UniContainer)child).getNumDrawingChildren();
      }
 else {
        numDrawingChildren++;
      }
    }
    if (mWrapContentWidth) {
      temp=child.getX() + child.getWidth();
      if (temp > sx) {
        sx=temp;
      }
    }
    if (mWrapContentHeight) {
      temp=child.getY() + child.getHeight();
      if (temp > sy) {
        sy=temp;
      }
    }
  }
  setNumDrawingChildren(numDrawingChildren);
  if (sx != mSize.x || sy != mSize.y) {
    setSize(sx,sy);
  }
}

Fixed version (ground truth):
@Override protected void updateChildren(final int deltaTime){
  super.updateChildren(deltaTime);
  final int flags;
  if (mAutoUpdateBounds && (mInvalidateFlags & BOUNDS) != 0) {
    updateBounds();
  }
  final boolean forceChildrenConstraints=((mInvalidateFlags & (SIZE | PARENT)) != 0);
  int numDrawingChildren=0;
  Uniable child;
  float temp, sx=mSize.x, sy=mSize.y;
  for (int i=0; i < mNumChildren; i++) {
    child=mChildren.get(i);
    if (forceChildrenConstraints) {
      child.invalidate(PARENT);
    }
    if (child.isAlive()) {
      child.update(deltaTime);
    }
    if (child.shouldDraw() && child.checkCameraClipping(mScene != null ? mScene.getCamera() : null)) {
      if (child instanceof UniContainer) {
        numDrawingChildren+=((UniContainer)child).getNumDrawingChildren();
      }
 else {
        numDrawingChildren++;
      }
    }
    if (mWrapContentWidth) {
      temp=child.getX() + child.getWidth();
      if (temp > sx) {
        sx=temp;
      }
    }
    if (mWrapContentHeight) {
      temp=child.getY() + child.getHeight();
      if (temp > sy) {
        sy=temp;
      }
    }
  }
  validate(BOUNDS);
  setNumDrawingChildren(numDrawingChildren);
  if (sx != mSize.x || sy != mSize.y) {
    setSize(sx,sy);
  }
}
Program: 80393
Project: 80393
Buggy source:
public boolean update(final int deltaTime){
  if (mNumManipulators > 0) {
    for (int i=0; i < mNumManipulators; i++) {
      mManipulators.get(i).update(deltaTime);
    }
  }
  if ((mInvalidateFlags & BOUNDS) != 0) {
    updateVertices();
    if (mAutoUpdateBounds) {
      updateBounds();
    }
  }
  mInvalidateFlags&=~(BOUNDS);
  return mNumManipulators > 0;
}

Fixed version (ground truth):
public boolean update(final int deltaTime){
  if (mNumManipulators > 0) {
    for (int i=0; i < mNumManipulators; i++) {
      mManipulators.get(i).update(deltaTime);
    }
  }
  if ((mInvalidateFlags & BOUNDS) != 0 || (mParent != null && (((AbstractUniGroup)mParent).mInvalidateFlags & BOUNDS) != 0)) {
    updateVertices();
    if (mAutoUpdateBounds) {
      updateBounds();
    }
  }
  mInvalidateFlags&=~(BOUNDS);
  return mNumManipulators > 0;
}
Program: 80394
Project: 80394
Buggy source:
public void setAtlasFrame(final AtlasFrame frame){
  if (frame != null) {
    setTextureCoords(frame.getTextureCoords());
    if (frame.mOffset != null) {
      setOrigin(mOrigin.x - (frame.mOffset.x - mOffsetX),mOrigin.y - (frame.mOffset.y - mOffsetY));
      mOffsetX=frame.mOffset.x;
      mOffsetY=frame.mOffset.y;
    }
 else     if (mOffsetX != 0 || mOffsetY != 0) {
      setOrigin(mOrigin.x + mOffsetX,mOrigin.y + mOffsetY);
      mOffsetX=mOffsetY=0;
    }
    final PointF newSize=frame.getSize();
    if (mSizeToFrame && (newSize.x != mSize.x || newSize.y != mSize.y)) {
      setSize(newSize.x,newSize.y);
    }
 else {
      invalidate(FRAME);
    }
  }
 else {
    TextureCoordBuffer.getDefault(mTextureCoords);
    if (mOffsetX != 0 || mOffsetY != 0) {
      setOrigin(mOrigin.x + mOffsetX,mOrigin.y + mOffsetY);
      mOffsetX=mOffsetY=0;
    }
    invalidate(FRAME);
  }
  mAtlasFrame=frame;
}

Fixed version (ground truth):
public void setAtlasFrame(final AtlasFrame frame){
  if (frame != null) {
    setTextureCoords(frame.getTextureCoords());
    if (frame.mOffset != null) {
      setOrigin(mOrigin.x - (frame.mOffset.x - mOffsetX),mOrigin.y - (frame.mOffset.y - mOffsetY));
      mOffsetX=frame.mOffset.x;
      mOffsetY=frame.mOffset.y;
    }
 else     if (mOffsetX != 0 || mOffsetY != 0) {
      setOrigin(mOrigin.x + mOffsetX,mOrigin.y + mOffsetY);
      mOffsetX=mOffsetY=0;
    }
    final PointF newSize=frame.getSize();
    if (mSizeToFrame && (newSize.x != mSize.x || newSize.y != mSize.y)) {
      setSize(newSize.x,newSize.y);
    }
    invalidate(FRAME);
  }
 else {
    TextureCoordBuffer.getDefault(mTextureCoords);
    if (mOffsetX != 0 || mOffsetY != 0) {
      setOrigin(mOrigin.x + mOffsetX,mOrigin.y + mOffsetY);
      mOffsetX=mOffsetY=0;
    }
    invalidate(FRAME);
  }
  mAtlasFrame=frame;
}
Program: 80395
Project: 80395
Buggy source:
@Override public void onAdded(final Container container){
  super.onAdded(container);
  if (container instanceof DisplayObject) {
    mScene=((DisplayObject)container).getScene();
  }
 else   if (container instanceof AbstractUniGroup) {
    mScene=((AbstractUniGroup)container).getScene();
    setTexture(((AbstractUniGroup)container).getTexture());
  }
}

Fixed version (ground truth):
public void onAdded(final UniContainer container){
  if (container instanceof BaseDisplayObject) {
    mScene=((BaseDisplayObject)container).getScene();
  }
 else {
    mScene=container.getScene();
  }
  setTexture(container.getTexture());
}
Program: 80396
Project: 80396
Buggy source:
@Override public void onSurfaceCreated(final GL10 gl,final EGLConfig config){
  Log.v(TAG,"String_Node_Str");
  if (Pure2D.GL_MAX_TEXTURE_SIZE == 0) {
    Pure2D.initGLProperties(gl);
  }
  gl.glClearColor(mColor.r,mColor.g,mColor.b,mColor.a);
  gl.glShadeModel(GL10.GL_SMOOTH);
  gl.glClearDepthf(1.0f);
  gl.glEnable(GL10.GL_DEPTH_TEST);
  gl.glDepthFunc(GL10.GL_LEQUAL);
  gl.glAlphaFunc(GL10.GL_GREATER,0f);
  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,GL10.GL_NICEST);
  gl.glEnable(GL10.GL_BLEND);
  gl.glFrontFace(GL10.GL_CCW);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  boolean firstTime;
  if (mGLState == null) {
    mGLState=new GLState(gl,mStage);
    mGLState.setDefaultBlendFunc(mDefaultBlendFunc);
    mGLState.setCamera(mCamera);
    mTextureManager=createDefaultTextureManager();
    mGLState.setTextureManager(mTextureManager);
    mStartTime=SystemClock.elapsedRealtime();
    mDownTime=0;
    mFrameCount=0;
    mCurrentFps=0;
    mFrameCountDuration=0;
    firstTime=true;
  }
 else {
    mGLState.reset(gl);
    mTextureManager.reload(mGLState,mStage.getResources());
    onSurfaceChanged(gl,(int)mSize.x,(int)mSize.y);
    firstTime=false;
  }
  if (mListener != null) {
    mListener.onSurfaceCreated(mGLState,firstTime);
  }
}

Fixed version (ground truth):
@Override public void onSurfaceCreated(final GL10 gl,final EGLConfig config){
  Log.v(TAG,"String_Node_Str");
  if (Pure2D.GL_MAX_TEXTURE_SIZE == 0) {
    Pure2D.initGLProperties(gl);
  }
  gl.glClearColor(mColor.r,mColor.g,mColor.b,mColor.a);
  gl.glShadeModel(GL10.GL_SMOOTH);
  gl.glClearDepthf(1.0f);
  gl.glEnable(GL10.GL_DEPTH_TEST);
  gl.glDepthFunc(GL10.GL_LEQUAL);
  gl.glAlphaFunc(GL10.GL_GREATER,0f);
  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,GL10.GL_NICEST);
  gl.glEnable(GL10.GL_BLEND);
  gl.glFrontFace(GL10.GL_CCW);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  boolean firstTime;
  if (mGLState == null) {
    mGLState=new GLState(gl,mStage);
    mGLState.setDefaultBlendFunc(mDefaultBlendFunc);
    mGLState.setCamera(mCamera);
    mTextureManager=createDefaultTextureManager();
    mGLState.setTextureManager(mTextureManager);
    mStartTime=SystemClock.elapsedRealtime();
    mDownTime=0;
    mFrameCount=0;
    mCurrentFps=0;
    mFrameCountDuration=0;
    firstTime=true;
  }
 else {
    mGLState.reset(gl);
    final long idleTime=SystemClock.elapsedRealtime() - mStartTime;
    mTextureManager.update((int)idleTime);
    mTextureManager.reload(mGLState,mStage.getResources());
    onSurfaceChanged(gl,(int)mSize.x,(int)mSize.y);
    firstTime=false;
  }
  if (mListener != null) {
    mListener.onSurfaceCreated(mGLState,firstTime);
  }
}
Program: 80397
Project: 80397
Buggy source:
/** 
 * @hide For internal use only. Do NOT call!
 * @param deltaTime
 */
public void update(final int deltaTime){
  if (mExpirationCheckInterval > 0) {
    mExpirationCheckElapsedTime+=deltaTime;
    if (mExpirationCheckElapsedTime >= mExpirationCheckInterval) {
      final int len=mTextures.size();
      for (int i=0; i < len; i++) {
        mTextures.get(i).update(mExpirationCheckElapsedTime);
      }
      mExpirationCheckElapsedTime-=mExpirationCheckInterval;
    }
  }
}

Fixed version (ground truth):
/** 
 * @hide For internal use only. Do NOT call!
 * @param deltaTime
 */
public void update(final int deltaTime){
  if (mExpirationCheckInterval > 0) {
    mExpirationCheckElapsedTime+=deltaTime;
    if (mExpirationCheckElapsedTime >= mExpirationCheckInterval) {
      final int len=mTextures.size();
      for (int i=0; i < len; i++) {
        mTextures.get(i).update(mExpirationCheckElapsedTime);
      }
      mExpirationCheckElapsedTime=0;
    }
  }
}
Program: 80398
Project: 80398
Buggy source:
@Override public boolean update(final int deltaTime){
  if (mUIConstraint != null) {
    if ((mInvalidateFlags & (SIZE | PARENT)) != 0) {
      mUIConstraint.apply(this,mParent);
    }
  }
  if (mNumManipulators > 0) {
    for (int i=0; i < mNumManipulators; i++) {
      mManipulators.get(i).update(deltaTime);
    }
  }
  if ((mInvalidateFlags & TRANSFORM_MATRIX) != 0) {
    if (mTransformMatrix == null) {
      mTransformMatrix=new Matrix();
    }
 else {
      mTransformMatrix.reset();
    }
    if (mSkew != null) {
      mTransformMatrix.setSkew(mSkew.x,mSkew.y);
    }
    mHasTransformValues=!mTransformMatrix.isIdentity();
    if (mHasTransformValues) {
      if (mTransformMatrixValues == null) {
        mTransformMatrixValues=new float[16];
      }
      Pure2DUtils.getMatrix3DValues(mTransformMatrix,mTransformMatrixValues);
    }
  }
  if (mAutoUpdateBounds && (mInvalidateFlags & BOUNDS) != 0) {
    updateBounds();
  }
  updateChildren(deltaTime);
  mInvalidateFlags&=~(BOUNDS | TRANSFORM_MATRIX);
  return mNumManipulators > 0;
}

Fixed version (ground truth):
@Override public boolean update(final int deltaTime){
  if (mUIConstraint != null) {
    if ((mInvalidateFlags & (SIZE | PARENT)) != 0) {
      mUIConstraint.apply(this,mParent);
    }
  }
  if (mNumManipulators > 0) {
    for (int i=0; i < mNumManipulators; i++) {
      mManipulators.get(i).update(deltaTime);
    }
  }
  if ((mInvalidateFlags & TRANSFORM_MATRIX) != 0) {
    if (mTransformMatrix == null) {
      mTransformMatrix=new Matrix();
    }
 else {
      mTransformMatrix.reset();
    }
    if (mSkew != null) {
      mTransformMatrix.setSkew(mSkew.x,mSkew.y);
    }
    mHasTransformValues=!mTransformMatrix.isIdentity();
    if (mHasTransformValues) {
      if (mTransformMatrixValues == null) {
        mTransformMatrixValues=new float[16];
      }
      Pure2DUtils.getMatrix3DValues(mTransformMatrix,mTransformMatrixValues);
    }
  }
  updateChildren(deltaTime);
  if (mAutoUpdateBounds && (mInvalidateFlags & BOUNDS) != 0) {
    updateBounds();
  }
  mInvalidateFlags&=~(BOUNDS | TRANSFORM_MATRIX);
  return mNumManipulators > 0;
}
Program: 80399
Project: 80399
Buggy source:
protected AtlasFrame parseFrame(final int index,final JSONObject frameJson,final float scale) throws JSONException {
  final JSONObject frame=frameJson.getJSONObject("String_Node_Str");
  final boolean trimmed=frameJson.getBoolean("String_Node_Str");
  final boolean rotated=frameJson.getBoolean("String_Node_Str");
  final int left=frame.getInt("String_Node_Str");
  final int top=frame.getInt("String_Node_Str");
  final int w=frame.getInt("String_Node_Str");
  final int h=frame.getInt("String_Node_Str");
  final int right=left + (rotated ? h : w) - 1;
  final int bottom=top + (rotated ? w : h) - 1;
  final AtlasFrame atlasFrame=new AtlasFrame(this,index,frameJson.getString("String_Node_Str"),new RectF(left * scale,top * scale,right * scale,bottom * scale));
  if (trimmed) {
    final JSONObject spriteSourceSize=frameJson.getJSONObject("String_Node_Str");
    final int offsetX=spriteSourceSize.getInt("String_Node_Str");
    int offsetY=spriteSourceSize.getInt("String_Node_Str");
    if (mAxisSystem == Scene.AXIS_BOTTOM_LEFT) {
      final JSONObject sourceSize=frameJson.getJSONObject("String_Node_Str");
      offsetY=sourceSize.getInt("String_Node_Str") - (spriteSourceSize.getInt("String_Node_Str") + spriteSourceSize.getInt("String_Node_Str"));
    }
    if (offsetX != 0 || offsetY != 0) {
      atlasFrame.mOffset=new PointF(offsetX * scale,offsetY * scale);
    }
  }
  if (rotated) {
    atlasFrame.rotateCCW();
  }
  return atlasFrame;
}

Fixed version (ground truth):
protected AtlasFrame parseFrame(final int index,final JSONObject frameJson,final float scale) throws JSONException {
  final JSONObject frame=frameJson.getJSONObject("String_Node_Str");
  final boolean trimmed=frameJson.getBoolean("String_Node_Str");
  final boolean rotated=frameJson.getBoolean("String_Node_Str");
  final int left=frame.getInt("String_Node_Str");
  final int top=frame.getInt("String_Node_Str");
  final int w=frame.getInt("String_Node_Str");
  final int h=frame.getInt("String_Node_Str");
  final int right=left + (rotated ? h : w);
  final int bottom=top + (rotated ? w : h);
  final AtlasFrame atlasFrame=new AtlasFrame(this,index,frameJson.getString("String_Node_Str"),new RectF(left * scale,top * scale,right * scale,bottom * scale));
  if (trimmed) {
    final JSONObject spriteSourceSize=frameJson.getJSONObject("String_Node_Str");
    final int offsetX=spriteSourceSize.getInt("String_Node_Str");
    int offsetY=spriteSourceSize.getInt("String_Node_Str");
    if (mAxisSystem == Scene.AXIS_BOTTOM_LEFT) {
      final JSONObject sourceSize=frameJson.getJSONObject("String_Node_Str");
      offsetY=sourceSize.getInt("String_Node_Str") - (spriteSourceSize.getInt("String_Node_Str") + spriteSourceSize.getInt("String_Node_Str"));
    }
    if (offsetX != 0 || offsetY != 0) {
      atlasFrame.mOffset=new PointF(offsetX * scale,offsetY * scale);
    }
  }
  if (rotated) {
    atlasFrame.rotateCCW();
  }
  return atlasFrame;
}
Program: 80400
Project: 80400
Buggy source:
protected AtlasFrame parseFrame(final int index,final JSONObject frameJson,final float scale) throws JSONException {
  final JSONObject frame=frameJson.getJSONObject("String_Node_Str");
  final boolean trimmed=frameJson.getBoolean("String_Node_Str");
  final boolean rotated=frameJson.getBoolean("String_Node_Str");
  final int left=frame.getInt("String_Node_Str");
  final int top=frame.getInt("String_Node_Str");
  final int w=frame.getInt("String_Node_Str");
  final int h=frame.getInt("String_Node_Str");
  final int right=left + (rotated ? h : w) - 1;
  final int bottom=top + (rotated ? w : h) - 1;
  final AtlasFrame atlasFrame=new AtlasFrame(this,index,frameJson.getString("String_Node_Str"),new RectF(left * scale,top * scale,right * scale,bottom * scale));
  if (trimmed) {
    final JSONObject spriteSourceSize=frameJson.getJSONObject("String_Node_Str");
    final int offsetX=spriteSourceSize.getInt("String_Node_Str");
    int offsetY=spriteSourceSize.getInt("String_Node_Str");
    if (mAxisSystem == Scene.AXIS_BOTTOM_LEFT) {
      final JSONObject sourceSize=frameJson.getJSONObject("String_Node_Str");
      offsetY=sourceSize.getInt("String_Node_Str") - (spriteSourceSize.getInt("String_Node_Str") + spriteSourceSize.getInt("String_Node_Str"));
    }
    if (offsetX != 0 || offsetY != 0) {
      atlasFrame.mOffset=new PointF(offsetX * scale,offsetY * scale);
    }
  }
  if (rotated) {
    atlasFrame.rotateCCW();
  }
  return atlasFrame;
}

Fixed version (ground truth):
protected AtlasFrame parseFrame(final int index,final JSONObject frameJson,final float scale) throws JSONException {
  final JSONObject frame=frameJson.getJSONObject("String_Node_Str");
  final boolean trimmed=frameJson.getBoolean("String_Node_Str");
  final boolean rotated=frameJson.getBoolean("String_Node_Str");
  final int left=frame.getInt("String_Node_Str");
  final int top=frame.getInt("String_Node_Str");
  final int w=frame.getInt("String_Node_Str");
  final int h=frame.getInt("String_Node_Str");
  final int right=left + (rotated ? h : w);
  final int bottom=top + (rotated ? w : h);
  final AtlasFrame atlasFrame=new AtlasFrame(this,index,frameJson.getString("String_Node_Str"),new RectF(left * scale,top * scale,right * scale,bottom * scale));
  if (trimmed) {
    final JSONObject spriteSourceSize=frameJson.getJSONObject("String_Node_Str");
    final int offsetX=spriteSourceSize.getInt("String_Node_Str");
    int offsetY=spriteSourceSize.getInt("String_Node_Str");
    if (mAxisSystem == Scene.AXIS_BOTTOM_LEFT) {
      final JSONObject sourceSize=frameJson.getJSONObject("String_Node_Str");
      offsetY=sourceSize.getInt("String_Node_Str") - (spriteSourceSize.getInt("String_Node_Str") + spriteSourceSize.getInt("String_Node_Str"));
    }
    if (offsetX != 0 || offsetY != 0) {
      atlasFrame.mOffset=new PointF(offsetX * scale,offsetY * scale);
    }
  }
  if (rotated) {
    atlasFrame.rotateCCW();
  }
  return atlasFrame;
}
Program: 80401
Project: 80401
Buggy source:
private void init(final LWFManager lwfManager,InputStream stream) throws Exception {
  mManager=lwfManager;
  byte[] header=new byte[HEADER_SIZE];
  stream.read(header);
  int length=ByteBuffer.wrap(header,header.length - 4,4).order(ByteOrder.LITTLE_ENDIAN).getInt();
  byte[] data=new byte[length];
  System.arraycopy(header,0,data,0,header.length);
  stream.read(data,header.length,length - header.length);
  mId=create(data);
}

Fixed version (ground truth):
private void init(final LWFManager lwfManager,final InputStream stream) throws Exception {
  mManager=lwfManager;
  byte[] header=new byte[HEADER_SIZE];
  stream.read(header);
  int length=ByteBuffer.wrap(header,header.length - 4,4).order(ByteOrder.LITTLE_ENDIAN).getInt();
  byte[] data=new byte[length];
  System.arraycopy(header,0,data,0,header.length);
  stream.read(data,header.length,length - header.length);
  mId=create(data);
}
Program: 80402
Project: 80402
Buggy source:
public void setLWFManager(LWFManager lwfManager){
  mManager=lwfManager;
}

Fixed version (ground truth):
public void setLWFManager(final LWFManager lwfManager){
  mManager=lwfManager;
}
Program: 80403
Project: 80403
Buggy source:
public LWFData(final LWFManager lwfManager,InputStream stream) throws Exception {
  init(lwfManager,stream);
}

Fixed version (ground truth):
public LWFData(final LWFManager lwfManager,final InputStream stream) throws Exception {
  init(lwfManager,stream);
}
Program: 80404
Project: 80404
Buggy source:
public String getTextureName(int textureNo){
  return getTextureName(mId,textureNo);
}

Fixed version (ground truth):
public String getTextureName(final int textureNo){
  return getTextureName(mId,textureNo);
}
Program: 80405
Project: 80405
Buggy source:
public void setTextures(Texture[] textures){
  int textureNum=getTextureNum(mId);
  int[] glTextureIds=new int[textureNum];
  float[] glTextureUs=new float[textureNum];
  float[] glTextureVs=new float[textureNum];
  for (int i=0; i < textureNum; ++i) {
    Texture texture=textures[i];
    glTextureIds[i]=texture.getTextureID();
    glTextureUs[i]=texture.mCoordScaleX;
    glTextureVs[i]=texture.mCoordScaleY;
  }
  setGLTexture(mId,glTextureIds,glTextureUs,glTextureVs);
}

Fixed version (ground truth):
public void setTextures(final Texture[] textures){
  int textureNum=getTextureNum(mId);
  int[] glTextureIds=new int[textureNum];
  float[] glTextureUs=new float[textureNum];
  float[] glTextureVs=new float[textureNum];
  for (int i=0; i < textureNum; ++i) {
    Texture texture=textures[i];
    if (texture != null) {
      glTextureIds[i]=texture.getTextureID();
      glTextureUs[i]=texture.mCoordScaleX;
      glTextureVs[i]=texture.mCoordScaleY;
    }
 else {
      glTextureIds[i]=-1;
      glTextureUs[i]=0;
      glTextureVs[i]=0;
    }
  }
  setGLTexture(mId,glTextureIds,glTextureUs,glTextureVs);
}
Program: 80406
Project: 80406
Buggy source:
public void dispose(){
  if (mId != -1) {
    if (LOG_ENABLED) {
      Log.i(TAG,"String_Node_Str");
    }
    destroy(mId);
    mId=-1;
    if (mManager != null)     mManager.removeLWFData(this);
    mManager=null;
  }
}

Fixed version (ground truth):
public void dispose(){
  if (mId != -1) {
    if (LOG_ENABLED) {
      Log.i(TAG,"String_Node_Str");
    }
    destroy(mId);
    mId=-1;
    if (mManager != null) {
      mManager.removeLWFData(this);
    }
    mManager=null;
  }
}
Program: 80407
Project: 80407
Buggy source:
@Override public boolean update(final int deltaTime){
  super.update(deltaTime);
  if (mCurrentFrame != mPreviousFrame) {
    mPreviousFrame=mCurrentFrame;
    updateFrame(mCurrentFrame);
    invalidate(FRAME);
  }
  if (mNumFrames > 0 && mPlaying) {
    int frames=1;
    if (getFps() > 0) {
      mPendingTime+=deltaTime;
      frames=mPendingTime / (int)mFrameDuration;
      if (frames > 0) {
        mPendingTime%=(int)mFrameDuration;
      }
    }
    if (frames > 0) {
      mAccumulatedFrames+=frames;
      mCurrentFrame+=frames;
      if (mLoop == LOOP_REPEAT) {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame%=mNumFrames;
        }
      }
 else       if (mLoop == LOOP_REVERSE) {
        final int trips=(mAccumulatedFrames / mNumFrames);
        if (trips % 2 == 0) {
          if (mCurrentFrame >= mNumFrames) {
            mCurrentFrame%=mNumFrames;
          }
        }
 else {
          mCurrentFrame=mNumFrames - 1 - mAccumulatedFrames % mNumFrames;
        }
      }
 else {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame=mNumFrames - 1;
          stop();
        }
      }
    }
  }
  return mNumFrames > 0;
}

Fixed version (ground truth):
@Override public boolean update(final int deltaTime){
  super.update(deltaTime);
  if (mCurrentFrame != mPreviousFrame) {
    mPreviousFrame=mCurrentFrame;
    updateFrame(mCurrentFrame);
    invalidate(FRAME);
  }
  if (mNumFrames > 0 && mPlaying) {
    int frames=1;
    if (getFps() > 0) {
      mPendingTime+=deltaTime;
      frames=mPendingTime / (int)mFrameDuration;
      if (frames > 0) {
        mPendingTime%=(int)mFrameDuration;
      }
    }
    if (frames > 0) {
      mAccumulatedFrames+=frames;
      mCurrentFrame+=frames;
      if (mLoop == LOOP_REPEAT) {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame%=mNumFrames;
        }
      }
 else       if (mLoop == LOOP_REVERSE) {
        final int trips=(mAccumulatedFrames / mNumFrames);
        if (trips % 2 == 0) {
          if (mCurrentFrame >= mNumFrames) {
            mCurrentFrame%=mNumFrames;
          }
        }
 else {
          mCurrentFrame=mNumFrames - 1 - mAccumulatedFrames % mNumFrames;
        }
      }
 else {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame=mNumFrames - 1;
          stop();
        }
      }
    }
  }
  if (mCurrentFrame != mPreviousFrame) {
    updateFrame(mCurrentFrame);
    mPreviousFrame=mCurrentFrame;
    invalidate(FRAME);
  }
  return mNumFrames > 0;
}
Program: 80408
Project: 80408
Buggy source:
@Override public boolean update(final int deltaTime){
  super.update(deltaTime);
  if (mCurrentFrame != mPreviousFrame) {
    mPreviousFrame=mCurrentFrame;
    updateFrame(mCurrentFrame);
    invalidate(FRAME);
  }
  if (mNumFrames > 0 && mPlaying) {
    int frames=1;
    if (getFps() > 0) {
      mPendingTime+=deltaTime;
      frames=mPendingTime / (int)mFrameDuration;
      if (frames > 0) {
        mPendingTime%=(int)mFrameDuration;
      }
    }
    if (frames > 0) {
      mAccumulatedFrames+=frames;
      mCurrentFrame+=frames;
      if (mLoop == LOOP_REPEAT) {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame%=mNumFrames;
        }
      }
 else       if (mLoop == LOOP_REVERSE) {
        final int trips=(mAccumulatedFrames / mNumFrames);
        if (trips % 2 == 0) {
          if (mCurrentFrame >= mNumFrames) {
            mCurrentFrame%=mNumFrames;
          }
        }
 else {
          mCurrentFrame=mNumFrames - 1 - mAccumulatedFrames % mNumFrames;
        }
      }
 else {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame=mNumFrames - 1;
          stop();
        }
      }
    }
  }
  return mNumFrames > 0;
}

Fixed version (ground truth):
@Override public boolean update(final int deltaTime){
  super.update(deltaTime);
  if (mNumFrames > 0 && mPlaying) {
    int frames=1;
    if (getFps() > 0) {
      mPendingTime+=deltaTime;
      frames=mPendingTime / (int)mFrameDuration;
      if (frames > 0) {
        mPendingTime%=(int)mFrameDuration;
      }
    }
    if (frames > 0) {
      mAccumulatedFrames+=frames;
      mCurrentFrame+=frames;
      if (mLoop == LOOP_REPEAT) {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame%=mNumFrames;
        }
      }
 else       if (mLoop == LOOP_REVERSE) {
        final int trips=(mAccumulatedFrames / mNumFrames);
        if (trips % 2 == 0) {
          if (mCurrentFrame >= mNumFrames) {
            mCurrentFrame%=mNumFrames;
          }
        }
 else {
          mCurrentFrame=mNumFrames - 1 - mAccumulatedFrames % mNumFrames;
        }
      }
 else {
        if (mCurrentFrame >= mNumFrames) {
          mCurrentFrame=mNumFrames - 1;
          stop();
        }
      }
    }
  }
  if (mCurrentFrame != mPreviousFrame) {
    updateFrame(mCurrentFrame);
    mPreviousFrame=mCurrentFrame;
    invalidate(FRAME);
  }
  return mNumFrames > 0;
}
Program: 80410
Project: 80410
Buggy source:
public void play(final Media media) throws IllegalStateException {
  if (mMediaPlayer == null) {
    mMediaPlayer=new MediaPlayer();
    mMediaPlayer.setOnErrorListener(this);
  }
  mMediaPlayer.reset();
  if (media.load(mMediaPlayer,mContext) == 0) {
    return;
  }
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  mMediaPlayer.setLooping(media.isLooping());
  mMediaPlayer.setOnPreparedListener(this);
  mMediaPlayer.setVolume(mMediaVolume,mMediaVolume);
  mMediaPlayer.prepareAsync();
}

Fixed version (ground truth):
public void play(final Media media) throws IllegalStateException {
  if (mMediaPlayer == null) {
    mMediaPlayer=new MediaPlayer();
    mMediaPlayer.setOnErrorListener(this);
  }
  mMediaPlayer.reset();
  mMediaPrepared=false;
  if (media.load(mMediaPlayer,mContext) == 0) {
    return;
  }
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  mMediaPlayer.setLooping(media.isLooping());
  mMediaPlayer.setOnPreparedListener(this);
  mMediaPlayer.setVolume(mMediaVolume,mMediaVolume);
  mMediaPlayer.prepareAsync();
}
Program: 80411
Project: 80411
Buggy source:
public void setMediaEnabled(final boolean mediaEnabled){
  mMediaEnabled=mediaEnabled;
  if (!mediaEnabled) {
    if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
      mMediaPlayer.pause();
    }
  }
 else   if (mMediaPlayer != null) {
    mMediaPlayer.start();
  }
}

Fixed version (ground truth):
public void setMediaEnabled(final boolean mediaEnabled){
  mMediaEnabled=mediaEnabled;
  if (!mediaEnabled) {
    if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
      mMediaPlayer.pause();
    }
  }
 else   if (mMediaPlayer != null) {
    if (mMediaPrepared) {
      mMediaPlayer.start();
    }
  }
}
Program: 80412
Project: 80412
Buggy source:
public void releaseMedia(){
  if (mMediaPlayer != null) {
    mMediaPlayer.release();
    mMediaPlayer=null;
  }
}

Fixed version (ground truth):
public void releaseMedia(){
  if (mMediaPlayer != null) {
    mMediaPlayer.release();
    mMediaPlayer=null;
    mMediaPrepared=false;
  }
}
Program: 80413
Project: 80413
Buggy source:
@Override public boolean onError(final MediaPlayer mp,final int what,final int extra){
  if (mp != null) {
    mp.reset();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onError(final MediaPlayer mp,final int what,final int extra){
  if (mp != null) {
    mp.reset();
    mMediaPrepared=false;
  }
  return true;
}
Program: 80414
Project: 80414
Buggy source:
public void stopMedia(){
  if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
    mMediaPlayer.stop();
  }
}

Fixed version (ground truth):
public void stopMedia(){
  if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
    mMediaPlayer.stop();
    mMediaPrepared=false;
  }
}
Program: 80415
Project: 80415
Buggy source:
@Override public void onPrepared(final MediaPlayer mp){
  if (mMediaEnabled) {
    mp.start();
  }
}

Fixed version (ground truth):
@Override public void onPrepared(final MediaPlayer mp){
  if (mMediaEnabled) {
    mMediaPrepared=true;
    mp.start();
  }
}
Program: 80416
Project: 80416
Buggy source:
public void play(final Media media) throws IllegalStateException {
  if (mMediaPlayer == null) {
    mMediaPlayer=new MediaPlayer();
    mMediaPlayer.setOnErrorListener(this);
  }
  mMediaPlayer.reset();
  if (media.load(mMediaPlayer,mContext) == 0) {
    return;
  }
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  mMediaPlayer.setLooping(media.isLooping());
  mMediaPlayer.setOnPreparedListener(this);
  mMediaPlayer.setVolume(mMediaVolume,mMediaVolume);
  mMediaPlayer.prepareAsync();
}

Fixed version (ground truth):
public void play(final Media media) throws IllegalStateException {
  if (mMediaPlayer == null) {
    mMediaPlayer=new MediaPlayer();
    mMediaPlayer.setOnErrorListener(this);
  }
  mMediaPlayer.reset();
  mMediaPrepared=false;
  if (media.load(mMediaPlayer,mContext) == 0) {
    return;
  }
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  mMediaPlayer.setLooping(media.isLooping());
  mMediaPlayer.setOnPreparedListener(this);
  mMediaPlayer.setVolume(mMediaVolume,mMediaVolume);
  mMediaPlayer.prepareAsync();
}
Program: 80417
Project: 80417
Buggy source:
public void setMediaEnabled(final boolean mediaEnabled){
  mMediaEnabled=mediaEnabled;
  if (!mediaEnabled) {
    if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
      mMediaPlayer.pause();
    }
  }
 else   if (mMediaPlayer != null) {
    mMediaPlayer.start();
  }
}

Fixed version (ground truth):
public void setMediaEnabled(final boolean mediaEnabled){
  mMediaEnabled=mediaEnabled;
  if (!mediaEnabled) {
    if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
      mMediaPlayer.pause();
    }
  }
 else   if (mMediaPlayer != null) {
    if (mMediaPrepared) {
      mMediaPlayer.start();
    }
  }
}
Program: 80418
Project: 80418
Buggy source:
public void releaseMedia(){
  if (mMediaPlayer != null) {
    mMediaPlayer.release();
    mMediaPlayer=null;
  }
}

Fixed version (ground truth):
public void releaseMedia(){
  if (mMediaPlayer != null) {
    mMediaPlayer.release();
    mMediaPlayer=null;
    mMediaPrepared=false;
  }
}
Program: 80419
Project: 80419
Buggy source:
@Override public boolean onError(final MediaPlayer mp,final int what,final int extra){
  if (mp != null) {
    mp.reset();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onError(final MediaPlayer mp,final int what,final int extra){
  if (mp != null) {
    mp.reset();
    mMediaPrepared=false;
  }
  return true;
}
Program: 80420
Project: 80420
Buggy source:
public void stopMedia(){
  if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
    mMediaPlayer.stop();
  }
}

Fixed version (ground truth):
public void stopMedia(){
  if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
    mMediaPlayer.stop();
    mMediaPrepared=false;
  }
}
Program: 80421
Project: 80421
Buggy source:
@Override public void onPrepared(final MediaPlayer mp){
  if (mMediaEnabled) {
    mp.start();
  }
}

Fixed version (ground truth):
@Override public void onPrepared(final MediaPlayer mp){
  if (mMediaEnabled) {
    mMediaPrepared=true;
    mp.start();
  }
}
Program: 80422
Project: 80422
Buggy source:
public void setAniFile(final AniFile file){
  mAniFile=file;
  if (file != null && mAniFile.mSkeletonData.length > 0) {
    mVertexBuffers=new VertexBuffer[file.mNumParts];
    mCoordBuffers=new TextureCoordBuffer[file.mNumParts];
    mBounds=new RectF[file.mNumParts];
    if (file.mVersion == 2) {
      file.getFrameCoordBuffers(0,mCoordBuffers);
    }
    mNumFrames=file.mNumFrames;
  }
 else {
    mNumFrames=0;
  }
  mPreviousFrame=-1;
  mCurrentFrame=0;
}

Fixed version (ground truth):
public void setAniFile(final AniFile file){
  mAniFile=file;
  if (file != null && mAniFile.mSkeletonData.length > 0) {
    mVertexBuffers=new VertexBuffer[file.mNumParts];
    mCoordBuffers=new TextureCoordBuffer[file.mNumParts];
    mBounds=new RectF[file.mNumFrames];
    if (file.mVersion == 2) {
      file.getFrameCoordBuffers(0,mCoordBuffers);
    }
    mNumFrames=file.mNumFrames;
  }
 else {
    mNumFrames=0;
  }
  mPreviousFrame=-1;
  mCurrentFrame=0;
}
Program: 80423
Project: 80423
Buggy source:
@Override public boolean draw(final GLState glState){
  if (mNumFrames > 0) {
    drawStart(glState);
    drawChildren(glState);
    drawEnd(glState);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean draw(final GLState glState){
  if (mNumFrames > 0) {
    drawStart(glState);
    final boolean blendChanged=glState.setBlendFunc(mBlendFunc);
    glState.setColor(getSumColor());
    glState.setColorArrayEnabled(false);
    drawChildren(glState);
    if (blendChanged) {
      glState.setBlendFunc(null);
    }
    drawEnd(glState);
    return true;
  }
  return false;
}
Program: 80424
Project: 80424
Buggy source:
@Override public boolean draw(final GLState glState){
  if (mVertexBuffer == null) {
    return false;
  }
  drawStart(glState);
  boolean blendChanged=glState.setBlendFunc(mBlendFunc);
  glState.setColor(getSumColor());
  if (mColorBuffer == null) {
    glState.setColorArrayEnabled(false);
  }
 else {
    mColorBuffer.apply(glState);
  }
  if (mTexture != null) {
    mTexture.bind();
    if (mTextureCoordBufferScaled != null) {
      mTextureCoordBufferScaled.apply(glState);
    }
  }
 else {
    glState.unbindTexture();
  }
  mVertexBuffer.draw(glState);
  if (blendChanged) {
    glState.setBlendFunc(null);
  }
  drawEnd(glState);
  return true;
}

Fixed version (ground truth):
@Override public boolean draw(final GLState glState){
  if (mVertexBuffer == null) {
    return false;
  }
  drawStart(glState);
  final boolean blendChanged=glState.setBlendFunc(mBlendFunc);
  glState.setColor(getSumColor());
  if (mColorBuffer == null) {
    glState.setColorArrayEnabled(false);
  }
 else {
    mColorBuffer.apply(glState);
  }
  if (mTexture != null) {
    mTexture.bind();
    if (mTextureCoordBufferScaled != null) {
      mTextureCoordBufferScaled.apply(glState);
    }
  }
 else {
    glState.unbindTexture();
  }
  mVertexBuffer.draw(glState);
  if (blendChanged) {
    glState.setBlendFunc(null);
  }
  drawEnd(glState);
  return true;
}
Program: 80425
Project: 80425
Buggy source:
public int load(final MediaPlayer player,final Context context){
  try {
    player.setDataSource(mAssetFd.getFileDescriptor(),mAssetFd.getStartOffset(),mAssetFd.getLength());
  }
 catch (  Exception e) {
    Log.e(TAG,e.getMessage());
    return 0;
  }
  return 1;
}

Fixed version (ground truth):
public int load(final MediaPlayer player,final Context context){
  try {
    player.setDataSource(mAssetFd.getFileDescriptor(),mAssetFd.getStartOffset(),mAssetFd.getLength());
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.getMessage());
    return 0;
  }
  return 1;
}
Program: 80426
Project: 80426
Buggy source:
public ErrorLogRecorder(String detailMessage){
  super(detailMessage);
}

Fixed version (ground truth):
ErrorLogRecorder(String detailMessage){
  super(detailMessage);
}
Program: 80427
Project: 80427
Buggy source:
@Override protected Result check() throws Exception {
  String keyspace=null;
  String clusterName=null;
  try (Session session=sessionFactory.create()){
    clusterName=session.getCluster().getClusterName();
    keyspace=session.getLoggedKeyspace();
    return Result.healthy();
  }
 catch (  Exception ex) {
    LOG.error("String_Node_Str",clusterName,keyspace,ex);
    throw ex;
  }
}

Fixed version (ground truth):
@Override protected Result check() throws Exception {
  try (Session session=sessionFactory.create()){
    return Result.healthy();
  }
 catch (  Exception ex) {
    LOG.error("String_Node_Str",sessionFactory.getClusterName(),sessionFactory.getKeyspace(),ex);
    throw ex;
  }
}
Program: 80428
Project: 80428
Buggy source:
private static void populateNumericResources(ActivityDictionary AD,Conditions conditions){
  List<NumericResource> numericResources=conditions.getNumericResources();
  List<NumericResourceDef> numericResourceDefs=AD.getDefinitions(NumericResourceDef.class);
  for (  NumericResourceDef numericDef : numericResourceDefs) {
    String name=numericDef.getName();
    NumericResource numericResource=MemberFactory.eINSTANCE.createNumericResource();
    numericResource.setName(name);
    numericResource.setFloat((float)numericDef.getDefault());
    numericResources.add(numericResource);
  }
}

Fixed version (ground truth):
private static void populateNumericResources(ActivityDictionary AD,Conditions conditions){
  List<NumericResource> numericResources=conditions.getNumericResources();
  List<ENumericResourceDef> numericResourceDefs=AD.getDefinitions(ENumericResourceDef.class);
  for (  ENumericResourceDef numericDef : numericResourceDefs) {
    if (!(numericDef instanceof EExtendedNumericResourceDef)) {
      String name=numericDef.getName();
      NumericResource numericResource=MemberFactory.eINSTANCE.createNumericResource();
      numericResource.setName(name);
      double defaultValue=getNumericResourceDefaultValue(numericDef);
      numericResource.setFloat((float)defaultValue);
      numericResources.add(numericResource);
    }
  }
}