Program: 37580
Project: 37580
Buggy source:
public CustomAdapter(Context context,ArrayList<AppData> curCatData,int curMode){
  super();
  this.mContext=context;
  this.catData=curCatData;
  toDisplay=catData;
  this.curMode=curMode;
  onClickListener=new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      if (arg0.getTag() instanceof AppData)       ((Apps)mContext).launch((AppData)arg0.getTag());
    }
  }
;
  if (lock) {
    onLongClickListener=new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        final View v=arg0;
        AlertDialog.Builder builder=new AlertDialog.Builder(mContext);
        builder.setMessage(mContext.getResources().getString(R.string.type_password));
        final EditText inputBox=new EditText(mContext);
        inputBox.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        builder.setView(inputBox);
        builder.setPositiveButton(android.R.string.yes,new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            if (inputBox.getText().toString().equals(options.getString(Options.PREF_PASSWORD,"String_Node_Str"))) {
              ((Apps)mContext).itemContextMenu((AppData)v.getTag());
            }
 else {
              Toast.makeText(mContext,mContext.getResources().getString(R.string.wrong_password),Toast.LENGTH_LONG).show();
            }
          }
        }
);
        builder.setCancelable(true);
        builder.show();
        return false;
      }
    }
;
  }
 else {
    onLongClickListener=new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        ((Apps)mContext).itemContextMenu((AppData)arg0.getTag());
        return false;
      }
    }
;
  }
  comparator=new Comparator<AppData>(){
    @Override public int compare(    AppData first,    AppData second){
      boolean firstStarts=first.name.toLowerCase().startsWith(searchInput);
      boolean secondStarts=second.name.toLowerCase().startsWith(searchInput);
      if (firstStarts && !secondStarts) {
        return -1;
      }
 else       if (!firstStarts && secondStarts) {
        return 1;
      }
 else {
        return AppData.NameComparator.compare(first,second);
      }
    }
  }
;
}

Fixed version (ground truth):
public CustomAdapter(Context context){
  super();
  this.mContext=context;
  curCatData=new ArrayList<AppData>();
  toDisplay=new ArrayList<AppData>();
  onClickListener=new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      if (arg0.getTag() instanceof AppData)       ((Apps)mContext).launch((AppData)arg0.getTag());
    }
  }
;
  if (lock) {
    onLongClickListener=new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        final View v=arg0;
        AlertDialog.Builder builder=new AlertDialog.Builder(mContext);
        builder.setMessage(mContext.getResources().getString(R.string.type_password));
        final EditText inputBox=new EditText(mContext);
        inputBox.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        builder.setView(inputBox);
        builder.setPositiveButton(android.R.string.yes,new DialogInterface.OnClickListener(){
          @Override public void onClick(          DialogInterface dialog,          int which){
            if (inputBox.getText().toString().equals(options.getString(Options.PREF_PASSWORD,"String_Node_Str"))) {
              ((Apps)mContext).itemContextMenu((AppData)v.getTag());
            }
 else {
              Toast.makeText(mContext,mContext.getResources().getString(R.string.wrong_password),Toast.LENGTH_LONG).show();
            }
          }
        }
);
        builder.setCancelable(true);
        builder.show();
        return false;
      }
    }
;
  }
 else {
    onLongClickListener=new View.OnLongClickListener(){
      @Override public boolean onLongClick(      View arg0){
        ((Apps)mContext).itemContextMenu((AppData)arg0.getTag());
        return false;
      }
    }
;
  }
  comparator=new Comparator<AppData>(){
    @Override public int compare(    AppData first,    AppData second){
      boolean firstStarts=first.name.toLowerCase().startsWith(searchInput);
      boolean secondStarts=second.name.toLowerCase().startsWith(searchInput);
      if (firstStarts && !secondStarts) {
        return -1;
      }
 else       if (!firstStarts && secondStarts) {
        return 1;
      }
 else {
        return AppData.NameComparator.compare(first,second);
      }
    }
  }
;
}