nus-yam/ex-repair huggingface dataset:
Program: 94063
Project: 94063
Buggy source:
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  super.beforeHookedMethod(param);
  Object packet=param.args[1];
  String type=(String)getObjectField(packet,"String_Node_Str");
switch (type) {
case "String_Node_Str":
    if (blockPresence) {
      Logger.log("String_Node_Str",LogType.PREMIUM);
      initPresenceBlocking(lpparam.classLoader,packet);
    }
  break;
case "String_Node_Str":
boolean isReplayed=(boolean)getObjectField(packet,"String_Node_Str");
if (stealthViewing && !isReplayed) {
Logger.log("String_Node_Str",LogType.PREMIUM);
setObjectField(packet,"String_Node_Str",false);
}
break;
case "String_Node_Str":
if (stealthViewing) {
Logger.log("String_Node_Str",LogType.PREMIUM);
param.setResult(null);
}
break;
case "String_Node_Str":
if (stealthSaving) {
Logger.log("String_Node_Str",LogType.PREMIUM);
setObjectField(packet,"String_Node_Str","String_Node_Str");
}
break;
}
}

Fixed version (ground truth):
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  super.beforeHookedMethod(param);
  Object packet=param.args[0];
  if ((snapUpdateClass.isInstance(packet) && stealthViewing) || (chatTypingClass.isInstance(packet) && blockPresence))   param.setResult(true);
}
Program: 94065
Project: 94065
Buggy source:
public static String stripKey(String input){
  String finalOutput=input;
  if (finalOutput.contains("String_Node_Str"))   finalOutput=finalOutput.replace("String_Node_Str","String_Node_Str");
 else   if (finalOutput.contains("String_Node_Str")) {
    String[] split=input.split("String_Node_Str");
    if (split.length > 0)     finalOutput=split[split.length - 1];
  }
  if (finalOutput.contains("String_Node_Str")) {
    String[] split=finalOutput.split("String_Node_Str");
    if (split.length > 0)     finalOutput=split[0];
  }
  return finalOutput;
}

Fixed version (ground truth):
public static String stripKey(String input){
  String finalOutput=input;
  if (finalOutput.contains("String_Node_Str"))   finalOutput=finalOutput.replace("String_Node_Str","String_Node_Str");
 else   if (finalOutput.contains("String_Node_Str")) {
    String[] split=input.split("String_Node_Str");
    if (split.length > 0)     finalOutput=split[split.length - 1];
  }
 else   if (finalOutput.contains("String_Node_Str")) {
    String[] split=finalOutput.split("String_Node_Str");
    if (split.length > 0) {
      finalOutput=split[split.length - 1];
      finalOutput=finalOutput.substring(1);
    }
  }
  if (finalOutput.contains("String_Node_Str")) {
    String[] split=finalOutput.split("String_Node_Str");
    if (split.length > 0)     finalOutput=split[0];
  }
  return finalOutput;
}
Program: 94066
Project: 94066
Buggy source:
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  super.beforeHookedMethod(param);
  Logger.log("String_Node_Str",LogType.CHAT);
  Uri videoUri=(Uri)getObjectField(param.thisObject,"String_Node_Str");
  if (videoUri == null) {
    Logger.log("String_Node_Str",LogType.CHAT);
    return;
  }
  String strVideoUrl=videoUri.getPath();
  String[] arrSplitUrl=strVideoUrl.split("String_Node_Str");
  if (arrSplitUrl.length <= 0) {
    Logger.log("String_Node_Str",LogType.CHAT);
    return;
  }
  String splitUrl=arrSplitUrl[1];
  setAdditionalInstanceField(param.thisObject,"String_Node_Str",splitUrl);
  Logger.log("String_Node_Str",LogType.CHAT);
}

Fixed version (ground truth):
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  super.beforeHookedMethod(param);
  Logger.log("String_Node_Str",LogType.CHAT);
  Uri videoUri=(Uri)getObjectField(param.thisObject,"String_Node_Str");
  if (videoUri == null) {
    Logger.log("String_Node_Str",LogType.CHAT);
    return;
  }
  String strVideoUrl=videoUri.getPath();
  String[] arrSplitUrl=strVideoUrl.split("String_Node_Str");
  if (arrSplitUrl.length <= 1) {
    Logger.log("String_Node_Str",LogType.CHAT);
    return;
  }
  String splitUrl=arrSplitUrl[1];
  setAdditionalInstanceField(param.thisObject,"String_Node_Str",splitUrl);
  Logger.log("String_Node_Str",LogType.CHAT);
}
Program: 94068
Project: 94068
Buggy source:
private void displayDebugMenu(LayoutInflater inflater){
  View view=inflater.inflate(R.layout.debug_layout,null,false);
  LinearLayout layout=(LinearLayout)view.findViewById(R.id.scroll_logtype_container);
  applyLogTypeSwitches(layout);
  AlertDialog.Builder builder=new AlertDialog.Builder(this.getContext());
  builder.setView(view);
  builder.setPositiveButton("String_Node_Str",null);
  builder.show();
}

Fixed version (ground truth):
private void displayDebugMenu(LayoutInflater inflater){
  View view=inflater.inflate(R.layout.debug_layout,null,false);
  Switch debugSwitch=(Switch)view.findViewById(R.id.switch_debug_master);
  debugSwitch.setChecked(Preferences.getBool(Preferences.Prefs.DEBUGGING));
  debugSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Preferences.Prefs.DEBUGGING.key,isChecked);
    }
  }
);
  LinearLayout layout=(LinearLayout)view.findViewById(R.id.scroll_logtype_container);
  applyLogTypeSwitches(layout);
  AlertDialog.Builder builder=new AlertDialog.Builder(this.getContext());
  builder.setView(view);
  builder.setPositiveButton("String_Node_Str",null);
  builder.show();
}
Program: 94069
Project: 94069
Buggy source:
private static void buildModifiedList(List<Object> list,LensType type){
  Logger.log("String_Node_Str" + list.size(),LogType.LENS);
  final LinkedHashMap<String,Object> queriedList=(LinkedHashMap<String,Object>)getLensDatabase().getAllActive();
  final boolean canInjectLenses=queriedList != null;
  if (!canInjectLenses)   Logger.log("String_Node_Str" + type,LogType.LENS);
  HashSet<String> containedList=new HashSet<>();
  for (  Object lens : list) {
    String mCode=(String)getObjectField(lens,"String_Node_Str");
    if (Preferences.getBool(Prefs.LENSES_COLLECT) && (!canInjectLenses || !queriedList.containsKey(mCode))) {
      performLensSave(lens,type);
    }
    if (!Preferences.getBool(Prefs.LENSES_HIDE_CURRENTLY_PROVIDED_SC_LENSES) && canInjectLenses)     containedList.add(mCode);
  }
  if (Preferences.getBool(Prefs.LENSES_HIDE_CURRENTLY_PROVIDED_SC_LENSES))   list.clear();
  if (!Preferences.getBool(Prefs.LENSES_LOAD) || !canInjectLenses)   return;
  Logger.log("String_Node_Str" + queriedList.size(),LogType.LENS);
  int injectedLensCount=0;
  for (  Object lensObj : queriedList.values()) {
    LensData lensData=(LensData)lensObj;
    String mCode=lensData.mCode;
    if (!lensData.mActive || containedList.contains(mCode))     continue;
    Object lens=buildModifiedLens(lensData,type);
    list.add(lens);
    injectedLensCount++;
  }
  Logger.log(String.format("String_Node_Str",injectedLensCount,String.valueOf(type)),LogType.LENS);
}

Fixed version (ground truth):
private static void buildModifiedList(List<Object> list,LensType type){
  Logger.log("String_Node_Str" + list.size(),LogType.LENS);
  final LinkedHashMap<String,Object> queriedList=(LinkedHashMap<String,Object>)getLensDatabase().getAllActive();
  final boolean canInjectLenses=queriedList != null;
  if (!canInjectLenses)   Logger.log("String_Node_Str" + type,LogType.LENS);
  HashSet<String> containedList=new HashSet<>();
  for (  Object lens : list) {
    String mCode=(String)getObjectField(lens,"String_Node_Str");
    if (Preferences.getBool(Prefs.LENSES_COLLECT) && (!canInjectLenses || !queriedList.containsKey(mCode)) && !getLensDatabase().containsLens(mCode)) {
      performLensSave(lens,type);
    }
    if (!Preferences.getBool(Prefs.LENSES_HIDE_CURRENTLY_PROVIDED_SC_LENSES) && canInjectLenses)     containedList.add(mCode);
  }
  if (Preferences.getBool(Prefs.LENSES_HIDE_CURRENTLY_PROVIDED_SC_LENSES))   list.clear();
  if (!Preferences.getBool(Prefs.LENSES_LOAD) || !canInjectLenses)   return;
  Logger.log("String_Node_Str" + queriedList.size(),LogType.LENS);
  int injectedLensCount=0;
  for (  Object lensObj : queriedList.values()) {
    LensData lensData=(LensData)lensObj;
    String mCode=lensData.mCode;
    if (!lensData.mActive || containedList.contains(mCode))     continue;
    Object lens=buildModifiedLens(lensData,type);
    list.add(lens);
    injectedLensCount++;
  }
  Logger.log(String.format("String_Node_Str",injectedLensCount,String.valueOf(type)),LogType.LENS);
}
Program: 94070
Project: 94070
Buggy source:
private void displayDebugMenu(LayoutInflater inflater){
  View view=inflater.inflate(R.layout.debug_layout,null,false);
  LinearLayout layout=(LinearLayout)view.findViewById(R.id.scroll_logtype_container);
  applyLogTypeSwitches(layout);
  AlertDialog.Builder builder=new AlertDialog.Builder(this.getContext());
  builder.setView(view);
  builder.setPositiveButton("String_Node_Str",null);
  builder.show();
}

Fixed version (ground truth):
private void displayDebugMenu(LayoutInflater inflater){
  View view=inflater.inflate(R.layout.debug_layout,null,false);
  Switch debugSwitch=(Switch)view.findViewById(R.id.switch_debug_master);
  debugSwitch.setChecked(Preferences.getBool(Preferences.Prefs.DEBUGGING));
  debugSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Preferences.putBool(Preferences.Prefs.DEBUGGING.key,isChecked);
    }
  }
);
  LinearLayout layout=(LinearLayout)view.findViewById(R.id.scroll_logtype_container);
  applyLogTypeSwitches(layout);
  AlertDialog.Builder builder=new AlertDialog.Builder(this.getContext());
  builder.setView(view);
  builder.setPositiveButton("String_Node_Str",null);
  builder.show();
}
Program: 94072
Project: 94072
Buggy source:
@Override public void run(){
  Button add=new Button(HookMethods.SnapContext);
  add.setText("String_Node_Str");
  add.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  boolean shouldShowAdd=true;
  if (Groups.groups.size() == 3 && Preferences.getLicence() == 0) {
    shouldShowAdd=false;
  }
  if (Preferences.getLicence() != 0 && !Preferences.getBool(Prefs.UNLIM_GROUPS)) {
    shouldShowAdd=false;
  }
  if (shouldShowAdd) {
    v.addView(add);
  }
  add.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      FragmentTransaction ft=HookMethods.SnapContext.getFragmentManager().beginTransaction();
      Fragment prev=HookMethods.SnapContext.getFragmentManager().findFragmentByTag("String_Node_Str");
      if (prev != null) {
        ft.remove(prev);
      }
      ft.addToBackStack(null);
      DialogFragment newFragment=GroupDialogList.newInstance("String_Node_Str");
      GroupDialogList.setGroup(null);
      newFragment.show(ft,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
@Override public void run(){
  Button add=new Button(HookMethods.SnapContext);
  add.setText("String_Node_Str");
  add.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  boolean shouldShowAdd=true;
  if (Groups.groups.size() == 3 && Preferences.getLicence() == 0)   shouldShowAdd=false;
  if (Preferences.getLicence() != 0 && !Preferences.getBool(Prefs.UNLIM_GROUPS))   shouldShowAdd=false;
  if (shouldShowAdd)   v.addView(add);
  add.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      FragmentTransaction ft=HookMethods.SnapContext.getFragmentManager().beginTransaction();
      Fragment prev=HookMethods.SnapContext.getFragmentManager().findFragmentByTag("String_Node_Str");
      if (prev != null) {
        ft.remove(prev);
      }
      ft.addToBackStack(null);
      DialogFragment newFragment=GroupDialogList.newInstance("String_Node_Str");
      GroupDialogList.setGroup(null);
      newFragment.show(ft,"String_Node_Str");
    }
  }
);
}
Program: 94073
Project: 94073
Buggy source:
public static void readGroups(){
  new Thread(new Runnable(){
    @Override public void run(){
      File groupFolder=groupsDir;
      if (!groupFolder.exists()) {
        groupFolder.mkdir();
      }
      File[] groupFiles=groupFolder.listFiles();
      if (groupFiles == null || groupFiles.length == 0) {
        groups.clear();
        return;
      }
      groups.clear();
      int numGroups=0;
      for (      File group : groupFiles) {
        String data=FileUtils.readFromSD(group);
        if (!data.equalsIgnoreCase("String_Node_Str")) {
          String[] groupData=data.split("String_Node_Str");
          String name=groupData[0];
          ArrayList<String> users=new ArrayList<>(Arrays.asList(groupData));
          users.remove(0);
          Group currentGroup=new Group(name,users);
          if (numGroups == 3 && Preferences.getLicence() == 0) {
            NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
            return;
          }
          if (Preferences.getLicence() != 0 && !Preferences.getBool(Preferences.Prefs.UNLIM_GROUPS) && numGroups > 3) {
            NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
            return;
          }
          if (!groups.contains(currentGroup)) {
            groups.add(currentGroup);
            numGroups++;
          }
        }
      }
      Collections.sort(groups,new Groups.groupComparator());
    }
  }
).start();
}

Fixed version (ground truth):
public static void readGroups(){
  new Thread(new Runnable(){
    @Override public void run(){
      File groupFolder=groupsDir;
      if (!groupFolder.exists()) {
        groupFolder.mkdir();
      }
      File[] groupFiles=groupFolder.listFiles();
      if (groupFiles == null || groupFiles.length == 0) {
        groups.clear();
        return;
      }
      groups.clear();
      int numGroups=0;
      for (      File group : groupFiles) {
        String data=FileUtils.readFromSD(group);
        if (!data.equalsIgnoreCase("String_Node_Str")) {
          String[] groupData=data.split("String_Node_Str");
          String name=groupData[0];
          ArrayList<String> users=new ArrayList<>(Arrays.asList(groupData));
          users.remove(0);
          Group currentGroup=new Group(name,users);
          if (numGroups == 3 && Preferences.getLicence() == 0) {
            NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
            return;
          }
          if (Preferences.getLicence() != 0 && !Preferences.getBool(Preferences.Prefs.UNLIM_GROUPS) && numGroups > 3) {
            NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
            return;
          }
          if (!groups.add(currentGroup))           numGroups++;
        }
      }
      Collections.sort(groups,new Groups.groupComparator());
    }
  }
).start();
}
Program: 94074
Project: 94074
Buggy source:
@Override public void run(){
  File groupFolder=groupsDir;
  if (!groupFolder.exists()) {
    groupFolder.mkdir();
  }
  File[] groupFiles=groupFolder.listFiles();
  if (groupFiles == null || groupFiles.length == 0) {
    groups.clear();
    return;
  }
  groups.clear();
  int numGroups=0;
  for (  File group : groupFiles) {
    String data=FileUtils.readFromSD(group);
    if (!data.equalsIgnoreCase("String_Node_Str")) {
      String[] groupData=data.split("String_Node_Str");
      String name=groupData[0];
      ArrayList<String> users=new ArrayList<>(Arrays.asList(groupData));
      users.remove(0);
      Group currentGroup=new Group(name,users);
      if (numGroups == 3 && Preferences.getLicence() == 0) {
        NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
        return;
      }
      if (Preferences.getLicence() != 0 && !Preferences.getBool(Preferences.Prefs.UNLIM_GROUPS) && numGroups > 3) {
        NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
        return;
      }
      if (!groups.contains(currentGroup)) {
        groups.add(currentGroup);
        numGroups++;
      }
    }
  }
  Collections.sort(groups,new Groups.groupComparator());
}

Fixed version (ground truth):
@Override public void run(){
  File groupFolder=groupsDir;
  if (!groupFolder.exists()) {
    groupFolder.mkdir();
  }
  File[] groupFiles=groupFolder.listFiles();
  if (groupFiles == null || groupFiles.length == 0) {
    groups.clear();
    return;
  }
  groups.clear();
  int numGroups=0;
  for (  File group : groupFiles) {
    String data=FileUtils.readFromSD(group);
    if (!data.equalsIgnoreCase("String_Node_Str")) {
      String[] groupData=data.split("String_Node_Str");
      String name=groupData[0];
      ArrayList<String> users=new ArrayList<>(Arrays.asList(groupData));
      users.remove(0);
      Group currentGroup=new Group(name,users);
      if (numGroups == 3 && Preferences.getLicence() == 0) {
        NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
        return;
      }
      if (Preferences.getLicence() != 0 && !Preferences.getBool(Preferences.Prefs.UNLIM_GROUPS) && numGroups > 3) {
        NotificationUtils.showMessage("String_Node_Str",Color.RED,NotificationUtils.LENGTH_SHORT,HookMethods.classLoader);
        return;
      }
      if (!groups.add(currentGroup))       numGroups++;
    }
  }
  Collections.sort(groups,new Groups.groupComparator());
}
Program: 94078
Project: 94078
Buggy source:
private static void showStealthToast(ToastType type){
  if (statusDrawable == null)   return;
  final int offset=20;
  if (lastToastType == null || type != lastToastType) {
    lastToastType=type;
    statusDrawable.setColorFilter(new PorterDuffColorFilter(type.color,PorterDuff.Mode.MULTIPLY));
  }
  final ImageView view=new ImageView(HookMethods.SnapContext);
  view.setImageDrawable(statusDrawable);
  view.bringToFront();
  HookMethods.SnapContext.runOnUiThread(new Runnable(){
    @Override public void run(){
      Toast statusToast=new Toast(HookMethods.SnapContext);
      statusToast.setView(view);
      statusToast.setGravity(Gravity.BOTTOM | Gravity.START,offset,offset);
      statusToast.setDuration(Toast.LENGTH_LONG);
      statusToast.show();
    }
  }
);
}

Fixed version (ground truth):
private static void showStealthToast(ToastType type){
  if (statusDrawable == null)   return;
  final int offset=20;
  final boolean longLength=Preferences.getInt(Prefs.TOAST_LENGTH) == Preferences.TOAST_LENGTH_LONG;
  if (lastToastType == null || type != lastToastType) {
    lastToastType=type;
    statusDrawable.setColorFilter(new PorterDuffColorFilter(type.color,PorterDuff.Mode.MULTIPLY));
  }
  final ImageView view=new ImageView(HookMethods.SnapContext);
  view.setImageDrawable(statusDrawable);
  view.bringToFront();
  HookMethods.SnapContext.runOnUiThread(new Runnable(){
    @Override public void run(){
      Toast statusToast=new Toast(HookMethods.SnapContext);
      statusToast.setView(view);
      statusToast.setGravity(Gravity.BOTTOM | Gravity.START,offset,offset);
      statusToast.setDuration(longLength ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
      statusToast.show();
    }
  }
);
}
Program: 94079
Project: 94079
Buggy source:
@Override public void run(){
  Toast statusToast=new Toast(HookMethods.SnapContext);
  statusToast.setView(view);
  statusToast.setGravity(Gravity.BOTTOM | Gravity.START,offset,offset);
  statusToast.setDuration(Toast.LENGTH_LONG);
  statusToast.show();
}

Fixed version (ground truth):
@Override public void run(){
  Toast statusToast=new Toast(HookMethods.SnapContext);
  statusToast.setView(view);
  statusToast.setGravity(Gravity.BOTTOM | Gravity.START,offset,offset);
  statusToast.setDuration(longLength ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
  statusToast.show();
}
Program: 94080
Project: 94080
Buggy source:
public Object getAllBuiltObjectsExcept(String tableName,String columnName,String orderBy,ArrayList<String> blacklist,CallbackHandler callbackHandler){
  String strBlacklist=formatExclusionList(blacklist);
  String query="String_Node_Str" + tableName + "String_Node_Str"+ columnName+ "String_Node_Str"+ "String_Node_Str"+ strBlacklist+ "String_Node_Str"+ (orderBy != null ? "String_Node_Str" + orderBy : "String_Node_Str");
  Logger.log("String_Node_Str" + query);
  Cursor cursor=getDatabase().rawQuery(query,null);
  callbackHandler.addParams(cursor);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Logger.log("String_Node_Str" + cursor.getCount());
  Object invocationResponse=invokeCallback(callbackHandler);
  cursor.close();
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  return invocationResponse;
}

Fixed version (ground truth):
public Object getAllBuiltObjectsExcept(String tableName,String columnName,String orderBy,ArrayList<String> blacklist,CallbackHandler callbackHandler){
  String strBlacklist=formatExclusionList(blacklist);
  String query="String_Node_Str" + tableName + "String_Node_Str"+ columnName+ "String_Node_Str"+ "String_Node_Str"+ strBlacklist+ "String_Node_Str"+ (orderBy != null ? "String_Node_Str" + orderBy : "String_Node_Str");
  Logger.log("String_Node_Str" + query,LogType.DATABASE);
  Cursor cursor=getDatabase().rawQuery(query,null);
  callbackHandler.addParams(cursor);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  Object invocationResponse=invokeCallback(callbackHandler);
  cursor.close();
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName(),LogType.DATABASE);
    return null;
  }
  return invocationResponse;
}
Program: 94081
Project: 94081
Buggy source:
Object getAllBuiltObjects(String tableName,String where,String orderBy,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str");
  Cursor cursor=getDatabase().rawQuery("String_Node_Str" + tableName + (where != null ? "String_Node_Str" + where : "String_Node_Str")+ (orderBy != null ? "String_Node_Str" + orderBy : "String_Node_Str"),null);
  Logger.log("String_Node_Str" + cursor.getCount());
  callbackHandler.addParams(cursor);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}

Fixed version (ground truth):
Object getAllBuiltObjects(String tableName,String where,String orderBy,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str",LogType.DATABASE);
  Cursor cursor=getDatabase().rawQuery("String_Node_Str" + tableName + (where != null ? "String_Node_Str" + where : "String_Node_Str")+ (orderBy != null ? "String_Node_Str" + orderBy : "String_Node_Str"),null);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  callbackHandler.addParams(cursor);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName(),LogType.DATABASE);
    return null;
  }
  cursor.close();
  return invocationResponse;
}
Program: 94082
Project: 94082
Buggy source:
@SuppressWarnings("String_Node_Str") private Object invokeCallback(CallbackHandler callbackHandler){
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ Arrays.toString(callbackHandler.parameters));
    return callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Object invokeCallback(CallbackHandler callbackHandler){
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ Arrays.toString(callbackHandler.parameters),LogType.DATABASE);
    return callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 94083
Project: 94083
Buggy source:
public ContentValues getContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  ContentValues content=getValuesFromCursor(cursor,projection);
  cursor.close();
  if (content == null) {
    Logger.log("String_Node_Str");
    return null;
  }
  Logger.log("String_Node_Str" + content.size());
  return content;
}

Fixed version (ground truth):
public ContentValues getContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str",LogType.DATABASE);
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  ContentValues content=getValuesFromCursor(cursor,projection);
  cursor.close();
  if (content == null) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  Logger.log("String_Node_Str" + content.size(),LogType.DATABASE);
  return content;
}
Program: 94084
Project: 94084
Buggy source:
CoreDatabaseHandler(Context context,String databaseName,String[] entries,int DATABASE_VERSION){
  super(context,databaseName,null,DATABASE_VERSION);
  DATABASE_NAME=databaseName;
  SQL_CREATE_ENTRIES=entries;
}

Fixed version (ground truth):
CoreDatabaseHandler(Context context,String databaseName,String[] entries,int DATABASE_VERSION){
  super(context,databaseName,null,DATABASE_VERSION);
  DATABASE_NAME=databaseName;
  SQL_CREATE_ENTRIES=entries;
  writableDatabase=getDatabase();
}
Program: 94085
Project: 94085
Buggy source:
public int getCount(String tableName,String columnName,String[] selectionArgs,String[] projection){
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,null);
  int count=cursor.getCount();
  cursor.close();
  Logger.log("String_Node_Str" + count);
  return count;
}

Fixed version (ground truth):
public int getCount(String tableName,String columnName,String[] selectionArgs,String[] projection){
  String selection=columnName + "String_Node_Str";
  Logger.log("String_Node_Str",Logger.LogType.DATABASE);
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,null);
  int count=cursor.getCount();
  cursor.close();
  Logger.log("String_Node_Str" + count,LogType.DATABASE);
  return count;
}
Program: 94086
Project: 94086
Buggy source:
public Object performQueryForBuiltObjects(String tableName,String selection,String[] selectionArgs,String[] projection,String sortOrder,CallbackHandler callbackHandler){
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}

Fixed version (ground truth):
public Object performQueryForBuiltObjects(String tableName,String selection,String[] selectionArgs,String[] projection,String sortOrder,CallbackHandler callbackHandler){
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName(),LogType.DATABASE);
    return null;
  }
  cursor.close();
  return invocationResponse;
}
Program: 94087
Project: 94087
Buggy source:
public void onCreate(SQLiteDatabase db){
  for (  String entry : SQL_CREATE_ENTRIES)   db.execSQL(entry);
}

Fixed version (ground truth):
@Override public void onCreate(SQLiteDatabase db){
  for (  String entry : SQL_CREATE_ENTRIES)   db.execSQL(entry);
}
Program: 94088
Project: 94088
Buggy source:
public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
}
Program: 94089
Project: 94089
Buggy source:
Object[] addParams(Object... newParams){
  int newParamLength=newParams.length;
  Object[] newParamList=new Object[parameters.length + newParamLength];
  System.arraycopy(parameters,0,newParamList,0,parameters.length);
  System.arraycopy(newParams,0,newParamList,parameters.length,newParamLength);
  this.parameters=newParamList;
  for (  Object param : parameters)   Logger.log("String_Node_Str" + param.getClass().getCanonicalName());
  return newParamList;
}

Fixed version (ground truth):
Object[] addParams(Object... newParams){
  int newParamLength=newParams.length;
  Object[] newParamList=new Object[parameters.length + newParamLength];
  System.arraycopy(parameters,0,newParamList,0,parameters.length);
  System.arraycopy(newParams,0,newParamList,parameters.length,newParamLength);
  this.parameters=newParamList;
  for (  Object param : parameters)   Logger.log("String_Node_Str" + param.getClass().getCanonicalName(),LogType.DATABASE);
  return newParamList;
}
Program: 94090
Project: 94090
Buggy source:
public ContentValues getValuesFromCursor(Cursor cursor,String[] arrProjection){
  ContentValues contentValues=new ContentValues();
  for (  String projection : arrProjection) {
    int index;
    try {
      index=cursor.getColumnIndexOrThrow(projection);
    }
 catch (    IllegalArgumentException e) {
      Logger.log("String_Node_Str",e);
      continue;
    }
    int type=cursor.getType(index);
switch (type) {
case Cursor.FIELD_TYPE_STRING:
      contentValues.put(projection,cursor.getString(index));
    break;
case Cursor.FIELD_TYPE_INTEGER:
  contentValues.put(projection,cursor.getInt(index));
break;
case Cursor.FIELD_TYPE_FLOAT:
contentValues.put(projection,cursor.getFloat(index));
break;
case Cursor.FIELD_TYPE_BLOB:
contentValues.put(projection,cursor.getBlob(index));
break;
case Cursor.FIELD_TYPE_NULL:
Logger.log("String_Node_Str");
break;
default :
Logger.log("String_Node_Str");
}
}
return contentValues;
}

Fixed version (ground truth):
public ContentValues getValuesFromCursor(Cursor cursor,String[] arrProjection){
  ContentValues contentValues=new ContentValues();
  for (  String projection : arrProjection) {
    int index;
    try {
      index=cursor.getColumnIndexOrThrow(projection);
    }
 catch (    IllegalArgumentException e) {
      Logger.log("String_Node_Str",e,LogType.DATABASE);
      continue;
    }
    int type=cursor.getType(index);
switch (type) {
case Cursor.FIELD_TYPE_STRING:
      contentValues.put(projection,cursor.getString(index));
    break;
case Cursor.FIELD_TYPE_INTEGER:
  contentValues.put(projection,cursor.getInt(index));
break;
case Cursor.FIELD_TYPE_FLOAT:
contentValues.put(projection,cursor.getFloat(index));
break;
case Cursor.FIELD_TYPE_BLOB:
contentValues.put(projection,cursor.getBlob(index));
break;
case Cursor.FIELD_TYPE_NULL:
Logger.log("String_Node_Str",LogType.DATABASE);
break;
default :
Logger.log("String_Node_Str",LogType.DATABASE);
}
}
return contentValues;
}
Program: 94091
Project: 94091
Buggy source:
public ArrayList<ContentValues> getAllContent(String tableName,String[] projection){
  Logger.log("String_Node_Str");
  Cursor cursor=getDatabase().rawQuery("String_Node_Str" + tableName,null);
  Logger.log("String_Node_Str" + cursor.getCount());
  ArrayList<ContentValues> contentList=new ArrayList<>();
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  while (!cursor.isAfterLast())   contentList.add(this.getValuesFromCursor(cursor,projection));
  return contentList;
}

Fixed version (ground truth):
public ArrayList<ContentValues> getAllContent(String tableName,String[] projection){
  Logger.log("String_Node_Str",LogType.DATABASE);
  Cursor cursor=getDatabase().rawQuery("String_Node_Str" + tableName,null);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  ArrayList<ContentValues> contentList=new ArrayList<>();
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  while (!cursor.isAfterLast())   contentList.add(this.getValuesFromCursor(cursor,projection));
  return contentList;
}
Program: 94092
Project: 94092
Buggy source:
/** 
 * Usage: getCallback("methodToCall", ParameterClassTypes...);
 * @param methodName - The name of the method to call
 * @param classType  - The list of Classes called as the method parameters
 * @return CallbackHandler - The object holding the callback data
 */
static CallbackHandler getCallback(Object clazz,String methodName,Class<?>... classType){
  try {
    Logger.log("String_Node_Str");
    return new CallbackHandler(clazz,clazz.getClass().getMethod(methodName,classType));
  }
 catch (  NoSuchMethodException e) {
    Logger.log("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Usage: getCallback("methodToCall", ParameterClassTypes...);
 * @param methodName - The name of the method to call
 * @param classType  - The list of Classes called as the method parameters
 * @return CallbackHandler - The object holding the callback data
 */
static CallbackHandler getCallback(Object clazz,String methodName,Class<?>... classType){
  try {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return new CallbackHandler(clazz,clazz.getClass().getMethod(methodName,classType));
  }
 catch (  NoSuchMethodException e) {
    Logger.log("String_Node_Str",e,LogType.DATABASE);
    return null;
  }
}
Program: 94093
Project: 94093
Buggy source:
public void onDowngrade(SQLiteDatabase db,int oldVersion,int newVersion){
  onUpgrade(db,oldVersion,newVersion);
}

Fixed version (ground truth):
@Override public void onDowngrade(SQLiteDatabase db,int oldVersion,int newVersion){
  onUpgrade(db,oldVersion,newVersion);
}
Program: 94094
Project: 94094
Buggy source:
boolean checkIfColumnExists(SQLiteDatabase db,String tableName,String columnName){
  Cursor emptyCursor=null;
  Logger.log(String.format("String_Node_Str",columnName,tableName));
  try {
    emptyCursor=db.rawQuery("String_Node_Str" + tableName + "String_Node_Str",null);
    return emptyCursor.getColumnIndex(tableName) != -1;
  }
 catch (  Exception e) {
    Logger.log("String_Node_Str");
  }
 finally {
    if (emptyCursor != null)     emptyCursor.close();
  }
  return false;
}

Fixed version (ground truth):
boolean checkIfColumnExists(SQLiteDatabase db,String tableName,String columnName){
  Cursor emptyCursor=null;
  Logger.log(String.format("String_Node_Str",columnName,tableName),LogType.DATABASE);
  try {
    emptyCursor=db.rawQuery("String_Node_Str" + tableName + "String_Node_Str",null);
    Logger.log("String_Node_Str" + emptyCursor.getColumnIndex(columnName),LogType.DATABASE);
    return emptyCursor.getColumnIndex(columnName) != -1;
  }
 catch (  Exception e) {
    Logger.log("String_Node_Str",e,LogType.DATABASE);
  }
 finally {
    if (emptyCursor != null)     emptyCursor.close();
  }
  return false;
}
Program: 94095
Project: 94095
Buggy source:
public boolean containsObject(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount());
  cursor.close();
  return cursor.getCount() != 0;
}

Fixed version (ground truth):
public boolean containsObject(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str",LogType.DATABASE);
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount());
  cursor.close();
  return cursor.getCount() != 0;
}
Program: 94096
Project: 94096
Buggy source:
public Object getBuiltContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}

Fixed version (ground truth):
public Object getBuiltContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str",LogType.DATABASE);
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  Object invocationResponse=invokeCallback(callbackHandler);
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName(),LogType.DATABASE);
    return null;
  }
  cursor.close();
  return invocationResponse;
}
Program: 94097
Project: 94097
Buggy source:
public ArrayList<ContentValues> getAllContentExcept(String tableName,String columnName,String[] projection,ArrayList<String> blacklist){
  Logger.log("String_Node_Str");
  String strBlacklist=formatExclusionList(blacklist);
  String query="String_Node_Str" + tableName + "String_Node_Str"+ columnName+ "String_Node_Str"+ strBlacklist+ "String_Node_Str";
  Logger.log("String_Node_Str" + query);
  Cursor cursor=getDatabase().rawQuery(query,null);
  Logger.log("String_Node_Str" + cursor.getCount());
  ArrayList<ContentValues> content=new ArrayList<>();
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  while (!cursor.isAfterLast()) {
    Logger.log("String_Node_Str");
    ContentValues value=getValuesFromCursor(cursor,projection);
    if (value.size() > 0)     content.add(value);
    cursor.moveToNext();
  }
  Logger.log("String_Node_Str");
  cursor.close();
  return content;
}

Fixed version (ground truth):
public ArrayList<ContentValues> getAllContentExcept(String tableName,String columnName,String[] projection,ArrayList<String> blacklist){
  Logger.log("String_Node_Str",LogType.DATABASE);
  String strBlacklist=formatExclusionList(blacklist);
  String query="String_Node_Str" + tableName + "String_Node_Str"+ columnName+ "String_Node_Str"+ strBlacklist+ "String_Node_Str";
  Logger.log("String_Node_Str" + query,LogType.DATABASE);
  Cursor cursor=getDatabase().rawQuery(query,null);
  Logger.log("String_Node_Str" + cursor.getCount(),LogType.DATABASE);
  ArrayList<ContentValues> content=new ArrayList<>();
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    return null;
  }
  while (!cursor.isAfterLast()) {
    Logger.log("String_Node_Str",LogType.DATABASE);
    ContentValues value=getValuesFromCursor(cursor,projection);
    if (value.size() > 0)     content.add(value);
    cursor.moveToNext();
  }
  Logger.log("String_Node_Str",LogType.DATABASE);
  cursor.close();
  return content;
}
Program: 94101
Project: 94101
Buggy source:
/** 
 * @param directoryPath The full path to the directory to place the .nomedia file
 * @return Returns true if the file was successfully written or appears to already exist
 */
public boolean writeNoMediaFile(String directoryPath){
  String storageState=Environment.getExternalStorageState();
  if (Environment.MEDIA_MOUNTED.equals(storageState)) {
    try {
      File noMedia=new File(directoryPath,"String_Node_Str");
      if (noMedia.exists()) {
        return true;
      }
      FileOutputStream noMediaOutStream=new FileOutputStream(noMedia);
      noMediaOutStream.write(0);
      noMediaOutStream.close();
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param directoryPath The full path to the directory to place the .nomedia file
 * @return Returns true if the file was successfully written or appears to already exist
 */
public static boolean writeNoMediaFile(String directoryPath){
  String storageState=Environment.getExternalStorageState();
  if (Environment.MEDIA_MOUNTED.equals(storageState)) {
    try {
      File noMedia=new File(directoryPath,"String_Node_Str");
      if (noMedia.exists()) {
        return true;
      }
      FileOutputStream noMediaOutStream=new FileOutputStream(noMedia);
      noMediaOutStream.write(0);
      noMediaOutStream.close();
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
  return true;
}
Program: 94102
Project: 94102
Buggy source:
public static Bitmap retrieveAppropriateBitmap(String url,Context context){
  File iconDirectory=new File(Preferences.getSavePath(),"String_Node_Str");
  if (!iconDirectory.exists() && !iconDirectory.mkdirs()) {
    return getBitmapFromURL(url,1);
  }
  String hashedFileName=hashBuilder(url);
  File iconFile=new File(iconDirectory,hashedFileName + "String_Node_Str");
  Logger.log("String_Node_Str" + iconFile.getPath());
  if (iconFile.exists()) {
    Bitmap bmp=loadBitmapFromFile(iconFile);
    if (bmp != null)     return bmp;
  }
  Bitmap bmp=getBitmapFromURL(url,1);
  SavingUtils.savePNGAsync(iconFile,bmp,context,false);
  return bmp;
}

Fixed version (ground truth):
public static Bitmap retrieveAppropriateBitmap(String url,Context context){
  File iconDirectory=new File(Preferences.getSavePath(),"String_Node_Str");
  if (!iconDirectory.exists() && !iconDirectory.mkdirs()) {
    return getBitmapFromURL(url,1);
  }
  String hashedFileName=hashBuilder(url);
  File iconFile=new File(iconDirectory,hashedFileName + "String_Node_Str");
  Logger.log("String_Node_Str" + iconFile.getPath());
  if (iconFile.exists()) {
    Bitmap bmp=loadBitmapFromFile(iconFile);
    if (bmp != null)     return bmp;
  }
  Bitmap bmp=getBitmapFromURL(url,1);
  SavingUtils.savePNGAsync(iconFile,bmp,context,false);
  File nomediaFile=new File(Preferences.getSavePath(),"String_Node_Str");
  if (!nomediaFile.exists())   MainActivity.writeNoMediaFile(Preferences.getSavePath() + "String_Node_Str");
  return bmp;
}
Program: 94103
Project: 94103
Buggy source:
public ContentValues getContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (cursor.getCount() == 0)   return null;
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  ContentValues content=getValuesFromCursor(cursor,projection);
  cursor.close();
  if (content == null) {
    Logger.log("String_Node_Str");
    return null;
  }
  Logger.log("String_Node_Str" + content.size());
  return content;
}

Fixed version (ground truth):
public ContentValues getContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  ContentValues content=getValuesFromCursor(cursor,projection);
  cursor.close();
  if (content == null) {
    Logger.log("String_Node_Str");
    return null;
  }
  Logger.log("String_Node_Str" + content.size());
  return content;
}
Program: 94104
Project: 94104
Buggy source:
public ArrayList<Object> performQueryForBuiltObjects(String tableName,String selection,String[] selectionArgs,String[] projection,String sortOrder,CallbackHandler callbackHandler){
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (cursor.getCount() == 0)   return null;
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  ArrayList<Object> invocationResponse;
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ callbackHandler.parameters);
    invocationResponse=(ArrayList<Object>)callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}

Fixed version (ground truth):
public ArrayList<Object> performQueryForBuiltObjects(String tableName,String selection,String[] selectionArgs,String[] projection,String sortOrder,CallbackHandler callbackHandler){
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  ArrayList<Object> invocationResponse;
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ callbackHandler.parameters);
    invocationResponse=(ArrayList<Object>)callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}