Program: 86951
Project: 86951
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  if (getItemViewType(position) == ITEM_VIEW_TYPE_USER) {
    final User user=(User)getItem(position);
    UserViewHolder viewHolder;
    if (convertView == null) {
      convertView=inflater.inflate(mResource,parent,false);
      viewHolder=new UserViewHolder();
      viewHolder.name=(TextView)convertView.findViewById(R.id.user_name_text_view);
      viewHolder.type=(TextView)convertView.findViewById(R.id.user_type_text_view);
      viewHolder.userImage=(ImageView)convertView.findViewById(R.id.user_image_view);
      viewHolder.deleteImage=(ImageView)convertView.findViewById(R.id.user_selected_tick_image_view);
      convertView.setTag(viewHolder);
    }
 else {
      viewHolder=(UserViewHolder)convertView.getTag();
    }
    viewHolder.name.setText(user.getUserName());
    if (position == mDeviceOwnerIndex) {
      viewHolder.type.setText(getContext().getString(R.string.user_type_device_owner));
      if (viewHolder.deleteImage != null) {
        viewHolder.deleteImage.setVisibility(View.GONE);
      }
    }
 else {
      viewHolder.type.setText(getContext().getString(R.string.user_type_restricted_profile));
      if (viewHolder.deleteImage != null) {
        viewHolder.deleteImage.setVisibility(View.VISIBLE);
        viewHolder.deleteImage.setOnTouchListener(new Picture.PictureTouchListener());
        viewHolder.deleteImage.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View v){
            user.deleteFromDatabase(getContext());
            if (mListener != null) {
              mListener.onUsersModified();
            }
          }
        }
);
      }
    }
    viewHolder.userImage.setImageDrawable(user.getUserPictureDrawable(getContext()));
  }
 else {
    if (convertView == null) {
      convertView=inflater.inflate(mNewUserResource,parent,false);
    }
    convertView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        if (mNewUserResource == R.layout.nav_drawer_new_profile) {
          AlertDialog.Builder builder=new AlertDialog.Builder(getContext());
          builder.setTitle(R.string.title_add_new_profile);
          View newProfileDialogView=inflater.inflate(R.layout.dialog_add_profile,null,false);
          final EditText profileNameEditText=(EditText)newProfileDialogView.findViewById(R.id.edit_text_new_profile_name);
          builder.setView(newProfileDialogView);
          builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialog,            int which){
              if (profileNameEditText.getText().toString().isEmpty()) {
                return;
              }
              User newUser=new User(profileNameEditText.getText().toString());
              newUser.insertIntoDatabase(getContext());
              if (mListener != null) {
                mListener.onUsersModified();
              }
            }
          }
);
          builder.create().show();
        }
 else {
          Intent intent=new Intent(getContext().getApplicationContext(),SmartLockScreenSettings.class);
          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          mContext.startActivity(intent);
          if (mListener != null) {
            mListener.onSettingsClicked();
          }
        }
      }
    }
);
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  if (getItemViewType(position) == ITEM_VIEW_TYPE_USER) {
    final User user=(User)getItem(position);
    UserViewHolder viewHolder;
    if (convertView == null) {
      convertView=inflater.inflate(mResource,parent,false);
      viewHolder=new UserViewHolder();
      viewHolder.name=(TextView)convertView.findViewById(R.id.user_name_text_view);
      viewHolder.type=(TextView)convertView.findViewById(R.id.user_type_text_view);
      viewHolder.userImage=(ImageView)convertView.findViewById(R.id.user_image_view);
      viewHolder.deleteImage=(ImageView)convertView.findViewById(R.id.user_selected_tick_image_view);
      convertView.setTag(viewHolder);
    }
 else {
      viewHolder=(UserViewHolder)convertView.getTag();
    }
    viewHolder.name.setTypeface(Typeface.DEFAULT_BOLD);
    viewHolder.name.setText(user.getUserName());
    if (position == mDeviceOwnerIndex) {
      viewHolder.type.setText(getContext().getString(R.string.user_type_device_owner));
      if (viewHolder.deleteImage != null) {
        viewHolder.deleteImage.setVisibility(View.GONE);
      }
    }
 else {
      viewHolder.type.setText(getContext().getString(R.string.user_type_restricted_profile));
      if (viewHolder.deleteImage != null) {
        viewHolder.deleteImage.setVisibility(View.VISIBLE);
        viewHolder.deleteImage.setOnTouchListener(new Picture.PictureTouchListener());
        viewHolder.deleteImage.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View v){
            user.deleteFromDatabase(getContext());
            if (mListener != null) {
              mListener.onUsersModified();
            }
          }
        }
);
      }
    }
    viewHolder.userImage.setImageDrawable(user.getUserPictureDrawable(getContext()));
  }
 else {
    if (convertView == null) {
      convertView=inflater.inflate(mNewUserResource,parent,false);
    }
    convertView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        if (mNewUserResource == R.layout.nav_drawer_new_profile) {
          AlertDialog.Builder builder=new AlertDialog.Builder(getContext());
          builder.setTitle(R.string.title_add_new_profile);
          View newProfileDialogView=inflater.inflate(R.layout.dialog_add_profile,null,false);
          final EditText profileNameEditText=(EditText)newProfileDialogView.findViewById(R.id.edit_text_new_profile_name);
          builder.setView(newProfileDialogView);
          builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialog,            int which){
              if (profileNameEditText.getText().toString().isEmpty()) {
                return;
              }
              User newUser=new User(profileNameEditText.getText().toString());
              newUser.insertIntoDatabase(getContext());
              if (mListener != null) {
                mListener.onUsersModified();
              }
            }
          }
);
          builder.create().show();
        }
 else {
          Intent intent=new Intent(getContext().getApplicationContext(),SmartLockScreenSettings.class);
          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          mContext.startActivity(intent);
          if (mListener != null) {
            mListener.onSettingsClicked();
          }
        }
      }
    }
);
  }
  return convertView;
}