nus-yam/ex-repair huggingface dataset:
Program: 5851
Project: 5851
Buggy source:
public static String doRequestPost(String url,Bundle params){
  ArrayList<BasicNameValuePair> paramsList=new ArrayList<BasicNameValuePair>();
  BasicNameValuePair paramPair;
  if (params != null) {
    for (    String key : params.keySet()) {
      paramPair=new BasicNameValuePair(key,params.getString(key));
      paramsList.add(paramPair);
    }
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpPost httpRequest=new HttpPost(url);
    httpRequest.setEntity(new UrlEncodedFormEntity(paramsList,HTTP.UTF_8));
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
public static String doRequestPost(String url,Bundle params){
  ArrayList<BasicNameValuePair> paramsList=new ArrayList<BasicNameValuePair>();
  BasicNameValuePair paramPair;
  if (params != null) {
    for (    String key : params.keySet()) {
      paramPair=new BasicNameValuePair(key,params.getString(key));
      paramsList.add(paramPair);
    }
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpPost httpRequest=new HttpPost(url);
    httpRequest.setEntity(new UrlEncodedFormEntity(paramsList,HTTP.UTF_8));
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logE(e.getMessage());
    return null;
  }
}
Program: 5853
Project: 5853
Buggy source:
@Override public void onStart(Intent intent,int startId){
  super.onStart(intent,startId);
  Bundle taskParams=new Bundle();
  taskParams.putParcelable(PARAM_INTENT_KEY,intent);
  new AsyncTask<Bundle,Void,Void>(){
    @Override protected Void doInBackground(    Bundle... objs){
      try {
        Intent executeParamIntent=objs[0].getParcelable(PARAM_INTENT_KEY);
        int commandType=executeParamIntent.getIntExtra(SERVICE_COMMAND_KEY,COMMAND_BLANK);
        executeCommand(commandType,executeParamIntent);
      }
 catch (      Exception e) {
        LogUtils.logD(e.getMessage());
      }
      return null;
    }
  }
.execute(new Bundle[]{taskParams});
}

Fixed version (ground truth):
@Override public void onStart(Intent intent,int startId){
  super.onStart(intent,startId);
  Bundle taskParams=new Bundle();
  taskParams.putParcelable(PARAM_INTENT_KEY,intent);
  new AsyncTask<Bundle,Void,Void>(){
    @Override protected Void doInBackground(    Bundle... objs){
      try {
        Intent executeParamIntent=objs[0].getParcelable(PARAM_INTENT_KEY);
        int commandType=executeParamIntent.getIntExtra(SERVICE_COMMAND_KEY,COMMAND_BLANK);
        executeCommand(commandType,executeParamIntent);
      }
 catch (      Exception e) {
        LogUtils.logE(e.getMessage());
      }
      return null;
    }
  }
.execute(new Bundle[]{taskParams});
}
Program: 5854
Project: 5854
Buggy source:
@Override protected Void doInBackground(Bundle... objs){
  try {
    Intent executeParamIntent=objs[0].getParcelable(PARAM_INTENT_KEY);
    int commandType=executeParamIntent.getIntExtra(SERVICE_COMMAND_KEY,COMMAND_BLANK);
    executeCommand(commandType,executeParamIntent);
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Bundle... objs){
  try {
    Intent executeParamIntent=objs[0].getParcelable(PARAM_INTENT_KEY);
    int commandType=executeParamIntent.getIntExtra(SERVICE_COMMAND_KEY,COMMAND_BLANK);
    executeCommand(commandType,executeParamIntent);
  }
 catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5855
Project: 5855
Buggy source:
private boolean submitOrder(Order order,List<OrderDetail> orderDetailList){
  try {
    StringBuilder submitStr=new StringBuilder("String_Node_Str");
    submitStr.append("String_Node_Str");
    submitStr.append(order.getOrderTotal() + "String_Node_Str");
    submitStr.append("String_Node_Str");
    for (    OrderDetail eachOrderDetail : orderDetailList) {
      submitStr.append("String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getTableId() + "String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getDishId() + "String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getNumber());
      submitStr.append("String_Node_Str");
    }
    submitStr.deleteCharAt(submitStr.length() - 1);
    submitStr.append("String_Node_Str");
    ServiceHelper.submitOrderToServer(submitStr.toString());
  }
 catch (  Exception e) {
    LogUtils.logD("String_Node_Str" + e.getMessage());
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean submitOrder(Order order,List<OrderDetail> orderDetailList){
  try {
    StringBuilder submitStr=new StringBuilder("String_Node_Str");
    submitStr.append("String_Node_Str");
    submitStr.append(order.getOrderTotal() + "String_Node_Str");
    submitStr.append("String_Node_Str");
    for (    OrderDetail eachOrderDetail : orderDetailList) {
      submitStr.append("String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getTableId() + "String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getDishId() + "String_Node_Str");
      submitStr.append("String_Node_Str" + eachOrderDetail.getNumber());
      submitStr.append("String_Node_Str");
    }
    submitStr.deleteCharAt(submitStr.length() - 1);
    submitStr.append("String_Node_Str");
    ServiceHelper.submitOrderToServer(submitStr.toString());
  }
 catch (  Exception e) {
    LogUtils.logE("String_Node_Str" + e.getMessage());
    return false;
  }
  return true;
}
Program: 5856
Project: 5856
Buggy source:
private boolean syncDishesAndImages(){
  ArrayList<Dish> dishList=ServiceHelper.getDishes();
  if (dishList == null) {
    return false;
  }
 else {
    boolean result=ServiceHelper.syncDishImage(dishList);
    for (    Dish dish : dishList) {
      dbHelper.addDish(dish);
    }
    return result;
  }
}

Fixed version (ground truth):
private boolean syncDishesAndImages(){
  ArrayList<Dish> dishList=ServiceHelper.getDishes();
  if (dishList == null) {
    return false;
  }
 else {
    ServiceHelper.syncDishImage(dishList);
    for (    Dish dish : dishList) {
      dbHelper.addDish(dish);
    }
    return true;
  }
}
Program: 5857
Project: 5857
Buggy source:
public static ArrayList<DishCategory> getDishCategory(){
  String reqUrl=getRequestUrl(null,DISH_CATEGORY_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDishCategory(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<DishCategory> getDishCategory(){
  String reqUrl=getRequestUrl(null,DISH_CATEGORY_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDishCategory(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5858
Project: 5858
Buggy source:
public static boolean syncDishImage(ArrayList<Dish> dishList){
  if (dishList == null) {
    return true;
  }
  for (  Dish dish : dishList) {
    String imgUrl=getRequestUrl(null,dish.getImageServer());
    String imgName=dish.getImageServer().split("String_Node_Str",2)[1];
    String filePath=getLocalFileStorageUrl("String_Node_Str",imgName);
    RequestHelper.getFileFromServer(imgUrl,null,filePath);
    dish.setImageLocal(filePath);
  }
  return true;
}

Fixed version (ground truth):
public static void syncDishImage(ArrayList<Dish> dishList){
  if (dishList == null) {
    return;
  }
  for (  Dish dish : dishList) {
    String imgUrl=getRequestUrl(null,dish.getImageServer());
    String imgName=dish.getImageServer().split("String_Node_Str",2)[1];
    String filePath=getLocalFileStorageUrl("String_Node_Str",imgName);
    RequestHelper.getFileFromServer(imgUrl,null,filePath);
    dish.setImageLocal(filePath);
  }
}
Program: 5859
Project: 5859
Buggy source:
public static ArrayList<Config> getConfigs(){
  String reqUrl=getRequestUrl(null,CONFIG_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseConfigs(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<Config> getConfigs(){
  String reqUrl=getRequestUrl(null,CONFIG_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseConfigs(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5860
Project: 5860
Buggy source:
public static String getLocalFileStorageUrl(String dir,String fileName){
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    if (fileName == null) {
      return null;
    }
    if (dir == null || dir.equals("String_Node_Str")) {
      dir="String_Node_Str";
    }
 else {
      dir=dir + '/';
    }
    return Environment.getExternalStorageDirectory() + "String_Node_Str" + dir+ fileName;
  }
 else {
    LogUtils.logD("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public static String getLocalFileStorageUrl(String dir,String fileName){
  if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    if (fileName == null) {
      return null;
    }
    if (dir == null || dir.equals("String_Node_Str")) {
      return Environment.getExternalStorageDirectory() + ('/' + IMAGE_STORAGE_DEFAULT_DIR + '/'+ fileName);
    }
 else {
      return Environment.getExternalStorageDirectory() + ('/' + dir + '/'+ fileName);
    }
  }
 else {
    LogUtils.logE("String_Node_Str");
  }
  return null;
}
Program: 5861
Project: 5861
Buggy source:
public static ArrayList<Dish> getDishes(){
  String reqUrl=getRequestUrl(null,DISH_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDishes(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<Dish> getDishes(){
  String reqUrl=getRequestUrl(null,DISH_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDishes(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5862
Project: 5862
Buggy source:
public static ArrayList<Order> getFreeOrders(){
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  Bundle params=new Bundle();
  params.putString(ORDER_QUERY_KEY,ORDER_STATUS_FREE);
  String respStr=RequestHelper.doRequestPost(reqUrl,params);
  try {
    return ResponseParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<Order> getFreeOrders(){
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  Bundle params=new Bundle();
  params.putString(ORDER_QUERY_KEY,ORDER_STATUS_FREE);
  String respStr=RequestHelper.doRequestPost(reqUrl,params);
  try {
    return ResponseParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5863
Project: 5863
Buggy source:
public static ArrayList<Order> getOrders(){
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<Order> getOrders(){
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5864
Project: 5864
Buggy source:
public static ArrayList<OrderDetail> getOrderDetail(){
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<OrderDetail> getOrderDetail(){
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5865
Project: 5865
Buggy source:
public static ArrayList<Category> getCategories(){
  String reqUrl=getRequestUrl(null,CATEGORY_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseCategories(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<Category> getCategories(){
  String reqUrl=getRequestUrl(null,CATEGORY_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseCategories(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5866
Project: 5866
Buggy source:
public static ArrayList<DiningTable> getDiningTables(){
  String reqUrl=getRequestUrl(null,DINING_TABLE_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDiningTables(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<DiningTable> getDiningTables(){
  String reqUrl=getRequestUrl(null,DINING_TABLE_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseDiningTables(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5867
Project: 5867
Buggy source:
public static ArrayList<OrderDetail> getOrderDetailByOrderIds(){
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static ArrayList<OrderDetail> getOrderDetailByOrderIds(){
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=RequestHelper.doRequestPost(reqUrl,null);
  try {
    return ResponseParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logE(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}
Program: 5868
Project: 5868
Buggy source:
private void syncTablesStatus(){
  IntentFilter filter=new IntentFilter(DiningService.SYNC_DINING_TABLE);
  if (mReceiver == null) {
    mReceiver=new SyncReceiver();
  }
  registerReceiver(mReceiver,filter);
  Intent service=new Intent(SelectTableActivity.this,DiningService.class);
  service.putExtra(DiningService.SERVICE_COMMAND_KEY,DiningService.COMMAND_SYNC_DINING_TABLE);
  startService(service);
  showDialog(DIALOG_SYNC_DATA);
}

Fixed version (ground truth):
private void syncTablesStatus(){
  IntentFilter filter=new IntentFilter(DiningService.SYNC_DINING_TABLE);
  if (mReceiver == null) {
    mReceiver=new SyncReceiver();
    registerReceiver(mReceiver,filter);
  }
  Intent service=new Intent(SelectTableActivity.this,DiningService.class);
  service.putExtra(DiningService.SERVICE_COMMAND_KEY,DiningService.COMMAND_SYNC_DINING_TABLE);
  startService(service);
  showDialog(DIALOG_SYNC_DATA);
}
Program: 5869
Project: 5869
Buggy source:
@Override public void onResume(){
  super.onResume();
  asyncInitUi();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  asyncInitGallery();
}
Program: 5870
Project: 5870
Buggy source:
@Override protected void onPostExecute(Void result){
  initUi();
}

Fixed version (ground truth):
@Override protected void onPostExecute(Void result){
  initMainUi();
  initGallery();
}
Program: 5871
Project: 5871
Buggy source:
@Override protected void onStop(){
  super.onStop();
  clearDishImageCache();
}

Fixed version (ground truth):
@Override protected void onStop(){
  super.onStop();
  LinearLayout galleryFrame=(LinearLayout)findViewById(R.id.gallery_frame);
  galleryFrame.removeAllViews();
}
Program: 5872
Project: 5872
Buggy source:
/** 
 * Get sequenced dish_ids list This list was ordered by Table Category' sort_order and category_id ASC, Table DishCategory dish_id ASC
 * @param db
 * @return
 */
public static List<Long> getSequencedDishIds(final SQLiteDatabase db){
  long b=System.currentTimeMillis();
  final Cursor c=db.rawQuery("String_Node_Str" + DISH_ID + "String_Node_Str"+ TABLE_NAME+ "String_Node_Str"+ CategoryTable.TABLE_NAME+ "String_Node_Str"+ CATEGORY_ID+ "String_Node_Str"+ CategoryTable.CATEGORY_ID+ "String_Node_Str"+ CategoryTable.SORT_ORDER+ "String_Node_Str"+ CategoryTable.CATEGORY_ID+ "String_Node_Str"+ DISH_ID,null);
  if (c != null) {
    try {
      List<Long> list=new ArrayList<Long>();
      while (c.moveToNext()) {
        list.add(c.getLong(c.getColumnIndex(DISH_ID)));
      }
      System.out.println("String_Node_Str" + (System.currentTimeMillis() - b));
      return list;
    }
  finally {
      c.close();
    }
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
/** 
 * Get sequenced dish_ids list This list was ordered by Table Category' sort_order and category_id ASC, Table DishCategory dish_id ASC
 * @param db
 * @return
 */
public static List<Long> getSequencedDishIds(final SQLiteDatabase db){
  final Cursor c=db.rawQuery("String_Node_Str" + DISH_ID + "String_Node_Str"+ TABLE_NAME+ "String_Node_Str"+ CategoryTable.TABLE_NAME+ "String_Node_Str"+ CATEGORY_ID+ "String_Node_Str"+ CategoryTable.CATEGORY_ID+ "String_Node_Str"+ CategoryTable.SORT_ORDER+ "String_Node_Str"+ CategoryTable.CATEGORY_ID+ "String_Node_Str"+ DISH_ID,null);
  if (c != null) {
    try {
      List<Long> list=new ArrayList<Long>();
      while (c.moveToNext()) {
        list.add(c.getLong(c.getColumnIndex(DISH_ID)));
      }
      return list;
    }
  finally {
      c.close();
    }
  }
  return Collections.emptyList();
}
Program: 5873
Project: 5873
Buggy source:
public static List<Dish> parseDishes(String dishesRespStr) throws JSONException {
  if (dishesRespStr == null) {
    return null;
  }
  List<Dish> resultList=null;
  JSONObject dishes=new JSONObject(dishesRespStr);
  resultList=new ArrayList<Dish>();
  Dish tempDish=null;
  JSONArray dishArray=dishes.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDish=new Dish();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDish.setId(dishObj.getInt("String_Node_Str"));
    tempDish.setName(dishObj.getString("String_Node_Str"));
    tempDish.setPrice(dishObj.getInt("String_Node_Str"));
    tempDish.setDescription(dishObj.getString("String_Node_Str"));
    tempDish.setImageServer(dishObj.getString("String_Node_Str"));
    long createTimeValue=dishObj.getLong("String_Node_Str");
    long updateTimeValue=dishObj.getLong("String_Node_Str");
    Date createTime=new Date();
    Date updateTime=new Date();
    createTime.setTime(createTimeValue);
    updateTime.setTime(updateTimeValue);
    tempDish.setCreateTime(createTime);
    tempDish.setUpdateTime(updateTime);
    resultList.add(tempDish);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<Dish> parseDishes(String dishesRespStr) throws JSONException {
  if (dishesRespStr == null) {
    return null;
  }
  ArrayList<Dish> resultList=null;
  JSONObject dishes=new JSONObject(dishesRespStr);
  resultList=new ArrayList<Dish>();
  JSONArray dishArray=dishes.getJSONArray("String_Node_Str");
  int length=dishArray.length();
  for (int i=0; i < length; i++) {
    Dish dish=new Dish();
    JSONObject dishObj=dishArray.getJSONObject(i);
    dish.setDishId(dishObj.getLong("String_Node_Str"));
    dish.setName(dishObj.getString("String_Node_Str"));
    dish.setPrice(dishObj.getInt("String_Node_Str"));
    dish.setDescription(dishObj.getString("String_Node_Str"));
    dish.setImageServer(dishObj.getString("String_Node_Str"));
    long createTimeValue=dishObj.getLong("String_Node_Str");
    long updateTimeValue=dishObj.getLong("String_Node_Str");
    Date createTime=new Date(createTimeValue);
    Date updateTime=new Date(updateTimeValue);
    dish.setCreateTime(createTime);
    dish.setUpdateTime(updateTime);
    resultList.add(dish);
  }
  return resultList;
}
Program: 5874
Project: 5874
Buggy source:
public static List<Order> parseOrders(String orderRespStr) throws JSONException {
  if (orderRespStr == null) {
    return null;
  }
  List<Order> resultList=null;
  JSONObject orders=new JSONObject(orderRespStr);
  resultList=new ArrayList<Order>();
  Order tempOrder=null;
  JSONArray dishArray=orders.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrder=new Order();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrder.setId(dishObj.getInt("String_Node_Str"));
    tempOrder.setStatus(dishObj.getInt("String_Node_Str"));
    tempOrder.setOrderTotal(dishObj.getInt("String_Node_Str"));
    long createTimeValue=dishObj.getLong("String_Node_Str");
    long payTimeValue=dishObj.getLong("String_Node_Str");
    Date createTime=new Date();
    Date payTime=new Date();
    createTime.setTime(createTimeValue);
    payTime.setTime(payTimeValue);
    tempOrder.setCreateTime(createTime);
    tempOrder.setPayTime(payTime);
    resultList.add(tempOrder);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<Order> parseOrders(String orderRespStr) throws JSONException {
  if (orderRespStr == null) {
    return null;
  }
  ArrayList<Order> resultList=null;
  JSONObject orders=new JSONObject(orderRespStr);
  resultList=new ArrayList<Order>();
  JSONArray orderArray=orders.getJSONArray("String_Node_Str");
  int length=orderArray.length();
  for (int i=0; i < length; i++) {
    Order order=new Order();
    JSONObject orderObj=orderArray.getJSONObject(i);
    order.setOrderId(orderObj.getLong("String_Node_Str"));
    order.setStatus(orderObj.getInt("String_Node_Str"));
    order.setOrderTotal(orderObj.getInt("String_Node_Str"));
    long createTimeValue=orderObj.getLong("String_Node_Str");
    long payTimeValue=orderObj.getLong("String_Node_Str");
    Date createTime=new Date(createTimeValue);
    Date payTime=new Date(payTimeValue);
    order.setCreateTime(createTime);
    order.setPayTime(payTime);
    resultList.add(order);
  }
  return resultList;
}
Program: 5875
Project: 5875
Buggy source:
public static List<OrderDetail> parseOrderDetail(String orderDetailRespStr) throws JSONException {
  if (orderDetailRespStr == null) {
    return null;
  }
  List<OrderDetail> resultList=null;
  JSONObject orderDetail=new JSONObject(orderDetailRespStr);
  resultList=new ArrayList<OrderDetail>();
  OrderDetail tempOrderDetail=null;
  JSONArray dishArray=orderDetail.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrderDetail=new OrderDetail();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrderDetail.setId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setOrderId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setTableId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setDishId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setNumber(dishObj.getInt("String_Node_Str"));
    resultList.add(tempOrderDetail);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<OrderDetail> parseOrderDetail(String orderDetailRespStr) throws JSONException {
  if (orderDetailRespStr == null) {
    return null;
  }
  ArrayList<OrderDetail> resultList=null;
  JSONObject orderDetails=new JSONObject(orderDetailRespStr);
  resultList=new ArrayList<OrderDetail>();
  JSONArray orderDetailArray=orderDetails.getJSONArray("String_Node_Str");
  int length=orderDetailArray.length();
  for (int i=0; i < length; i++) {
    OrderDetail orderDetail=new OrderDetail();
    JSONObject orderDetailObj=orderDetailArray.getJSONObject(i);
    orderDetail.setOrderItemId(orderDetailObj.getLong("String_Node_Str"));
    orderDetail.setOrderId(orderDetailObj.getLong("String_Node_Str"));
    orderDetail.setTableId(orderDetailObj.getLong("String_Node_Str"));
    orderDetail.setDishId(orderDetailObj.getLong("String_Node_Str"));
    orderDetail.setNumber(orderDetailObj.getInt("String_Node_Str"));
    resultList.add(orderDetail);
  }
  return resultList;
}
Program: 5876
Project: 5876
Buggy source:
public static List<DishCategory> parseDishCategory(String dishCategoryRespStr) throws JSONException {
  if (dishCategoryRespStr == null) {
    return null;
  }
  List<DishCategory> resultList=null;
  JSONObject dishCategory=new JSONObject(dishCategoryRespStr);
  resultList=new ArrayList<DishCategory>();
  DishCategory tempDishCategory=null;
  JSONArray dishArray=dishCategory.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDishCategory=new DishCategory();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDishCategory.setDishId(dishObj.getInt("String_Node_Str"));
    tempDishCategory.setCategoryId(dishObj.getInt("String_Node_Str"));
    resultList.add(tempDishCategory);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<DishCategory> parseDishCategory(String dishCategoryRespStr) throws JSONException {
  if (dishCategoryRespStr == null) {
    return null;
  }
  ArrayList<DishCategory> resultList=null;
  JSONObject dishCategories=new JSONObject(dishCategoryRespStr);
  resultList=new ArrayList<DishCategory>();
  JSONArray dishCategoryArray=dishCategories.getJSONArray("String_Node_Str");
  int length=dishCategoryArray.length();
  for (int i=0; i < length; i++) {
    DishCategory dishCategory=new DishCategory();
    JSONObject dishCategoryObj=dishCategoryArray.getJSONObject(i);
    dishCategory.setDishId(dishCategoryObj.getLong("String_Node_Str"));
    dishCategory.setCategoryId(dishCategoryObj.getLong("String_Node_Str"));
    resultList.add(dishCategory);
  }
  return resultList;
}
Program: 5877
Project: 5877
Buggy source:
public static List<DiningTable> parseDiningTables(String diningTablesRespStr) throws JSONException {
  if (diningTablesRespStr == null) {
    return null;
  }
  List<DiningTable> resultList=null;
  JSONObject diningTables=new JSONObject(diningTablesRespStr);
  resultList=new ArrayList<DiningTable>();
  DiningTable tempDiningTable=null;
  JSONArray dishArray=diningTables.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDiningTable=new DiningTable();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDiningTable.setId(dishObj.getInt("String_Node_Str"));
    tempDiningTable.setName(dishObj.getString("String_Node_Str"));
    tempDiningTable.setMaxPeople(dishObj.getInt("String_Node_Str"));
    int free=dishObj.getInt("String_Node_Str");
    tempDiningTable.setFree(free == 0 ? true : false);
    resultList.add(tempDiningTable);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<DiningTable> parseDiningTables(String diningTablesRespStr) throws JSONException {
  if (diningTablesRespStr == null) {
    return null;
  }
  ArrayList<DiningTable> resultList=null;
  JSONObject diningTables=new JSONObject(diningTablesRespStr);
  resultList=new ArrayList<DiningTable>();
  JSONArray diningArray=diningTables.getJSONArray("String_Node_Str");
  int length=diningArray.length();
  for (int i=0; i < length; i++) {
    DiningTable diningTable=new DiningTable();
    JSONObject diningTableObj=diningArray.getJSONObject(i);
    diningTable.setDiningTableId(diningTableObj.getLong("String_Node_Str"));
    diningTable.setName(diningTableObj.getString("String_Node_Str"));
    diningTable.setMaxPeople(diningTableObj.getInt("String_Node_Str"));
    int free=diningTableObj.getInt("String_Node_Str");
    diningTable.setFree(free == 0 ? true : false);
    resultList.add(diningTable);
  }
  return resultList;
}
Program: 5878
Project: 5878
Buggy source:
public static List<Config> parseConfigs(String configsRespStr) throws JSONException {
  if (configsRespStr == null) {
    return null;
  }
  List<Config> resultList=null;
  JSONObject configs=new JSONObject(configsRespStr);
  resultList=new ArrayList<Config>();
  Config tempConfig=null;
  JSONArray dishArray=configs.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempConfig=new Config();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempConfig.setId(dishObj.getInt("String_Node_Str"));
    tempConfig.setName(dishObj.getString("String_Node_Str"));
    tempConfig.setValue(dishObj.getString("String_Node_Str"));
    tempConfig.setDescription(dishObj.getString("String_Node_Str"));
    resultList.add(tempConfig);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<Config> parseConfigs(String configsRespStr) throws JSONException {
  if (configsRespStr == null) {
    return null;
  }
  ArrayList<Config> resultList=null;
  JSONObject configs=new JSONObject(configsRespStr);
  resultList=new ArrayList<Config>();
  JSONArray configArray=configs.getJSONArray("String_Node_Str");
  int length=configArray.length();
  for (int i=0; i < length; i++) {
    Config config=new Config();
    JSONObject configObj=configArray.getJSONObject(i);
    config.setConfigId(configObj.getLong("String_Node_Str"));
    config.setName(configObj.getString("String_Node_Str"));
    config.setValue(configObj.getString("String_Node_Str"));
    config.setDescription(configObj.getString("String_Node_Str"));
    resultList.add(config);
  }
  return resultList;
}
Program: 5879
Project: 5879
Buggy source:
public static List<Category> parseCategories(String categoryRespStr) throws JSONException {
  if (categoryRespStr == null) {
    return null;
  }
  List<Category> resultList=null;
  JSONObject categories=new JSONObject(categoryRespStr);
  resultList=new ArrayList<Category>();
  Category tempCategory=null;
  JSONArray dishArray=categories.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempCategory=new Category();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempCategory.setId(dishObj.getInt("String_Node_Str"));
    tempCategory.setName(dishObj.getString("String_Node_Str"));
    tempCategory.setDescription(dishObj.getString("String_Node_Str"));
    tempCategory.setSortOrder(dishObj.getInt("String_Node_Str"));
    resultList.add(tempCategory);
  }
  return resultList;
}

Fixed version (ground truth):
public static ArrayList<Category> parseCategories(String categoryRespStr) throws JSONException {
  if (categoryRespStr == null) {
    return null;
  }
  ArrayList<Category> resultList=null;
  JSONObject categories=new JSONObject(categoryRespStr);
  resultList=new ArrayList<Category>();
  JSONArray categoryArray=categories.getJSONArray("String_Node_Str");
  int length=categoryArray.length();
  for (int i=0; i < length; i++) {
    Category category=new Category();
    JSONObject categoryObj=categoryArray.getJSONObject(i);
    category.setCategoryId(categoryObj.getLong("String_Node_Str"));
    category.setName(categoryObj.getString("String_Node_Str"));
    category.setDescription(categoryObj.getString("String_Node_Str"));
    category.setSortOrder(categoryObj.getInt("String_Node_Str"));
    resultList.add(category);
  }
  return resultList;
}
Program: 5880
Project: 5880
Buggy source:
private boolean synCategories(){
  boolean result=true;
  List<Category> categoryList=serviceHelper.getCategories();
  for (  Category category : categoryList) {
    dbHelper.addCategory(category);
  }
  return result;
}

Fixed version (ground truth):
private boolean synCategories(){
  boolean result=true;
  List<Category> categoryList=serviceHelper.getCategories();
  if (categoryList == null) {
    result=false;
  }
 else {
    for (    Category category : categoryList) {
      dbHelper.addCategory(category);
    }
  }
  return result;
}
Program: 5881
Project: 5881
Buggy source:
private boolean synDishCategory(){
  boolean result=true;
  List<DishCategory> dishCategoryList=serviceHelper.getDishCategory();
  for (  DishCategory dishCategory : dishCategoryList) {
    dbHelper.addDishCategory(dishCategory);
  }
  return result;
}

Fixed version (ground truth):
private boolean synDishCategory(){
  boolean result=true;
  List<DishCategory> dishCategoryList=serviceHelper.getDishCategory();
  if (dishCategoryList == null) {
    result=false;
  }
 else {
    for (    DishCategory dishCategory : dishCategoryList) {
      dbHelper.addDishCategory(dishCategory);
    }
  }
  return result;
}
Program: 5882
Project: 5882
Buggy source:
private boolean synConfigs(){
  boolean result=true;
  List<Config> configList=serviceHelper.getConfigs();
  for (  Config config : configList) {
    dbHelper.addConfig(config);
  }
  return result;
}

Fixed version (ground truth):
private boolean synConfigs(){
  boolean result=true;
  List<Config> configList=serviceHelper.getConfigs();
  if (configList == null) {
    result=false;
  }
 else {
    for (    Config config : configList) {
      dbHelper.addConfig(config);
    }
  }
  return result;
}
Program: 5884
Project: 5884
Buggy source:
public List<DishCategory> getDishCategory(){
  List<DishCategory> dishCategoryList=null;
  String reqUrl=getRequestUrl(null,DISH_CATEGORY_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    dishCategoryList=reqParser.parseDishCategory(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return dishCategoryList;
}

Fixed version (ground truth):
public List<DishCategory> getDishCategory(){
  List<DishCategory> dishCategoryList=null;
  String reqUrl=getRequestUrl(null,DISH_CATEGORY_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    dishCategoryList=reqParser.parseDishCategory(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return dishCategoryList;
}
Program: 5885
Project: 5885
Buggy source:
public boolean syncDishImage(List<Dish> dishList){
  boolean result=true;
  if (dishList == null) {
    return result;
  }
  try {
    for (    Dish dish : dishList) {
      String imgUrl=DEFAULT_URL + dish.getImageServer();
      String imgName=dish.getImageServer().split("String_Node_Str",2)[1];
      String filePath=getLocalFileStorageUrl("String_Node_Str",imgName);
      OutputStream fos=new FileOutputStream(filePath);
      reqHelper.getFileFromServer(imgUrl,null,fos);
    }
  }
 catch (  IOException e) {
    LogUtils.logD("String_Node_Str");
    result=false;
  }
  return result;
}

Fixed version (ground truth):
public boolean syncDishImage(List<Dish> dishList){
  boolean result=true;
  if (dishList == null) {
    return result;
  }
  try {
    for (    Dish dish : dishList) {
      String imgUrl=getRequestUrl(null,dish.getImageServer());
      String imgName=dish.getImageServer().split("String_Node_Str",2)[1];
      String filePath=getLocalFileStorageUrl("String_Node_Str",imgName);
      OutputStream fos=new FileOutputStream(filePath);
      reqHelper.getFileFromServer(imgUrl,null,fos);
    }
  }
 catch (  IOException e) {
    LogUtils.logD("String_Node_Str");
    result=false;
  }
  return result;
}
Program: 5886
Project: 5886
Buggy source:
public List<Config> getConfigs(){
  List<Config> configList=null;
  String reqUrl=getRequestUrl(null,CONFIG_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    configList=reqParser.parseConfigs(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return configList;
}

Fixed version (ground truth):
public List<Config> getConfigs(){
  List<Config> configList=null;
  String reqUrl=getRequestUrl(null,CONFIG_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    configList=reqParser.parseConfigs(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return configList;
}
Program: 5887
Project: 5887
Buggy source:
public List<Dish> getDishes(){
  List<Dish> dishList=null;
  String reqUrl=getRequestUrl(null,DISH_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    dishList=reqParser.parseDishes(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return dishList;
}

Fixed version (ground truth):
public List<Dish> getDishes(){
  List<Dish> dishList=null;
  String reqUrl=getRequestUrl(null,DISH_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    dishList=reqParser.parseDishes(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return dishList;
}
Program: 5888
Project: 5888
Buggy source:
public List<Order> getOrders(){
  List<Order> orderList=null;
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    orderList=reqParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return orderList;
}

Fixed version (ground truth):
public List<Order> getOrders(){
  List<Order> orderList=null;
  String reqUrl=getRequestUrl(null,ORDER_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    orderList=reqParser.parseOrders(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return orderList;
}
Program: 5889
Project: 5889
Buggy source:
public List<OrderDetail> getOrderDetail(){
  List<OrderDetail> orderDetailList=null;
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    orderDetailList=reqParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return orderDetailList;
}

Fixed version (ground truth):
public List<OrderDetail> getOrderDetail(){
  List<OrderDetail> orderDetailList=null;
  String reqUrl=getRequestUrl(null,ORDER_DETAIL_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    orderDetailList=reqParser.parseOrderDetail(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return orderDetailList;
}
Program: 5890
Project: 5890
Buggy source:
public List<Category> getCategories(){
  List<Category> categoryList=null;
  String reqUrl=getRequestUrl(null,CATEGORY_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    categoryList=reqParser.parseCategories(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return categoryList;
}

Fixed version (ground truth):
public List<Category> getCategories(){
  List<Category> categoryList=null;
  String reqUrl=getRequestUrl(null,CATEGORY_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    categoryList=reqParser.parseCategories(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return categoryList;
}
Program: 5891
Project: 5891
Buggy source:
public List<DiningTable> getDiningTables(){
  List<DiningTable> tableList=null;
  String reqUrl=getRequestUrl(null,DINING_TABLE_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    tableList=reqParser.parseDiningTables(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
  return tableList;
}

Fixed version (ground truth):
public List<DiningTable> getDiningTables(){
  List<DiningTable> tableList=null;
  String reqUrl=getRequestUrl(null,DINING_TABLE_PAGE);
  String respStr=reqHelper.doPost(reqUrl,null);
  try {
    tableList=reqParser.parseDiningTables(respStr);
  }
 catch (  JSONException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return tableList;
}
Program: 5892
Project: 5892
Buggy source:
public boolean getFileFromServer(String path,Bundle params,OutputStream fos){
  byte[] bf=new byte[1024];
  int current=0;
  try {
    if (params != null) {
      StringBuilder sb=new StringBuilder();
      boolean first=true;
      for (      String key : params.keySet()) {
        if (first) {
          first=false;
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
      }
      path=path + "String_Node_Str" + sb.toString();
    }
    URL url=new URL(path);
    HttpURLConnection connect=(HttpURLConnection)url.openConnection();
    connect.setDoInput(true);
    connect.setConnectTimeout(5 * 1000);
    connect.setReadTimeout(30 * 1000);
    int code=connect.getResponseCode();
    if (code == HttpURLConnection.HTTP_OK) {
      InputStream is=connect.getInputStream();
      BufferedInputStream bis=new BufferedInputStream(is);
      while ((current=bis.read(bf)) != FILE_END) {
        fos.write(bf,0,current);
      }
      bis.close();
      fos.close();
      connect.disconnect();
    }
    return true;
  }
 catch (  MalformedURLException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
catch (  IOException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
public static boolean getFileFromServer(String path,Bundle params,OutputStream fos){
  byte[] bf=new byte[FILE_BUFFER_SIZE];
  int current=0;
  try {
    if (params != null) {
      StringBuilder sb=new StringBuilder();
      boolean first=true;
      for (      String key : params.keySet()) {
        if (first) {
          first=false;
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
      }
      path=path + "String_Node_Str" + sb.toString();
    }
    URL url=new URL(path);
    HttpURLConnection connect=(HttpURLConnection)url.openConnection();
    connect.setDoInput(true);
    connect.setConnectTimeout(CONNECTION_TIME_OUT);
    connect.setReadTimeout(SOCKET_TIME_OUT);
    int code=connect.getResponseCode();
    if (code == HttpURLConnection.HTTP_OK) {
      InputStream is=connect.getInputStream();
      BufferedInputStream bis=new BufferedInputStream(is);
      while ((current=bis.read(bf)) != FILE_END) {
        fos.write(bf,0,current);
      }
      bis.close();
      fos.close();
      connect.disconnect();
    }
    return true;
  }
 catch (  MalformedURLException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
catch (  IOException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
}
Program: 5893
Project: 5893
Buggy source:
public String doPost(String url,Bundle params){
  HttpPost httpRequest=new HttpPost(url);
  List paramsList=new ArrayList();
  BasicNameValuePair paramPair;
  if (params != null) {
    for (    String key : params.keySet()) {
      paramPair=new BasicNameValuePair(key,params.getString(key));
      paramsList.add(paramPair);
    }
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    httpRequest.setEntity(new UrlEncodedFormEntity(paramsList,HTTP.UTF_8));
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
public static String doPost(String url,Bundle params){
  HttpPost httpRequest=new HttpPost(url);
  List paramsList=new ArrayList();
  BasicNameValuePair paramPair;
  if (params != null) {
    for (    String key : params.keySet()) {
      paramPair=new BasicNameValuePair(key,params.getString(key));
      paramsList.add(paramPair);
    }
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    httpRequest.setEntity(new UrlEncodedFormEntity(paramsList,HTTP.UTF_8));
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}