Program: 197935
Project: 197935
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      AlertDialog.Builder builder=new AlertDialog.Builder(ActivityTestMain.this,R.style.SlowDialog);
      builder.setTitle("String_Node_Str");
      builder.show();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserService.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindService(intent,conn,Context.BIND_AUTO_CREATE)) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserService.class);
      startService(intent);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserReceiver.class);
      sendOrderedBroadcast(intent,null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ContentProviderClient cpl=getContentResolver().acquireContentProviderClient(SingleUserProvider.AUTHORITY);
      Bundle res=null;
      try {
        res=cpl.call("String_Node_Str",null,null);
      }
 catch (      RemoteException e) {
      }
      int user=res != null ? res.getInt("String_Node_Str",-1) : -1;
      Toast.makeText(ActivityTestMain.this,"String_Node_Str" + (user >= 0 ? Integer.toString(user) : "String_Node_Str"),Toast.LENGTH_LONG).show();
      cpl.release();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,UserTarget.class);
      sendOrderedBroadcastAsUser(intent,new UserHandle(0),null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str" + mSecondUser + "String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,UserTarget.class);
      sendOrderedBroadcastAsUser(intent,new UserHandle(mSecondUser),null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,ServiceUserTarget.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindServiceAsUser(intent,conn,Context.BIND_AUTO_CREATE,UserHandle.OWNER)) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str" + mSecondUser + "String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,ServiceUserTarget.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindServiceAsUser(intent,conn,Context.BIND_AUTO_CREATE,new UserHandle(mSecondUser))) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      if (mOverrideConfig == null) {
        mOverrideConfig=new Configuration();
      }
      if (mOverrideConfig.densityDpi == Configuration.DENSITY_DPI_UNDEFINED) {
        mOverrideConfig.densityDpi=(getApplicationContext().getResources().getConfiguration().densityDpi * 2) / 3;
      }
 else {
        mOverrideConfig.densityDpi=Configuration.DENSITY_DPI_UNDEFINED;
      }
      recreate();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ArrayMapTests.run();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      addAppRecents(1);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      addAppRecents(10);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      setExclude(true);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      setExclude(false);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ActivityManager.AppTask task=findDocTask();
      if (task == null) {
        Intent intent=new Intent(ActivityTestMain.this,DocActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS);
        startActivity(intent);
      }
 else {
        task.moveToFront();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ActivityManager.AppTask task=findDocTask();
      if (task != null) {
        ActivityManager.RecentTaskInfo recent=task.getTaskInfo();
        Intent intent=new Intent(ActivityTestMain.this,DocActivity.class);
        if (recent.id >= 0) {
          intent.putExtra(DocActivity.LABEL,"String_Node_Str");
          task.startActivity(ActivityTestMain.this,intent,null);
        }
 else {
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS);
          intent.putExtra(DocActivity.LABEL,"String_Node_Str");
          task.startActivity(ActivityTestMain.this,intent,null);
        }
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      scheduleSpam(false);
      return true;
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      AlertDialog.Builder builder=new AlertDialog.Builder(ActivityTestMain.this,R.style.SlowDialog);
      builder.setTitle("String_Node_Str");
      builder.show();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserService.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindService(intent,conn,Context.BIND_AUTO_CREATE)) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserService.class);
      startService(intent);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,SingleUserReceiver.class);
      sendOrderedBroadcast(intent,null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ContentProviderClient cpl=getContentResolver().acquireContentProviderClient(SingleUserProvider.AUTHORITY);
      Bundle res=null;
      try {
        res=cpl.call("String_Node_Str",null,null);
      }
 catch (      RemoteException e) {
      }
      int user=res != null ? res.getInt("String_Node_Str",-1) : -1;
      Toast.makeText(ActivityTestMain.this,"String_Node_Str" + (user >= 0 ? Integer.toString(user) : "String_Node_Str"),Toast.LENGTH_LONG).show();
      cpl.release();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,UserTarget.class);
      sendOrderedBroadcastAsUser(intent,new UserHandle(0),null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str" + mSecondUser + "String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,UserTarget.class);
      sendOrderedBroadcastAsUser(intent,new UserHandle(mSecondUser),null,new BroadcastResultReceiver(),null,Activity.RESULT_OK,null,null);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,ServiceUserTarget.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindServiceAsUser(intent,conn,Context.BIND_AUTO_CREATE,UserHandle.OWNER)) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str" + mSecondUser + "String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      Intent intent=new Intent(ActivityTestMain.this,ServiceUserTarget.class);
      ServiceConnection conn=new ServiceConnection(){
        @Override public void onServiceConnected(        ComponentName name,        IBinder service){
          Log.i(TAG,"String_Node_Str" + name + "String_Node_Str"+ service);
        }
        @Override public void onServiceDisconnected(        ComponentName name){
          Log.i(TAG,"String_Node_Str" + name);
        }
      }
;
      if (bindServiceAsUser(intent,conn,Context.BIND_AUTO_CREATE,new UserHandle(mSecondUser))) {
        mConnections.add(conn);
      }
 else {
        Toast.makeText(ActivityTestMain.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      if (mOverrideConfig == null) {
        mOverrideConfig=new Configuration();
      }
      if (mOverrideConfig.densityDpi == Configuration.DENSITY_DPI_UNDEFINED) {
        mOverrideConfig.densityDpi=(getApplicationContext().getResources().getConfiguration().densityDpi * 2) / 3;
      }
 else {
        mOverrideConfig.densityDpi=Configuration.DENSITY_DPI_UNDEFINED;
      }
      recreate();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ArrayMapTests.run();
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      addAppRecents(1);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      addAppRecents(10);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      setExclude(true);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      setExclude(false);
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ActivityManager.AppTask task=findDocTask();
      if (task == null) {
        Intent intent=new Intent(ActivityTestMain.this,DocActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS);
        startActivity(intent);
      }
 else {
        task.moveToFront();
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ActivityManager.AppTask task=findDocTask();
      if (task != null) {
        ActivityManager.RecentTaskInfo recent=task.getTaskInfo();
        Intent intent=new Intent(ActivityTestMain.this,DocActivity.class);
        if (recent.id >= 0) {
          intent.putExtra(DocActivity.LABEL,"String_Node_Str");
        }
 else {
          intent.putExtra(DocActivity.LABEL,"String_Node_Str");
        }
        task.startActivity(ActivityTestMain.this,intent,null);
      }
      return true;
    }
  }
);
  menu.add("String_Node_Str").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      scheduleSpam(false);
      return true;
    }
  }
);
  return true;
}