Program: 25870
Project: 25870
Buggy source:
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  CursorLoader c=new CursorLoader(getActivity());
switch (id) {
case LoaderId.MARKET_SHUFFLE:
    c.setUri(Provider.URI_CARD_DATA);
  Bundle fragArgs=getArguments();
HashSet<Long> supply=new HashSet<>();
long[] supply_arr=null;
if (fragArgs != null) supply_arr=fragArgs.getLongArray(PARAM_SUPPLY);
if (supply_arr != null) for (long cardID : supply_arr) supply.add(cardID);
Long[] deck_arr=FragmentPicker.loadSelections(getActivity());
ArrayList<Long> deck=new ArrayList<>();
if (deck_arr != null) {
deck=new ArrayList<>(deck_arr.length);
for (long card : deck_arr) if (card != CardDb.ID_BLACK_MARKET && !supply.contains(card)) deck.add(card);
}
c.setProjection(new String[]{CardDb._ID});
String sel="String_Node_Str";
String[] selArgs=new String[deck.size()];
for (int i=0; i < deck.size(); i++) {
sel+="String_Node_Str";
selArgs[i]="String_Node_Str" + deck.get(i);
}
if (0 < sel.length()) sel=CardDb._ID + "String_Node_Str" + sel.substring(1)+ "String_Node_Str";
c.setSelection(sel);
c.setSelectionArgs(selArgs);
c.setSortOrder("String_Node_Str");
return c;
case LoaderId.MARKET_SHOW:
c.setUri(Provider.URI_CARD_ALL);
c.setProjection(AdapterCards.COLS_USED);
c.setSortOrder(App.sortOrder);
transId=App.transId;
if (choices == null || choices.length == 0) {
c.setSelection(CardDb._ID + "String_Node_Str");
c.setSelectionArgs(new String[]{"String_Node_Str"});
return c;
}
String cardSel="String_Node_Str";
for (long ignored : choices) cardSel+="String_Node_Str";
cardSel=CardDb._ID + "String_Node_Str" + cardSel.substring(1)+ "String_Node_Str";
c.setSelection("String_Node_Str" + cardSel + "String_Node_Str"+ App.transFilter);
String[] strChoices=new String[choices.length];
for (int i=0; i < choices.length; i++) strChoices[i]="String_Node_Str" + choices[i];
c.setSelectionArgs(strChoices);
updateView();
return c;
}
return null;
}

Fixed version (ground truth):
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  CursorLoader c=new CursorLoader(getActivity());
switch (id) {
case LoaderId.MARKET_SHUFFLE:
    c.setUri(Provider.URI_CARD_DATA);
  Bundle fragArgs=getArguments();
HashSet<Long> supply=new HashSet<>();
long[] supply_arr=null;
if (fragArgs != null) supply_arr=fragArgs.getLongArray(PARAM_SUPPLY);
if (supply_arr != null) for (long cardID : supply_arr) supply.add(cardID);
Long[] deck_arr=FragmentPicker.loadSelections(getActivity());
ArrayList<Long> deck=new ArrayList<>();
if (deck_arr != null) {
deck=new ArrayList<>(deck_arr.length);
for (long card : deck_arr) if (card != CardDb.ID_BLACK_MARKET && !supply.contains(card)) deck.add(card);
}
c.setProjection(new String[]{CardDb._ID});
String sel="String_Node_Str";
String[] selArgs=new String[deck.size()];
for (int i=0; i < deck.size(); i++) {
sel+="String_Node_Str";
selArgs[i]="String_Node_Str" + deck.get(i);
}
if (0 < sel.length()) sel=CardDb._ID + "String_Node_Str" + sel.substring(1)+ "String_Node_Str";
 else sel=CardDb._ID + "String_Node_Str";
c.setSelection(sel);
c.setSelectionArgs(selArgs);
c.setSortOrder("String_Node_Str");
return c;
case LoaderId.MARKET_SHOW:
c.setUri(Provider.URI_CARD_ALL);
c.setProjection(AdapterCards.COLS_USED);
c.setSortOrder(App.sortOrder);
transId=App.transId;
if (choices == null || choices.length == 0) {
c.setSelection(CardDb._ID + "String_Node_Str");
c.setSelectionArgs(new String[]{"String_Node_Str"});
return c;
}
String cardSel="String_Node_Str";
for (long ignored : choices) cardSel+="String_Node_Str";
cardSel=CardDb._ID + "String_Node_Str" + cardSel.substring(1)+ "String_Node_Str";
c.setSelection("String_Node_Str" + cardSel + "String_Node_Str"+ App.transFilter);
String[] strChoices=new String[choices.length];
for (int i=0; i < choices.length; i++) strChoices[i]="String_Node_Str" + choices[i];
c.setSelectionArgs(strChoices);
updateView();
return c;
}
return null;
}