nus-yam/ex-repair huggingface dataset:
Program: 195453
Project: 195453
Buggy source:
/** 
 * Set the layout direction from the Locale.
 * @param locale The Locale. If null will set the layout direction to{@link View#LAYOUT_DIRECTION_LTR}. If not null will set it to the layout direction corresponding to the Locale.
 * @see {@link View#LAYOUT_DIRECTION_LTR} and {@link View#LAYOUT_DIRECTION_RTL}
 */
public void setLayoutDirection(Locale locale){
  final int layoutDirection=1 + TextUtils.getLayoutDirectionFromLocale(locale);
  screenLayout=(screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | (layoutDirection << SCREENLAYOUT_LAYOUTDIR_SHIFT);
}

Fixed version (ground truth):
/** 
 * Set the layout direction from the Locale.
 * @param locale The Locale. If null will set the layout direction to{@link View#LAYOUT_DIRECTION_LTR}. If not null will set it to the layout direction corresponding to the Locale.
 * @see View#LAYOUT_DIRECTION_LTR
 * @see View#LAYOUT_DIRECTION_RTL
 */
public void setLayoutDirection(Locale locale){
  final int layoutDirection=1 + TextUtils.getLayoutDirectionFromLocale(locale);
  screenLayout=(screenLayout & ~SCREENLAYOUT_LAYOUTDIR_MASK) | (layoutDirection << SCREENLAYOUT_LAYOUTDIR_SHIFT);
}
Program: 195454
Project: 195454
Buggy source:
/** 
 * defines the method to be invoked when database corruption is detected.
 * @param dbObj the {@link SQLiteDatabase} object representing the database on which corruptionis detected.
 */
void onCorruption(SQLiteDatabase dbObj);

Fixed version (ground truth):
/** 
 * The method invoked when database corruption is detected.
 * @param dbObj the {@link SQLiteDatabase} object representing the database on which corruptionis detected.
 */
void onCorruption(SQLiteDatabase dbObj);
Program: 195455
Project: 195455
Buggy source:
/** 
 * Sets the color of the status bar to   {@param color}. For this to take effect, the window must be drawing the system bar backgrounds with  {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and{@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_STATUS} must not be set.If  {@param color} is not opaque, consider setting{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}. <p> The transitionName for the view background will be "android:status:background". </p>
 */
public abstract void setStatusBarColor(@ColorInt int color);

Fixed version (ground truth):
/** 
 * Sets the color of the status bar to   {@code color}. For this to take effect, the window must be drawing the system bar backgrounds with  {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and{@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_STATUS} must not be set.If  {@code color} is not opaque, consider setting{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}. <p> The transitionName for the view background will be "android:status:background". </p>
 */
public abstract void setStatusBarColor(@ColorInt int color);
Program: 195456
Project: 195456
Buggy source:
private void removeDeviceLocked(Device device){
  if (mDevicesByInfo.remove(device.getDeviceInfo()) != null) {
    IMidiDeviceServer server=device.getDeviceServer();
    if (server != null) {
      mDevicesByServer.remove(server);
    }
synchronized (mClients) {
      for (      Client c : mClients.values()) {
        c.deviceRemoved(device);
      }
    }
  }
}

Fixed version (ground truth):
private void removeDeviceLocked(Device device){
  IMidiDeviceServer server=device.getDeviceServer();
  if (server != null) {
    mDevicesByServer.remove(server);
  }
synchronized (mClients) {
    for (    Client c : mClients.values()) {
      c.deviceRemoved(device);
    }
  }
}
Program: 195457
Project: 195457
Buggy source:
private void removePackageDeviceServers(String packageName){
synchronized (mDevicesByInfo) {
    for (    Device device : mDevicesByInfo.values()) {
      if (packageName.equals(device.getPackageName())) {
        removeDeviceLocked(device);
      }
    }
  }
}

Fixed version (ground truth):
private void removePackageDeviceServers(String packageName){
synchronized (mDevicesByInfo) {
    Iterator<Device> iterator=mDevicesByInfo.values().iterator();
    while (iterator.hasNext()) {
      Device device=iterator.next();
      if (packageName.equals(device.getPackageName())) {
        iterator.remove();
        removeDeviceLocked(device);
      }
    }
  }
}
Program: 195458
Project: 195458
Buggy source:
@Override public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,TAG);
  final IndentingPrintWriter pw=new IndentingPrintWriter(writer,"String_Node_Str");
  pw.println("String_Node_Str");
  pw.increaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  Device device : mDevicesByInfo.values()) {
    pw.println(device.toString());
  }
  pw.decreaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  Client client : mClients.values()) {
    pw.println(client.toString());
  }
  pw.decreaseIndent();
}

Fixed version (ground truth):
@Override public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,TAG);
  final IndentingPrintWriter pw=new IndentingPrintWriter(writer,"String_Node_Str");
  pw.println("String_Node_Str");
  pw.increaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
synchronized (mDevicesByInfo) {
    for (    Device device : mDevicesByInfo.values()) {
      pw.println(device.toString());
    }
  }
  pw.decreaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
synchronized (mClients) {
    for (    Client client : mClients.values()) {
      pw.println(client.toString());
    }
  }
  pw.decreaseIndent();
}
Program: 195459
Project: 195459
Buggy source:
@Override public void unregisterDeviceServer(IMidiDeviceServer server){
synchronized (mDevicesByInfo) {
    Device device=mDevicesByServer.get(server.asBinder());
    if (device != null) {
      removeDeviceLocked(device);
    }
  }
}

Fixed version (ground truth):
@Override public void unregisterDeviceServer(IMidiDeviceServer server){
synchronized (mDevicesByInfo) {
    Device device=mDevicesByServer.get(server.asBinder());
    if (device != null) {
      mDevicesByInfo.remove(device.getDeviceInfo());
      removeDeviceLocked(device);
    }
  }
}
Program: 195460
Project: 195460
Buggy source:
public void binderDied(){
synchronized (mDevicesByInfo) {
    removeDeviceLocked(this);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mDevicesByInfo) {
    if (mDevicesByInfo.remove(mDeviceInfo) != null) {
      removeDeviceLocked(this);
    }
  }
}
Program: 195461
Project: 195461
Buggy source:
/** 
 * Reset the transform on a view. 
 */
public static void reset(View v){
  v.setTranslationX(0f);
  v.setTranslationY(0f);
  v.setTranslationZ(0f);
  v.setScaleX(1f);
  v.setScaleY(1f);
  v.setAlpha(1f);
}

Fixed version (ground truth):
/** 
 * Reset the transform on a view. 
 */
public static void reset(View v){
  v.animate().cancel();
  v.setTranslationX(0f);
  v.setTranslationY(0f);
  v.setTranslationZ(0f);
  v.setScaleX(1f);
  v.setScaleY(1f);
  v.setAlpha(1f);
}
Program: 195462
Project: 195462
Buggy source:
/** 
 * Reset the transform on a view. 
 */
public static void reset(View v){
  v.setTranslationX(0f);
  v.setTranslationY(0f);
  v.setTranslationZ(0f);
  v.setScaleX(1f);
  v.setScaleY(1f);
  v.setAlpha(1f);
}

Fixed version (ground truth):
/** 
 * Reset the transform on a view. 
 */
public static void reset(View v){
  v.animate().cancel();
  v.setTranslationX(0f);
  v.setTranslationY(0f);
  v.setTranslationZ(0f);
  v.setScaleX(1f);
  v.setScaleY(1f);
  v.setAlpha(1f);
}
Program: 195463
Project: 195463
Buggy source:
private void removeDeviceLocked(Device device){
  if (mDevicesByInfo.remove(device.getDeviceInfo()) != null) {
    IMidiDeviceServer server=device.getDeviceServer();
    if (server != null) {
      mDevicesByServer.remove(server);
    }
synchronized (mClients) {
      for (      Client c : mClients.values()) {
        c.deviceRemoved(device);
      }
    }
  }
}

Fixed version (ground truth):
private void removeDeviceLocked(Device device){
  IMidiDeviceServer server=device.getDeviceServer();
  if (server != null) {
    mDevicesByServer.remove(server);
  }
synchronized (mClients) {
    for (    Client c : mClients.values()) {
      c.deviceRemoved(device);
    }
  }
}
Program: 195464
Project: 195464
Buggy source:
private void removePackageDeviceServers(String packageName){
synchronized (mDevicesByInfo) {
    for (    Device device : mDevicesByInfo.values()) {
      if (packageName.equals(device.getPackageName())) {
        removeDeviceLocked(device);
      }
    }
  }
}

Fixed version (ground truth):
private void removePackageDeviceServers(String packageName){
synchronized (mDevicesByInfo) {
    Iterator<Device> iterator=mDevicesByInfo.values().iterator();
    while (iterator.hasNext()) {
      Device device=iterator.next();
      if (packageName.equals(device.getPackageName())) {
        iterator.remove();
        removeDeviceLocked(device);
      }
    }
  }
}
Program: 195465
Project: 195465
Buggy source:
@Override public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,TAG);
  final IndentingPrintWriter pw=new IndentingPrintWriter(writer,"String_Node_Str");
  pw.println("String_Node_Str");
  pw.increaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  Device device : mDevicesByInfo.values()) {
    pw.println(device.toString());
  }
  pw.decreaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
  for (  Client client : mClients.values()) {
    pw.println(client.toString());
  }
  pw.decreaseIndent();
}

Fixed version (ground truth):
@Override public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,TAG);
  final IndentingPrintWriter pw=new IndentingPrintWriter(writer,"String_Node_Str");
  pw.println("String_Node_Str");
  pw.increaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
synchronized (mDevicesByInfo) {
    for (    Device device : mDevicesByInfo.values()) {
      pw.println(device.toString());
    }
  }
  pw.decreaseIndent();
  pw.println("String_Node_Str");
  pw.increaseIndent();
synchronized (mClients) {
    for (    Client client : mClients.values()) {
      pw.println(client.toString());
    }
  }
  pw.decreaseIndent();
}
Program: 195466
Project: 195466
Buggy source:
@Override public void unregisterDeviceServer(IMidiDeviceServer server){
synchronized (mDevicesByInfo) {
    Device device=mDevicesByServer.get(server.asBinder());
    if (device != null) {
      removeDeviceLocked(device);
    }
  }
}

Fixed version (ground truth):
@Override public void unregisterDeviceServer(IMidiDeviceServer server){
synchronized (mDevicesByInfo) {
    Device device=mDevicesByServer.get(server.asBinder());
    if (device != null) {
      mDevicesByInfo.remove(device.getDeviceInfo());
      removeDeviceLocked(device);
    }
  }
}
Program: 195467
Project: 195467
Buggy source:
public void binderDied(){
synchronized (mDevicesByInfo) {
    removeDeviceLocked(this);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mDevicesByInfo) {
    if (mDevicesByInfo.remove(mDeviceInfo) != null) {
      removeDeviceLocked(this);
    }
  }
}
Program: 195468
Project: 195468
Buggy source:
/** 
 * Initializes the Recents. 
 */
@ProxyFromPrimaryToCurrentUser @Override public void start(){
  if (sInstance == null) {
    sInstance=this;
  }
  RecentsTaskLoader.initialize(mContext);
  mInflater=LayoutInflater.from(mContext);
  mSystemServicesProxy=new SystemServicesProxy(mContext);
  mHandler=new Handler();
  mTaskStackBounds=new Rect();
  mTaskStackListener=new TaskStackListenerImpl(mHandler);
  mSystemServicesProxy.registerTaskStackListener(mTaskStackListener);
  if (mSystemServicesProxy.isForegroundUserOwner()) {
    mProxyBroadcastReceiver=new RecentsOwnerEventProxyReceiver();
    IntentFilter filter=new IntentFilter();
    filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER);
    mContext.registerReceiverAsUser(mProxyBroadcastReceiver,UserHandle.CURRENT,filter,null,mHandler);
  }
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout(true);
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  RecentsTaskLoadPlan plan=loader.createLoadPlan(mContext);
  loader.preloadTasks(plan,true);
  RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
  launchOpts.numVisibleTasks=loader.getApplicationIconCacheSize();
  launchOpts.numVisibleTaskThumbnails=loader.getThumbnailCacheSize();
  launchOpts.onlyLoadForCache=true;
  loader.loadTasks(mContext,plan,launchOpts);
  putComponent(Recents.class,this);
}

Fixed version (ground truth):
/** 
 * Initializes the Recents. 
 */
@ProxyFromPrimaryToCurrentUser @Override public void start(){
  if (sInstance == null) {
    sInstance=this;
  }
  RecentsTaskLoader.initialize(mContext);
  mInflater=LayoutInflater.from(mContext);
  mSystemServicesProxy=new SystemServicesProxy(mContext);
  mHandler=new Handler();
  mTaskStackBounds=new Rect();
  mTaskStackListener=new TaskStackListenerImpl(mHandler);
  mSystemServicesProxy.registerTaskStackListener(mTaskStackListener);
  if (mSystemServicesProxy.isForegroundUserOwner()) {
    mProxyBroadcastReceiver=new RecentsOwnerEventProxyReceiver();
    IntentFilter filter=new IntentFilter();
    filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER);
    filter.addAction(Recents.ACTION_PROXY_SCREEN_PINNING_REQUEST_TO_OWNER);
    mContext.registerReceiverAsUser(mProxyBroadcastReceiver,UserHandle.CURRENT,filter,null,mHandler);
  }
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout(true);
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  RecentsTaskLoadPlan plan=loader.createLoadPlan(mContext);
  loader.preloadTasks(plan,true);
  RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
  launchOpts.numVisibleTasks=loader.getApplicationIconCacheSize();
  launchOpts.numVisibleTaskThumbnails=loader.getThumbnailCacheSize();
  launchOpts.onlyLoadForCache=true;
  loader.loadTasks(mContext,plan,launchOpts);
  putComponent(Recents.class,this);
}
Program: 195469
Project: 195469
Buggy source:
/** 
 * Called with the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  RecentsTaskLoader.initialize(this);
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  mConfig=RecentsConfiguration.reinitialize(this,ssp);
  mAppWidgetHost=new RecentsAppWidgetHost(this,Constants.Values.App.AppWidgetHostId);
  setContentView(R.layout.recents);
  mRecentsView=(RecentsView)findViewById(R.id.recents_view);
  mRecentsView.setCallbacks(this);
  mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
  mEmptyViewStub=(ViewStub)findViewById(R.id.empty_view_stub);
  mDebugOverlayStub=(ViewStub)findViewById(R.id.debug_overlay_stub);
  mScrimViews=new SystemBarScrimViews(this,mConfig);
  mStatusBar=((SystemUIApplication)getApplication()).getComponent(PhoneStatusBar.class);
  inflateDebugOverlay();
  bindSearchBarAppWidget();
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mSystemBroadcastReceiver,filter);
  try {
    Utilities.setShadowProperty("String_Node_Str",String.valueOf(1.5f));
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Called with the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  RecentsTaskLoader.initialize(this);
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  mConfig=RecentsConfiguration.reinitialize(this,ssp);
  mAppWidgetHost=new RecentsAppWidgetHost(this,Constants.Values.App.AppWidgetHostId);
  setContentView(R.layout.recents);
  mRecentsView=(RecentsView)findViewById(R.id.recents_view);
  mRecentsView.setCallbacks(this);
  mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
  mEmptyViewStub=(ViewStub)findViewById(R.id.empty_view_stub);
  mDebugOverlayStub=(ViewStub)findViewById(R.id.debug_overlay_stub);
  mScrimViews=new SystemBarScrimViews(this,mConfig);
  inflateDebugOverlay();
  bindSearchBarAppWidget();
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mSystemBroadcastReceiver,filter);
  try {
    Utilities.setShadowProperty("String_Node_Str",String.valueOf(1.5f));
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
}
Program: 195470
Project: 195470
Buggy source:
@Override public void onScreenPinningRequest(){
  if (mStatusBar != null) {
    mStatusBar.showScreenPinningRequest(false);
  }
}

Fixed version (ground truth):
@Override public void onScreenPinningRequest(){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  SystemServicesProxy ssp=loader.getSystemServicesProxy();
  Recents.startScreenPinning(this,ssp);
}
Program: 195471
Project: 195471
Buggy source:
/** 
 * Initializes the Recents. 
 */
@ProxyFromPrimaryToCurrentUser @Override public void start(){
  if (sInstance == null) {
    sInstance=this;
  }
  RecentsTaskLoader.initialize(mContext);
  mInflater=LayoutInflater.from(mContext);
  mSystemServicesProxy=new SystemServicesProxy(mContext);
  mHandler=new Handler();
  mTaskStackBounds=new Rect();
  mTaskStackListener=new TaskStackListenerImpl(mHandler);
  mSystemServicesProxy.registerTaskStackListener(mTaskStackListener);
  if (mSystemServicesProxy.isForegroundUserOwner()) {
    mProxyBroadcastReceiver=new RecentsOwnerEventProxyReceiver();
    IntentFilter filter=new IntentFilter();
    filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER);
    mContext.registerReceiverAsUser(mProxyBroadcastReceiver,UserHandle.CURRENT,filter,null,mHandler);
  }
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout(true);
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  RecentsTaskLoadPlan plan=loader.createLoadPlan(mContext);
  loader.preloadTasks(plan,true);
  RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
  launchOpts.numVisibleTasks=loader.getApplicationIconCacheSize();
  launchOpts.numVisibleTaskThumbnails=loader.getThumbnailCacheSize();
  launchOpts.onlyLoadForCache=true;
  loader.loadTasks(mContext,plan,launchOpts);
  putComponent(Recents.class,this);
}

Fixed version (ground truth):
/** 
 * Initializes the Recents. 
 */
@ProxyFromPrimaryToCurrentUser @Override public void start(){
  if (sInstance == null) {
    sInstance=this;
  }
  RecentsTaskLoader.initialize(mContext);
  mInflater=LayoutInflater.from(mContext);
  mSystemServicesProxy=new SystemServicesProxy(mContext);
  mHandler=new Handler();
  mTaskStackBounds=new Rect();
  mTaskStackListener=new TaskStackListenerImpl(mHandler);
  mSystemServicesProxy.registerTaskStackListener(mTaskStackListener);
  if (mSystemServicesProxy.isForegroundUserOwner()) {
    mProxyBroadcastReceiver=new RecentsOwnerEventProxyReceiver();
    IntentFilter filter=new IntentFilter();
    filter.addAction(Recents.ACTION_PROXY_NOTIFY_RECENTS_VISIBLITY_TO_OWNER);
    filter.addAction(Recents.ACTION_PROXY_SCREEN_PINNING_REQUEST_TO_OWNER);
    mContext.registerReceiverAsUser(mProxyBroadcastReceiver,UserHandle.CURRENT,filter,null,mHandler);
  }
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout(true);
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  RecentsTaskLoadPlan plan=loader.createLoadPlan(mContext);
  loader.preloadTasks(plan,true);
  RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
  launchOpts.numVisibleTasks=loader.getApplicationIconCacheSize();
  launchOpts.numVisibleTaskThumbnails=loader.getThumbnailCacheSize();
  launchOpts.onlyLoadForCache=true;
  loader.loadTasks(mContext,plan,launchOpts);
  putComponent(Recents.class,this);
}
Program: 195472
Project: 195472
Buggy source:
/** 
 * Called with the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  RecentsTaskLoader.initialize(this);
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  mConfig=RecentsConfiguration.reinitialize(this,ssp);
  mAppWidgetHost=new RecentsAppWidgetHost(this,Constants.Values.App.AppWidgetHostId);
  setContentView(R.layout.recents);
  mRecentsView=(RecentsView)findViewById(R.id.recents_view);
  mRecentsView.setCallbacks(this);
  mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
  mEmptyViewStub=(ViewStub)findViewById(R.id.empty_view_stub);
  mDebugOverlayStub=(ViewStub)findViewById(R.id.debug_overlay_stub);
  mScrimViews=new SystemBarScrimViews(this,mConfig);
  mStatusBar=((SystemUIApplication)getApplication()).getComponent(PhoneStatusBar.class);
  inflateDebugOverlay();
  bindSearchBarAppWidget();
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mSystemBroadcastReceiver,filter);
  try {
    Utilities.setShadowProperty("String_Node_Str",String.valueOf(1.5f));
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Called with the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  RecentsTaskLoader.initialize(this);
  SystemServicesProxy ssp=RecentsTaskLoader.getInstance().getSystemServicesProxy();
  mConfig=RecentsConfiguration.reinitialize(this,ssp);
  mAppWidgetHost=new RecentsAppWidgetHost(this,Constants.Values.App.AppWidgetHostId);
  setContentView(R.layout.recents);
  mRecentsView=(RecentsView)findViewById(R.id.recents_view);
  mRecentsView.setCallbacks(this);
  mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
  mEmptyViewStub=(ViewStub)findViewById(R.id.empty_view_stub);
  mDebugOverlayStub=(ViewStub)findViewById(R.id.debug_overlay_stub);
  mScrimViews=new SystemBarScrimViews(this,mConfig);
  inflateDebugOverlay();
  bindSearchBarAppWidget();
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mSystemBroadcastReceiver,filter);
  try {
    Utilities.setShadowProperty("String_Node_Str",String.valueOf(1.5f));
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
}
Program: 195473
Project: 195473
Buggy source:
@Override public void onScreenPinningRequest(){
  if (mStatusBar != null) {
    mStatusBar.showScreenPinningRequest(false);
  }
}

Fixed version (ground truth):
@Override public void onScreenPinningRequest(){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  SystemServicesProxy ssp=loader.getSystemServicesProxy();
  Recents.startScreenPinning(this,ssp);
}
Program: 195474
Project: 195474
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)mDataSize >> 32;
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)(mDataSize >> 32);
  return result;
}
Program: 195475
Project: 195475
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)mDataSize >> 32;
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)(mDataSize >> 32);
  return result;
}
Program: 195476
Project: 195476
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)mDataSize >> 32;
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)(mDataSize >> 32);
  return result;
}
Program: 195477
Project: 195477
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)mDataSize >> 32;
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((mName != null) ? mName.hashCode() : 0);
  result=prime * result + mContentType;
  result=prime * result + mPageCount;
  result=prime * result + (int)mDataSize;
  result=prime * result + (int)(mDataSize >> 32);
  return result;
}
Program: 195478
Project: 195478
Buggy source:
/** 
 * Called when updating or posting a notification to the heads up.
 */
public void updateNotification(NotificationData.Entry headsUp,boolean alert){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (alert) {
    mBar.scheduleHeadsUpDecay(mHeadsUpNotificationDecay);
  }
  invalidate();
  if (mHeadsUp == headsUp) {
    resetViewForHeadsup();
    return;
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mMostRecentPackageName=mHeadsUp.notification.getPackageName();
    if (mHeadsUp.row != null) {
      resetViewForHeadsup();
    }
    mStartTouchTime=SystemClock.elapsedRealtime() + mTouchSensitivityDelay;
    if (mContentHolder != null) {
      mContentHolder.setX(0);
      mContentHolder.setVisibility(View.VISIBLE);
      mContentHolder.setAlpha(mMaxAlpha);
      mContentHolder.addView(mHeadsUp.row);
      sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
      mSwipeHelper.snapChild(mContentHolder,1f);
    }
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
  }
}

Fixed version (ground truth):
/** 
 * Called when updating or posting a notification to the heads up.
 */
public void updateNotification(NotificationData.Entry headsUp,boolean alert){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (mHeadsUp == headsUp) {
    resetViewForHeadsup();
    return;
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mMostRecentPackageName=mHeadsUp.notification.getPackageName();
    if (mHeadsUp.row != null) {
      resetViewForHeadsup();
    }
    mStartTouchTime=SystemClock.elapsedRealtime() + mTouchSensitivityDelay;
    if (mContentHolder != null) {
      mContentHolder.setX(0);
      mContentHolder.setVisibility(View.VISIBLE);
      mContentHolder.setAlpha(mMaxAlpha);
      mContentHolder.addView(mHeadsUp.row);
      sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
      mSwipeHelper.snapChild(mContentHolder,1f);
    }
    mHeadsUp.setInterruption();
  }
  if (alert) {
    mBar.scheduleHeadsUpOpen();
    mBar.scheduleHeadsUpDecay(mHeadsUpNotificationDecay);
  }
}
Program: 195479
Project: 195479
Buggy source:
/** 
 * Called when updating or posting a notification to the heads up.
 */
public void updateNotification(NotificationData.Entry headsUp,boolean alert){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (alert) {
    mBar.scheduleHeadsUpDecay(mHeadsUpNotificationDecay);
  }
  invalidate();
  if (mHeadsUp == headsUp) {
    resetViewForHeadsup();
    return;
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mMostRecentPackageName=mHeadsUp.notification.getPackageName();
    if (mHeadsUp.row != null) {
      resetViewForHeadsup();
    }
    mStartTouchTime=SystemClock.elapsedRealtime() + mTouchSensitivityDelay;
    if (mContentHolder != null) {
      mContentHolder.setX(0);
      mContentHolder.setVisibility(View.VISIBLE);
      mContentHolder.setAlpha(mMaxAlpha);
      mContentHolder.addView(mHeadsUp.row);
      sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
      mSwipeHelper.snapChild(mContentHolder,1f);
    }
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
  }
}

Fixed version (ground truth):
/** 
 * Called when updating or posting a notification to the heads up.
 */
public void updateNotification(NotificationData.Entry headsUp,boolean alert){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  if (mHeadsUp == headsUp) {
    resetViewForHeadsup();
    return;
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mMostRecentPackageName=mHeadsUp.notification.getPackageName();
    if (mHeadsUp.row != null) {
      resetViewForHeadsup();
    }
    mStartTouchTime=SystemClock.elapsedRealtime() + mTouchSensitivityDelay;
    if (mContentHolder != null) {
      mContentHolder.setX(0);
      mContentHolder.setVisibility(View.VISIBLE);
      mContentHolder.setAlpha(mMaxAlpha);
      mContentHolder.addView(mHeadsUp.row);
      sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
      mSwipeHelper.snapChild(mContentHolder,1f);
    }
    mHeadsUp.setInterruption();
  }
  if (alert) {
    mBar.scheduleHeadsUpOpen();
    mBar.scheduleHeadsUpDecay(mHeadsUpNotificationDecay);
  }
}
Program: 195480
Project: 195480
Buggy source:
private boolean isBelowLastNotification(float touchX,float touchY){
  ExpandableView lastChildNotGone=(ExpandableView)getLastChildNotGone();
  if (lastChildNotGone == null) {
    return touchY > mIntrinsicPadding;
  }
  if (lastChildNotGone != mDismissView && lastChildNotGone != mEmptyShadeView) {
    return touchY > lastChildNotGone.getY() + lastChildNotGone.getActualHeight();
  }
 else   if (lastChildNotGone == mEmptyShadeView) {
    return touchY > mEmptyShadeView.getY();
  }
 else {
    float dismissY=mDismissView.getY();
    boolean belowDismissView=touchY > dismissY + mDismissView.getActualHeight();
    return belowDismissView || (touchY > dismissY && mDismissView.isOnEmptySpace(touchX - mDismissView.getX(),touchY - dismissY));
  }
}

Fixed version (ground truth):
private boolean isBelowLastNotification(float touchX,float touchY){
  int childCount=getChildCount();
  for (int i=childCount - 1; i >= 0; i--) {
    ExpandableView child=(ExpandableView)getChildAt(i);
    if (child.getVisibility() != View.GONE) {
      float childTop=child.getY();
      if (childTop > touchY) {
        return false;
      }
      boolean belowChild=touchY > childTop + child.getActualHeight();
      if (child == mDismissView) {
        if (!belowChild && !mDismissView.isOnEmptySpace(touchX - mDismissView.getX(),touchY - childTop)) {
          return false;
        }
      }
 else       if (child == mEmptyShadeView) {
        return true;
      }
 else       if (!belowChild) {
        return false;
      }
    }
  }
  return touchY > mIntrinsicPadding;
}
Program: 195481
Project: 195481
Buggy source:
private boolean isBelowLastNotification(float touchX,float touchY){
  ExpandableView lastChildNotGone=(ExpandableView)getLastChildNotGone();
  if (lastChildNotGone == null) {
    return touchY > mIntrinsicPadding;
  }
  if (lastChildNotGone != mDismissView && lastChildNotGone != mEmptyShadeView) {
    return touchY > lastChildNotGone.getY() + lastChildNotGone.getActualHeight();
  }
 else   if (lastChildNotGone == mEmptyShadeView) {
    return touchY > mEmptyShadeView.getY();
  }
 else {
    float dismissY=mDismissView.getY();
    boolean belowDismissView=touchY > dismissY + mDismissView.getActualHeight();
    return belowDismissView || (touchY > dismissY && mDismissView.isOnEmptySpace(touchX - mDismissView.getX(),touchY - dismissY));
  }
}

Fixed version (ground truth):
private boolean isBelowLastNotification(float touchX,float touchY){
  int childCount=getChildCount();
  for (int i=childCount - 1; i >= 0; i--) {
    ExpandableView child=(ExpandableView)getChildAt(i);
    if (child.getVisibility() != View.GONE) {
      float childTop=child.getY();
      if (childTop > touchY) {
        return false;
      }
      boolean belowChild=touchY > childTop + child.getActualHeight();
      if (child == mDismissView) {
        if (!belowChild && !mDismissView.isOnEmptySpace(touchX - mDismissView.getX(),touchY - childTop)) {
          return false;
        }
      }
 else       if (child == mEmptyShadeView) {
        return true;
      }
 else       if (!belowChild) {
        return false;
      }
    }
  }
  return touchY > mIntrinsicPadding;
}
Program: 195485
Project: 195485
Buggy source:
public ProcessCpuTracker(boolean includeThreads){
  mIncludeThreads=includeThreads;
}

Fixed version (ground truth):
public ProcessCpuTracker(boolean includeThreads){
  mIncludeThreads=includeThreads;
  long jiffyHz=Libcore.os.sysconf(OsConstants._SC_CLK_TCK);
  mJiffyMillis=1000 / jiffyHz;
}
Program: 195487
Project: 195487
Buggy source:
/** 
 * Returns the total time (in clock ticks, or 1/100 sec) spent executing in both user and system code.  Safe to call without lock held.
 */
public long getCpuTimeForPid(int pid){
synchronized (mSinglePidStatsData) {
    final String statFile="String_Node_Str" + pid + "String_Node_Str";
    final long[] statsData=mSinglePidStatsData;
    if (Process.readProcFile(statFile,PROCESS_STATS_FORMAT,null,statsData,null)) {
      long time=statsData[PROCESS_STAT_UTIME] + statsData[PROCESS_STAT_STIME];
      return time;
    }
    return 0;
  }
}

Fixed version (ground truth):
/** 
 * Returns the total time (in clock ticks, or 1/100 sec) spent executing in both user and system code.  Safe to call without lock held.
 */
public long getCpuTimeForPid(int pid){
synchronized (mSinglePidStatsData) {
    final String statFile="String_Node_Str" + pid + "String_Node_Str";
    final long[] statsData=mSinglePidStatsData;
    if (Process.readProcFile(statFile,PROCESS_STATS_FORMAT,null,statsData,null)) {
      long time=statsData[PROCESS_STAT_UTIME] + statsData[PROCESS_STAT_STIME];
      return time * mJiffyMillis;
    }
    return 0;
  }
}
Program: 195492
Project: 195492
Buggy source:
public ProcessCpuTracker(boolean includeThreads){
  mIncludeThreads=includeThreads;
}

Fixed version (ground truth):
public ProcessCpuTracker(boolean includeThreads){
  mIncludeThreads=includeThreads;
  long jiffyHz=Libcore.os.sysconf(OsConstants._SC_CLK_TCK);
  mJiffyMillis=1000 / jiffyHz;
}
Program: 195494
Project: 195494
Buggy source:
/** 
 * Returns the total time (in clock ticks, or 1/100 sec) spent executing in both user and system code.  Safe to call without lock held.
 */
public long getCpuTimeForPid(int pid){
synchronized (mSinglePidStatsData) {
    final String statFile="String_Node_Str" + pid + "String_Node_Str";
    final long[] statsData=mSinglePidStatsData;
    if (Process.readProcFile(statFile,PROCESS_STATS_FORMAT,null,statsData,null)) {
      long time=statsData[PROCESS_STAT_UTIME] + statsData[PROCESS_STAT_STIME];
      return time;
    }
    return 0;
  }
}

Fixed version (ground truth):
/** 
 * Returns the total time (in clock ticks, or 1/100 sec) spent executing in both user and system code.  Safe to call without lock held.
 */
public long getCpuTimeForPid(int pid){
synchronized (mSinglePidStatsData) {
    final String statFile="String_Node_Str" + pid + "String_Node_Str";
    final long[] statsData=mSinglePidStatsData;
    if (Process.readProcFile(statFile,PROCESS_STATS_FORMAT,null,statsData,null)) {
      long time=statsData[PROCESS_STAT_UTIME] + statsData[PROCESS_STAT_STIME];
      return time * mJiffyMillis;
    }
    return 0;
  }
}
Program: 195497
Project: 195497
Buggy source:
private float calculateTotalWeight(){
  float totalWeight=0f;
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    totalWeight+=spec.weight;
  }
  return totalWeight;
}

Fixed version (ground truth):
private float calculateTotalWeight(){
  float totalWeight=0f;
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE) {
      continue;
    }
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    totalWeight+=spec.weight;
  }
  return totalWeight;
}
Program: 195498
Project: 195498
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=spec.getAbsoluteAlignment(horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 195499
Project: 195499
Buggy source:
private void measureChildrenWithMargins(int widthSpec,int heightSpec,boolean firstPass){
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    if (firstPass) {
      measureChildWithMargins2(c,widthSpec,heightSpec,lp.width,lp.height);
      mHorizontalAxis.recordOriginalMeasurement(i);
      mVerticalAxis.recordOriginalMeasurement(i);
    }
 else {
      boolean horizontal=(mOrientation == HORIZONTAL);
      Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
      if (spec.alignment == FILL) {
        Interval span=spec.span;
        Axis axis=horizontal ? mHorizontalAxis : mVerticalAxis;
        int[] locations=axis.getLocations();
        int cellSize=locations[span.max] - locations[span.min];
        int viewSize=cellSize - getTotalMargin(c,horizontal);
        if (horizontal) {
          measureChildWithMargins2(c,widthSpec,heightSpec,viewSize,lp.height);
        }
 else {
          measureChildWithMargins2(c,widthSpec,heightSpec,lp.width,viewSize);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void measureChildrenWithMargins(int widthSpec,int heightSpec,boolean firstPass){
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    if (firstPass) {
      measureChildWithMargins2(c,widthSpec,heightSpec,lp.width,lp.height);
      mHorizontalAxis.recordOriginalMeasurement(i);
      mVerticalAxis.recordOriginalMeasurement(i);
    }
 else {
      boolean horizontal=(mOrientation == HORIZONTAL);
      Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
      if (spec.getAbsoluteAlignment(horizontal) == FILL) {
        Interval span=spec.span;
        Axis axis=horizontal ? mHorizontalAxis : mVerticalAxis;
        int[] locations=axis.getLocations();
        int cellSize=locations[span.max] - locations[span.min];
        int viewSize=cellSize - getTotalMargin(c,horizontal);
        if (horizontal) {
          measureChildWithMargins2(c,widthSpec,heightSpec,viewSize,lp.height);
        }
 else {
          measureChildWithMargins2(c,widthSpec,heightSpec,lp.width,viewSize);
        }
      }
    }
  }
}
Program: 195500
Project: 195500
Buggy source:
private boolean computeHasWeights(){
  for (int i=0, N=getChildCount(); i < N; i++) {
    LayoutParams lp=getLayoutParams(getChildAt(i));
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    if (spec.weight != 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean computeHasWeights(){
  for (int i=0, N=getChildCount(); i < N; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() == View.GONE) {
      continue;
    }
    LayoutParams lp=getLayoutParams(child);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    if (spec.weight != 0) {
      return true;
    }
  }
  return false;
}
Program: 195501
Project: 195501
Buggy source:
final Alignment getAlignment(Alignment alignment,boolean horizontal){
  return (alignment != UNDEFINED_ALIGNMENT) ? alignment : (horizontal ? START : BASELINE);
}

Fixed version (ground truth):
static Alignment getAlignment(int gravity,boolean horizontal){
  int mask=horizontal ? HORIZONTAL_GRAVITY_MASK : VERTICAL_GRAVITY_MASK;
  int shift=horizontal ? AXIS_X_SHIFT : AXIS_Y_SHIFT;
  int flags=(gravity & mask) >> shift;
switch (flags) {
case (AXIS_SPECIFIED | AXIS_PULL_BEFORE):
    return horizontal ? LEFT : TOP;
case (AXIS_SPECIFIED | AXIS_PULL_AFTER):
  return horizontal ? RIGHT : BOTTOM;
case (AXIS_SPECIFIED | AXIS_PULL_BEFORE | AXIS_PULL_AFTER):
return FILL;
case AXIS_SPECIFIED:
return CENTER;
case (AXIS_SPECIFIED | AXIS_PULL_BEFORE | RELATIVE_LAYOUT_DIRECTION):
return START;
case (AXIS_SPECIFIED | AXIS_PULL_AFTER | RELATIVE_LAYOUT_DIRECTION):
return END;
default :
return UNDEFINED_ALIGNMENT;
}
}
Program: 195502
Project: 195502
Buggy source:
private void shareOutDelta(int totalDelta,float totalWeight){
  Arrays.fill(deltas,0);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    float weight=spec.weight;
    if (weight != 0) {
      int delta=Math.round((weight * totalDelta / totalWeight));
      deltas[i]=delta;
      totalDelta-=delta;
      totalWeight-=weight;
    }
  }
}

Fixed version (ground truth):
private void shareOutDelta(int totalDelta,float totalWeight){
  Arrays.fill(deltas,0);
  for (int i=0, N=getChildCount(); i < N; i++) {
    final View c=getChildAt(i);
    if (c.getVisibility() == View.GONE) {
      continue;
    }
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    float weight=spec.weight;
    if (weight != 0) {
      int delta=Math.round((weight * totalDelta / totalWeight));
      deltas[i]=delta;
      totalDelta-=delta;
      totalWeight-=weight;
    }
  }
}
Program: 195503
Project: 195503
Buggy source:
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    IOException e) {
      SystemClock.sleep(1000);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    Exception e) {
      SystemClock.sleep(1000);
    }
  }
}
Program: 195504
Project: 195504
Buggy source:
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    IOException e) {
      SystemClock.sleep(1000);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    Exception e) {
      SystemClock.sleep(1000);
    }
  }
}
Program: 195505
Project: 195505
Buggy source:
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    IOException e) {
      SystemClock.sleep(1000);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (DEBUG)   Slog.d(TAG,"String_Node_Str");
  while (true) {
synchronized (this) {
      if (mStopped) {
        if (DEBUG)         Slog.d(TAG,"String_Node_Str");
        return;
      }
      try {
        openSocketLocked();
      }
 catch (      Exception e) {
        SystemClock.sleep(1000);
      }
    }
    try {
      listenToSocket();
    }
 catch (    Exception e) {
      SystemClock.sleep(1000);
    }
  }
}