nus-yam/ex-repair huggingface dataset:
Program: 194622
Project: 194622
Buggy source:
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  pae.intent.replaceExtras(pae.extras);
  pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  closeSystemDialogs("String_Node_Str");
  try {
    mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
  }
 catch (  ActivityNotFoundException e) {
    Slog.w(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void reportAssistContextExtras(IBinder token,Bundle extras,AssistStructure structure,AssistContent content,Uri referrer){
  PendingAssistExtras pae=(PendingAssistExtras)token;
synchronized (pae) {
    pae.result=extras;
    pae.structure=structure;
    pae.content=content;
    if (referrer != null) {
      pae.extras.putParcelable(Intent.EXTRA_REFERRER,referrer);
    }
    pae.haveResult=true;
    pae.notifyAll();
    if (pae.intent == null && pae.receiver == null) {
      return;
    }
  }
synchronized (this) {
    buildAssistBundleLocked(pae,extras);
    boolean exists=mPendingAssistExtras.remove(pae);
    mHandler.removeCallbacks(pae);
    if (!exists) {
      return;
    }
    if (pae.receiver != null) {
      Bundle topBundle=new Bundle();
      topBundle.putBundle("String_Node_Str",pae.extras);
      topBundle.putParcelable("String_Node_Str",pae.structure);
      topBundle.putParcelable("String_Node_Str",pae.content);
      try {
        pae.receiver.send(0,topBundle);
      }
 catch (      RemoteException e) {
      }
      return;
    }
  }
  long ident=Binder.clearCallingIdentity();
  try {
    pae.intent.replaceExtras(pae.extras);
    pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    closeSystemDialogs("String_Node_Str");
    try {
      mContext.startActivityAsUser(pae.intent,new UserHandle(pae.userHandle));
    }
 catch (    ActivityNotFoundException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 194623
Project: 194623
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194624
Project: 194624
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194625
Project: 194625
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194626
Project: 194626
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194627
Project: 194627
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194628
Project: 194628
Buggy source:
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  super.engineUpdateAAD(input,inputOffset,inputLen);
}

Fixed version (ground truth):
@Override protected final void engineUpdateAAD(ByteBuffer src){
  if (src == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!src.hasRemaining()) {
    return;
  }
  byte[] input;
  int inputOffset;
  int inputLen;
  if (src.hasArray()) {
    input=src.array();
    inputOffset=src.arrayOffset() + src.position();
    inputLen=src.remaining();
    src.position(src.limit());
  }
 else {
    input=new byte[src.remaining()];
    inputOffset=0;
    inputLen=input.length;
    src.get(input);
  }
  engineUpdateAAD(input,inputOffset,inputLen);
}
Program: 194629
Project: 194629
Buggy source:
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}

Fixed version (ground truth):
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}
Program: 194631
Project: 194631
Buggy source:
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}

Fixed version (ground truth):
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}
Program: 194633
Project: 194633
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194635
Project: 194635
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}
Program: 194636
Project: 194636
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194637
Project: 194637
Buggy source:
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}

Fixed version (ground truth):
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}
Program: 194639
Project: 194639
Buggy source:
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}

Fixed version (ground truth):
private void doOnCreate(){
  mTheme=mTheme != 0 ? mTheme : com.android.internal.R.style.Theme_DeviceDefault_VoiceInteractionSession;
  mInflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mWindow=new SoftInputWindow(mContext,"String_Node_Str",mTheme,mCallbacks,this,mDispatcherState,WindowManager.LayoutParams.TYPE_VOICE_INTERACTION,Gravity.BOTTOM,true);
  mWindow.getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
  initViews();
  mWindow.getWindow().setLayout(MATCH_PARENT,MATCH_PARENT);
  mWindow.setToken(mToken);
}
Program: 194641
Project: 194641
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194643
Project: 194643
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}
Program: 194644
Project: 194644
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194645
Project: 194645
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194647
Project: 194647
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}
Program: 194648
Project: 194648
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194649
Project: 194649
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194651
Project: 194651
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}
Program: 194652
Project: 194652
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194653
Project: 194653
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194655
Project: 194655
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}
Program: 194656
Project: 194656
Buggy source:
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}

Fixed version (ground truth):
private void startDemoMode(){
  Intent intent=new Intent(DemoMode.ACTION_DEMO);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_ENTER);
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_CLOCK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NETWORK);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_BATTERY);
  intent.putExtra("String_Node_Str","String_Node_Str");
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_STATUS);
  for (  String icon : STATUS_ICONS) {
    intent.putExtra(icon,"String_Node_Str");
  }
  getContext().sendBroadcast(intent);
  intent.putExtra(DemoMode.EXTRA_COMMAND,DemoMode.COMMAND_NOTIFICATIONS);
  intent.putExtra("String_Node_Str","String_Node_Str");
  getContext().sendBroadcast(intent);
  setGlobal(DEMO_MODE_ON,1);
}
Program: 194657
Project: 194657
Buggy source:
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
      return;
    }
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.CURRENT,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}

Fixed version (ground truth):
private void updateSlot(String slot,String iconPkg,int iconId){
  if (!mDemoMode)   return;
  if (iconPkg == null) {
    iconPkg=mContext.getPackageName();
  }
  int removeIndex=-1;
  for (int i=0; i < getChildCount(); i++) {
    StatusBarIconView v=(StatusBarIconView)getChildAt(i);
    if (slot.equals(v.getTag())) {
      if (iconId == 0) {
        removeIndex=i;
        break;
      }
 else {
        StatusBarIcon icon=v.getStatusBarIcon();
        icon.icon=Icon.createWithResource(icon.icon.getResPackage(),iconId);
        v.set(icon);
        v.updateDrawable();
        return;
      }
    }
  }
  if (iconId == 0) {
    if (removeIndex != -1) {
      removeViewAt(removeIndex);
    }
    return;
  }
  StatusBarIcon icon=new StatusBarIcon(iconPkg,UserHandle.OWNER,iconId,0,0,"String_Node_Str");
  StatusBarIconView v=new StatusBarIconView(getContext(),null,null);
  v.setTag(slot);
  v.set(icon);
  addView(v,0,new LinearLayout.LayoutParams(mIconSize,mIconSize));
}
Program: 194659
Project: 194659
Buggy source:
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    notifyListeners();
  }
}

Fixed version (ground truth):
@VisibleForTesting protected void updateNoSims(){
  boolean hasNoSims=mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
  if (hasNoSims != mHasNoSims) {
    mHasNoSims=hasNoSims;
    mCallbackHandler.setNoSims(mHasNoSims);
  }
}