nus-yam/ex-repair huggingface dataset:
Program: 26134
Project: 26134
Buggy source:
private static JSONObject getJSONObjectFromReader(JsonReader jsonReader){
  JSONObject jObj=new JSONObject();
  JsonToken tokenInstance;
  try {
    tokenInstance=jsonReader.peek();
    if (tokenInstance == JsonToken.BEGIN_OBJECT)     jsonReader.beginObject();
 else     if (tokenInstance == JsonToken.BEGIN_ARRAY)     jsonReader.beginArray();
    while (jsonReader.hasNext()) {
      JsonToken token;
      String name;
      try {
        name=jsonReader.nextName();
        token=jsonReader.peek();
switch (token) {
case NUMBER:
          jObj.put(name,jsonReader.nextLong());
        break;
case NULL:
      jsonReader.skipValue();
    break;
case BOOLEAN:
  jObj.put(name,jsonReader.nextBoolean());
break;
case BEGIN_OBJECT:
jObj.put(name,getJSONObjectFromReader(jsonReader));
break;
default :
jObj.put(name,jsonReader.nextString());
}
}
 catch (Exception ex) {
ex.printStackTrace();
jsonReader.skipValue();
}
}
if (tokenInstance == JsonToken.BEGIN_OBJECT) jsonReader.endObject();
 else if (tokenInstance == JsonToken.BEGIN_ARRAY) jsonReader.endArray();
return jObj;
}
 catch (Exception e) {
e.printStackTrace();
}
return null;
}

Fixed version (ground truth):
private static JSONObject getJSONObjectFromReader(JsonReader jsonReader){
  JSONObject jObj=new JSONObject();
  JsonToken tokenInstance;
  try {
    tokenInstance=jsonReader.peek();
    if (tokenInstance == JsonToken.BEGIN_OBJECT)     jsonReader.beginObject();
 else     if (tokenInstance == JsonToken.BEGIN_ARRAY)     jsonReader.beginArray();
    while (jsonReader.hasNext()) {
      JsonToken token;
      String name;
      try {
        name=jsonReader.nextName();
        token=jsonReader.peek();
switch (token) {
case NUMBER:
          jObj.put(name,jsonReader.nextLong());
        break;
case NULL:
      jsonReader.skipValue();
    break;
case BOOLEAN:
  jObj.put(name,jsonReader.nextBoolean());
break;
case BEGIN_OBJECT:
jObj.put(name,getJSONObjectFromReader(jsonReader));
break;
case BEGIN_ARRAY:
jsonReader.skipValue();
break;
default :
jObj.put(name,jsonReader.nextString());
}
}
 catch (Exception ex) {
ex.printStackTrace();
jsonReader.skipValue();
}
}
if (tokenInstance == JsonToken.BEGIN_OBJECT) jsonReader.endObject();
 else if (tokenInstance == JsonToken.BEGIN_ARRAY) jsonReader.endArray();
return jObj;
}
 catch (Exception e) {
e.printStackTrace();
}
return null;
}
Program: 26135
Project: 26135
Buggy source:
public static String GetVersionNumber(Context cont,String oc_root_path) throws Exception {
  HttpUrl basePath=HttpUrl.parse(oc_root_path);
  try {
    HttpUrl requestUrl=basePath.resolve(OwnCloudConstants.ROOT_PATH_APIv2).newBuilder().addPathSegment(OwnCloudConstants.VERSION_PATH).build();
    InputStream is=HttpJsonRequest.getInstance().PerformJsonRequest(requestUrl);
    try {
      GetVersion_v2 gv=new GetVersion_v2();
      readJsonStreamSimple(is,gv);
      return gv.getVersion();
    }
  finally {
      is.close();
    }
  }
 catch (  Exception ex) {
    HttpUrl requestUrl=basePath.resolve(OwnCloudConstants.ROOT_PATH_APIv1).newBuilder().addPathSegment(OwnCloudConstants.VERSION_PATH).addQueryParameter("String_Node_Str","String_Node_Str").build();
    InputStream is=HttpJsonRequest.getInstance().PerformJsonRequest(requestUrl);
    try {
      GetVersion_v1 gv=new GetVersion_v1();
      readJsonStreamSimple(is,gv);
      return gv.getVersion();
    }
  finally {
      is.close();
    }
  }
}

Fixed version (ground truth):
public static String GetVersionNumber(Context cont,String oc_root_path) throws Exception {
  if (!oc_root_path.endsWith("String_Node_Str"))   oc_root_path=oc_root_path + "String_Node_Str";
  HttpUrl basePath=HttpUrl.parse(oc_root_path);
  try {
    HttpUrl requestUrl=basePath.resolve("String_Node_Str" + OwnCloudConstants.ROOT_PATH_APIv2).newBuilder().addPathSegment(OwnCloudConstants.VERSION_PATH).build();
    InputStream is=HttpJsonRequest.getInstance().PerformJsonRequest(requestUrl);
    try {
      GetVersion_v2 gv=new GetVersion_v2();
      readJsonStreamSimple(is,gv);
      return gv.getVersion();
    }
  finally {
      is.close();
    }
  }
 catch (  Exception ex) {
    HttpUrl requestUrl=basePath.resolve("String_Node_Str" + OwnCloudConstants.ROOT_PATH_APIv1).newBuilder().addPathSegment(OwnCloudConstants.VERSION_PATH).addQueryParameter("String_Node_Str","String_Node_Str").build();
    InputStream is=HttpJsonRequest.getInstance().PerformJsonRequest(requestUrl);
    try {
      GetVersion_v1 gv=new GetVersion_v1();
      readJsonStreamSimple(is,gv);
      return gv.getVersion();
    }
  finally {
      is.close();
    }
  }
}
Program: 26136
Project: 26136
Buggy source:
public APIv1(Context cont){
  super(cont);
}

Fixed version (ground truth):
public APIv1(String baseUrl){
  super(baseUrl);
}
Program: 26137
Project: 26137
Buggy source:
public APIv2(Context cont){
  super(cont);
}

Fixed version (ground truth):
public APIv2(String baseUrl){
  super(baseUrl);
}
Program: 26138
Project: 26138
Buggy source:
@Override public void onAsyncTaskCompleted(int task_id,Object task_result){
  if (!(task_result instanceof Exception)) {
    String appVersion=task_result.toString();
    API api=API.GetRightApiForVersion(appVersion,SyncItemStateService.this);
    _Reader.setApi(api);
    _Reader.Start_AsyncTask_PerformItemStateChange(SyncItemStateService.this,null);
  }
}

Fixed version (ground truth):
@Override public void onAsyncTaskCompleted(int task_id,Object task_result){
  if (!(task_result instanceof Exception)) {
    String appVersion=task_result.toString();
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(SyncItemStateService.this);
    String baseUrl=mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,"String_Node_Str");
    API api=API.GetRightApiForVersion(appVersion,baseUrl);
    _Reader.setApi(api);
    _Reader.Start_AsyncTask_PerformItemStateChange(SyncItemStateService.this,null);
  }
}
Program: 26140
Project: 26140
Buggy source:
@Override public void onBackPressed(){
  if (handlePodcastBackPressed())   ;
 else   super.onBackPressed();
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (!handlePodcastBackPressed())   super.onBackPressed();
}
Program: 26142
Project: 26142
Buggy source:
@Override public void onBackPressed(){
  if (handlePodcastBackPressed())   ;
  if (drawerLayout != null) {
    if (drawerLayout.isDrawerOpen(GravityCompat.START))     super.onBackPressed();
 else     drawerLayout.openDrawer(GravityCompat.START);
  }
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (!handlePodcastBackPressed()) {
    if (drawerLayout != null) {
      if (drawerLayout.isDrawerOpen(GravityCompat.START))       super.onBackPressed();
 else       drawerLayout.openDrawer(GravityCompat.START);
    }
 else {
      super.onBackPressed();
    }
  }
}
Program: 26143
Project: 26143
Buggy source:
private Drawable getFolderIndicatorIcon(Context context){
  if (folder_indicator_icon == null) {
    if (ThemeChooser.isDarkTheme(mContext))     folder_indicator_icon=context.getResources().getDrawable(R.drawable.ic_action_expand_less_dark);
 else     folder_indicator_icon=context.getResources().getDrawable(R.drawable.ic_action_expand_less_light);
  }
  return folder_indicator_icon;
}

Fixed version (ground truth):
private int getFolderIndicatorIcon(){
  if (folder_indicator_icon == null) {
    if (ThemeChooser.isDarkTheme(mContext))     folder_indicator_icon=R.drawable.ic_action_expand_less_dark;
 else     folder_indicator_icon=R.drawable.ic_action_expand_less_light;
  }
  return folder_indicator_icon;
}
Program: 26145
Project: 26145
Buggy source:
private Drawable getBtn_rating_star_off_normal_holo_light(Context context){
  if (btn_rating_star_off_normal_holo_light == null) {
    if (ThemeChooser.isDarkTheme(mContext)) {
      btn_rating_star_off_normal_holo_light=context.getResources().getDrawable(R.drawable.ic_action_star_border_dark);
    }
 else {
      btn_rating_star_off_normal_holo_light=context.getResources().getDrawable(R.drawable.ic_action_star_border_light);
    }
  }
  return btn_rating_star_off_normal_holo_light;
}

Fixed version (ground truth):
private int getBtn_rating_star_off_normal_holo_light(){
  if (btn_rating_star_off_normal_holo_light == null) {
    if (ThemeChooser.isDarkTheme(mContext)) {
      btn_rating_star_off_normal_holo_light=R.drawable.ic_action_star_border_dark;
    }
 else {
      btn_rating_star_off_normal_holo_light=R.drawable.ic_action_star_border_light;
    }
  }
  return btn_rating_star_off_normal_holo_light;
}
Program: 26146
Project: 26146
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  ThemeChooser.chooseTheme(this);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_new_feed);
  ButterKnife.inject(this);
  if (toolbar != null) {
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
  DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(this);
  folders=dbConn.getListOfFolders();
  folders.add(0,new Folder(0,"String_Node_Str"));
  String[] folderNames=new String[folders.size()];
  for (int i=0; i < folders.size(); i++) {
    folderNames[i]=folders.get(i).getLabel();
  }
  ArrayAdapter<String> spinnerArrayAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,folderNames);
  mFolderView.setAdapter(spinnerArrayAdapter);
  mAddFeedButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(mFeedUrlView.getWindowToken(),0);
      attemptAddNewFeed();
    }
  }
);
  Intent intent=getIntent();
  String action=intent.getAction();
  if (action != null) {
    String url="String_Node_Str";
    if (action.equals(Intent.ACTION_VIEW)) {
      url=intent.getDataString();
    }
 else     if (action.equals(Intent.ACTION_SEND)) {
      url=intent.getStringExtra(Intent.EXTRA_TEXT);
    }
    Log.v("String_Node_Str","String_Node_Str" + action + "String_Node_Str"+ url);
    mFeedUrlView.setText(url);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  ThemeChooser.chooseTheme(this);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_new_feed);
  ButterKnife.inject(this);
  if (toolbar != null) {
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
  DatabaseConnectionOrm dbConn=new DatabaseConnectionOrm(this);
  folders=dbConn.getListOfFolders();
  folders.add(0,new Folder(0,"String_Node_Str"));
  String[] folderNames=new String[folders.size()];
  for (int i=0; i < folders.size(); i++) {
    folderNames[i]=folders.get(i).getLabel();
  }
  ArrayAdapter<String> spinnerArrayAdapter=new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item,folderNames);
  mFolderView.setAdapter(spinnerArrayAdapter);
  mAddFeedButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(mFeedUrlView.getWindowToken(),0);
      attemptAddNewFeed();
    }
  }
);
  Intent intent=getIntent();
  String action=intent.getAction();
  if (action != null) {
    String url="String_Node_Str";
    if (action.equals(Intent.ACTION_VIEW)) {
      url=intent.getDataString();
    }
 else     if (action.equals(Intent.ACTION_SEND)) {
      url=intent.getStringExtra(Intent.EXTRA_TEXT);
    }
    Log.v("String_Node_Str","String_Node_Str" + action + "String_Node_Str"+ url);
    mFeedUrlView.setText(url);
  }
}
Program: 26148
Project: 26148
Buggy source:
private boolean bindCustomTabsService(){
  if (mCustomTabsClient != null)   return true;
  String packageName=CustomTabActivityManager.getInstance().getPackageNameToUse(this);
  if (packageName == null)   return false;
  boolean ok=CustomTabsClient.bindCustomTabsService(this,packageName,new CustomTabsServiceConnection(){
    @Override public void onCustomTabsServiceConnected(    ComponentName name,    CustomTabsClient client){
      mCustomTabsClient=client;
    }
    @Override public void onServiceDisconnected(    ComponentName name){
      mCustomTabsClient=null;
    }
  }
);
  return ok;
}

Fixed version (ground truth):
private boolean bindCustomTabsService(){
  if (mCustomTabsClient != null)   return true;
  String packageName=CustomTabActivityManager.getInstance().getPackageNameToUse(this);
  if (packageName == null)   return false;
  return CustomTabsClient.bindCustomTabsService(this,packageName,new CustomTabsServiceConnection(){
    @Override public void onCustomTabsServiceConnected(    ComponentName name,    CustomTabsClient client){
      mCustomTabsClient=client;
    }
    @Override public void onServiceDisconnected(    ComponentName name){
      mCustomTabsClient=null;
    }
  }
);
}
Program: 26150
Project: 26150
Buggy source:
public static void SetSoftwareRenderModeForWebView(String htmlPage,WebView webView){
  if (htmlPage.contains("String_Node_Str")) {
    webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE,null);
    Log.v("String_Node_Str","String_Node_Str");
  }
 else {
    if (webView.getLayerType() == WebView.LAYER_TYPE_HARDWARE) {
      Log.v("String_Node_Str","String_Node_Str");
    }
 else     if (webView.getLayerType() == WebView.LAYER_TYPE_SOFTWARE) {
      Log.v("String_Node_Str","String_Node_Str");
    }
 else {
      Log.v("String_Node_Str","String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public static void SetSoftwareRenderModeForWebView(String htmlPage,WebView webView){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    return;
  }
  if (htmlPage.contains("String_Node_Str")) {
    webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE,null);
    Log.v("String_Node_Str","String_Node_Str");
  }
 else {
    if (webView.getLayerType() == WebView.LAYER_TYPE_HARDWARE) {
      Log.v("String_Node_Str","String_Node_Str");
    }
 else     if (webView.getLayerType() == WebView.LAYER_TYPE_SOFTWARE) {
      Log.v("String_Node_Str","String_Node_Str");
    }
 else {
      Log.v("String_Node_Str","String_Node_Str");
    }
  }
}
Program: 26151
Project: 26151
Buggy source:
public void setRefreshing(boolean isRefreshing){
  if (isRefreshing) {
    headerLogo.setImageDrawable(getResources().getDrawable(R.drawable.ic_launcher_background));
    headerLogoProgress.setVisibility(View.VISIBLE);
  }
 else {
    headerLogo.setImageDrawable(getResources().getDrawable(R.drawable.ic_launcher));
    headerLogoProgress.setVisibility(View.INVISIBLE);
  }
}

Fixed version (ground truth):
public void setRefreshing(boolean isRefreshing){
  if (isRefreshing) {
    headerLogo.setImageResource(R.drawable.ic_launcher_background);
    headerLogoProgress.setVisibility(View.VISIBLE);
  }
 else {
    headerLogo.setImageResource(R.drawable.ic_launcher);
    headerLogoProgress.setVisibility(View.INVISIBLE);
  }
}
Program: 26152
Project: 26152
Buggy source:
/** 
 * Use this factory method to create a new instance of this fragment using the provided parameters.
 * @return A new instance of fragment PodcastFragment.
 */
public static PodcastFragment newInstance(){
  PodcastFragment fragment=new PodcastFragment();
  return fragment;
}

Fixed version (ground truth):
/** 
 * Use this factory method to create a new instance of this fragment using the provided parameters.
 * @return A new instance of fragment PodcastFragment.
 */
public static PodcastFragment newInstance(){
  return new PodcastFragment();
}
Program: 26153
Project: 26153
Buggy source:
public void animateToPosition(final int yPosition){
  appHeight=getWindow().getDecorView().findViewById(android.R.id.content).getHeight();
  appWidth=getWindow().getDecorView().findViewById(android.R.id.content).getWidth();
  final View view=rlVideoPodcastSurfaceWrapper;
  if (scaleFactor != 1) {
    int oldHeight=view.getLayoutParams().height;
    int oldWidth=view.getLayoutParams().width;
    int newHeight=view.getLayoutParams().height*=scaleFactor;
    int newWidth=view.getLayoutParams().width*=scaleFactor;
    scaleFactor=1;
    Animation animator=new SizeAnimator(view,newWidth,newHeight,oldWidth,oldHeight,animationTime).sizeAnimator;
    animator.setAnimationListener(new Animation.AnimationListener(){
      @Override public void onAnimationStart(      Animation animation){
      }
      @Override public void onAnimationEnd(      Animation animation){
        animateToPosition(yPosition);
      }
      @Override public void onAnimationRepeat(      Animation animation){
      }
    }
);
    view.startAnimation(animator);
  }
 else {
    int absoluteYPosition=appHeight - view.getHeight() - (int)getResources().getDimension(R.dimen.activity_vertical_margin)- (int)dipToPx(yPosition);
    float xPosition=rlVideoPodcastSurfaceWrapper.getVideoXPosition();
    view.animate().x(xPosition).y(absoluteYPosition).setDuration(animationTime);
  }
  oldScaleFactor=1;
}

Fixed version (ground truth):
public void animateToPosition(final int yPosition){
  appHeight=getWindow().getDecorView().findViewById(android.R.id.content).getHeight();
  appWidth=getWindow().getDecorView().findViewById(android.R.id.content).getWidth();
  final View view=rlVideoPodcastSurfaceWrapper;
  if (scaleFactor != 1) {
    int oldHeight=view.getLayoutParams().height;
    int oldWidth=view.getLayoutParams().width;
    int newHeight=view.getLayoutParams().height*=scaleFactor;
    int newWidth=view.getLayoutParams().width*=scaleFactor;
    scaleFactor=1;
    Animation animator=new SizeAnimator(view,newWidth,newHeight,oldWidth,oldHeight,animationTime).sizeAnimator;
    animator.setAnimationListener(new Animation.AnimationListener(){
      @Override public void onAnimationStart(      Animation animation){
      }
      @Override public void onAnimationEnd(      Animation animation){
        animateToPosition(yPosition);
      }
      @Override public void onAnimationRepeat(      Animation animation){
      }
    }
);
    view.startAnimation(animator);
  }
 else {
    int absoluteYPosition=appHeight - view.getHeight() - (int)getResources().getDimension(R.dimen.activity_vertical_margin)- (int)dipToPx(yPosition);
    float xPosition=rlVideoPodcastSurfaceWrapper.getVideoXPosition();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      view.animate().x(xPosition).y(absoluteYPosition).setDuration(animationTime);
    }
  }
  oldScaleFactor=1;
}
Program: 26154
Project: 26154
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_sync_interval_selector,container,false);
  String[] items=getResources().getStringArray(R.array.array_sync_interval);
  lvItems=(ListView)rootView.findViewById(R.id.lv_sync_interval_items);
  lvItems.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  ArrayAdapter<String> adapter=new ArrayAdapter<String>(getActivity(),android.R.layout.simple_list_item_single_choice,android.R.id.text1,items);
  lvItems.setAdapter(adapter);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (!mPrefs.contains(SYNC_INTERVAL_IN_MINUTES_STRING))   lvItems.setItemChecked(items.length - 1,true);
 else {
    int position=0;
    int minutes=mPrefs.getInt(SYNC_INTERVAL_IN_MINUTES_STRING,0);
    for (    String item : ((SyncIntervalSelectorActivity)getActivity()).items_values) {
      if (Integer.parseInt(item) == minutes)       break;
      position++;
    }
    lvItems.setItemChecked(position,true);
  }
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_sync_interval_selector,container,false);
  String[] items=getResources().getStringArray(R.array.array_sync_interval);
  lvItems=(ListView)rootView.findViewById(R.id.lv_sync_interval_items);
  lvItems.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  ArrayAdapter<String> adapter=new ArrayAdapter<>(getActivity(),android.R.layout.simple_list_item_single_choice,android.R.id.text1,items);
  lvItems.setAdapter(adapter);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (!mPrefs.contains(SYNC_INTERVAL_IN_MINUTES_STRING))   lvItems.setItemChecked(items.length - 1,true);
 else {
    int position=0;
    int minutes=mPrefs.getInt(SYNC_INTERVAL_IN_MINUTES_STRING,0);
    for (    String item : ((SyncIntervalSelectorActivity)getActivity()).items_values) {
      if (Integer.parseInt(item) == minutes)       break;
      position++;
    }
    lvItems.setItemChecked(position,true);
  }
  return rootView;
}
Program: 26155
Project: 26155
Buggy source:
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  if (dy == 0 || recyclerView.getChildCount() <= 0)   return;
  LinearLayoutManager linearLayoutManager=(LinearLayoutManager)recyclerView.getLayoutManager();
  int firstVisibleItem=linearLayoutManager.findFirstVisibleItemPosition();
  int lastVisibleItem=linearLayoutManager.findLastVisibleItemPosition();
  for (int i=firstVisibleItem; i <= lastVisibleItem; i++) {
    ViewHolder vh=(ViewHolder)recyclerView.findViewHolderForLayoutPosition(i);
    if (vh != null && !vh.shouldStayUnread()) {
      vh.setReadState(true);
    }
  }
}

Fixed version (ground truth):
@Override public void onScrolled(RecyclerView recyclerView,int dx,int dy){
  if (dy == 0 || recyclerView.getChildCount() <= 0)   return;
  LinearLayoutManager linearLayoutManager=(LinearLayoutManager)recyclerView.getLayoutManager();
  int firstVisibleItem=linearLayoutManager.findFirstVisibleItemPosition();
  int lastVisibleItem=linearLayoutManager.findLastVisibleItemPosition();
  int visibleItemCount=lastVisibleItem - firstVisibleItem;
  int totalItemCount=recyclerView.getAdapter().getItemCount();
  NewsListRecyclerAdapter adapter=(NewsListRecyclerAdapter)recyclerView.getAdapter();
  ViewHolder vh=(ViewHolder)recyclerView.findViewHolderForLayoutPosition(firstVisibleItem);
  if (vh != null && !vh.shouldStayUnread()) {
    adapter.ChangeReadStateOfItem(vh,true);
  }
  if (lastVisibleItem == (totalItemCount - 1) && recyclerView.getChildAt(visibleItemCount).getBottom() <= recyclerView.getHeight()) {
    for (int i=firstVisibleItem + 1; i <= lastVisibleItem; i++) {
      vh=(ViewHolder)recyclerView.findViewHolderForLayoutPosition(i);
      if (vh != null && !vh.shouldStayUnread()) {
        adapter.ChangeReadStateOfItem(vh,true);
      }
    }
  }
}
Program: 26156
Project: 26156
Buggy source:
@Override public void onResume(){
  Log.v(TAG,"String_Node_Str");
  EventBus.getDefault().register(this);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getBoolean(SettingsActivity.CB_MARK_AS_READ_WHILE_SCROLLING_STRING,false)) {
    recyclerView.addOnScrollListener(ListScrollListener);
  }
  if (onResumeCount >= 2) {
    UpdateCurrentRssView(getActivity(),false);
  }
  onResumeCount++;
  super.onResume();
}

Fixed version (ground truth):
@Override public void onResume(){
  Log.v(TAG,"String_Node_Str");
  EventBus.getDefault().register(this);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getBoolean(SettingsActivity.CB_MARK_AS_READ_WHILE_SCROLLING_STRING,false)) {
    recyclerView.addOnScrollListener(ListScrollListener);
  }
 else {
    recyclerView.removeOnScrollListener(ListScrollListener);
  }
  if (onResumeCount >= 2) {
    UpdateCurrentRssView(getActivity(),false);
  }
  onResumeCount++;
  super.onResume();
}
Program: 26157
Project: 26157
Buggy source:
public void ChangeReadStateOfItem(ViewHolder viewHolder,boolean isChecked){
  RssItem rssItem=viewHolder.getRssItem();
  rssItem.setRead_temp(isChecked);
  dbConn.updateRssItem(rssItem);
  pDelayHandler.DelayTimer();
  viewHolder.setReadState(isChecked);
  stayUnreadItems.add(rssItem.getId());
}

Fixed version (ground truth):
public void ChangeReadStateOfItem(ViewHolder viewHolder,boolean isChecked){
  RssItem rssItem=viewHolder.getRssItem();
  if (rssItem.getRead_temp() != isChecked) {
    rssItem.setRead_temp(isChecked);
    dbConn.updateRssItem(rssItem);
    pDelayHandler.DelayTimer();
    viewHolder.setReadState(isChecked);
    stayUnreadItems.add(rssItem.getId());
  }
}
Program: 26158
Project: 26158
Buggy source:
public void onScroll(final AbsListView view,final int firstVisibleItem,final int visibleItemCount,int totalItemCount){
  if (lastViewedArticleCheckbox == null)   lastViewedArticleCheckbox=getCheckBoxAtPosition(0,view);
  CheckBox cb=getCheckBoxAtPosition(0,view);
  if (lastViewedArticleCheckbox != cb) {
    if (!(lastViewedArticleCheckbox.isChecked() && stayUnreadCheckboxes.contains(lastViewedArticleCheckbox)))     ;
    NewsListCursorAdapter.ChangeCheckBoxState(lastViewedArticleCheckbox,true,getActivity());
    lastViewedArticleCheckbox=cb;
  }
}

Fixed version (ground truth):
@Override public void onScroll(final AbsListView view,final int firstVisibleItem,final int visibleItemCount,int totalItemCount){
  if (lastViewedArticleCheckbox == null)   lastViewedArticleCheckbox=getCheckBoxAtPosition(0,view);
  CheckBox cb=getCheckBoxAtPosition(0,view);
  if (lastViewedArticleCheckbox != cb) {
    if (!(lastViewedArticleCheckbox.isChecked() && stayUnreadCheckboxes.contains(lastViewedArticleCheckbox)))     ;
    NewsListCursorAdapter.ChangeCheckBoxState(lastViewedArticleCheckbox,true,getActivity());
    lastViewedArticleCheckbox=cb;
  }
}
Program: 26159
Project: 26159
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (getArguments() != null) {
    if (getArguments().containsKey(NewsReaderListActivity.FEED_ID)) {
      idFeed=getArguments().getLong(NewsReaderListActivity.FEED_ID);
    }
    if (getArguments().containsKey(NewsReaderListActivity.TITEL)) {
      titel=getArguments().getString(NewsReaderListActivity.TITEL);
    }
    if (getArguments().containsKey(NewsReaderListActivity.FOLDER_ID)) {
      idFolder=getArguments().getLong(NewsReaderListActivity.FOLDER_ID);
    }
    UpdateMenuItemsState();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (getArguments() != null) {
    if (getArguments().containsKey(NewsReaderListActivity.FEED_ID)) {
      idFeed=getArguments().getLong(NewsReaderListActivity.FEED_ID);
    }
    if (getArguments().containsKey(NewsReaderListActivity.TITEL)) {
      titel=getArguments().getString(NewsReaderListActivity.TITEL);
    }
    if (getArguments().containsKey(NewsReaderListActivity.FOLDER_ID)) {
      idFolder=getArguments().getLong(NewsReaderListActivity.FOLDER_ID);
    }
  }
}
Program: 26160
Project: 26160
Buggy source:
/** 
 * Updates the current RSS-View
 * @param context
 */
public void UpdateCurrentRssView(Context context,boolean refreshCurrentRssView){
  new UpdateCurrentRssViewTask(context,refreshCurrentRssView).execute((Void)null);
}

Fixed version (ground truth):
/** 
 * Updates the current RSS-View
 * @param context
 */
public void UpdateCurrentRssView(Context context,boolean refreshCurrentRssView){
  Log.v(TAG,"String_Node_Str");
  AsyncTaskHelper.StartAsyncTask(new UpdateCurrentRssViewTask(context,refreshCurrentRssView),(Void)null);
}
Program: 26161
Project: 26161
Buggy source:
@Override public void onResume(){
  EventBus.getDefault().register(this);
  notifyDataSetChangedOnAdapter();
  super.onResume();
}

Fixed version (ground truth):
@Override public void onResume(){
  EventBus.getDefault().register(this);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getBoolean(SettingsActivity.CB_MARK_AS_READ_WHILE_SCROLLING_STRING,false)) {
    getListView().setOnScrollListener(ListScrollListener);
  }
  if (reloadCursorOnStartUp)   UpdateCurrentRssView(getActivity(),true);
 else   UpdateCurrentRssView(getActivity(),false);
  super.onResume();
}
Program: 26162
Project: 26162
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  ((ActionBarActivity)getActivity()).getSupportActionBar().setTitle(titel);
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getBoolean(SettingsActivity.CB_MARK_AS_READ_WHILE_SCROLLING_STRING,false)) {
    getListView().setOnScrollListener(new AbsListView.OnScrollListener(){
      public void onScrollStateChanged(      AbsListView view,      int scrollState){
      }
      CheckBox lastViewedArticleCheckbox=null;
      public void onScroll(      final AbsListView view,      final int firstVisibleItem,      final int visibleItemCount,      int totalItemCount){
        if (lastViewedArticleCheckbox == null)         lastViewedArticleCheckbox=getCheckBoxAtPosition(0,view);
        CheckBox cb=getCheckBoxAtPosition(0,view);
        if (lastViewedArticleCheckbox != cb) {
          if (!(lastViewedArticleCheckbox.isChecked() && stayUnreadCheckboxes.contains(lastViewedArticleCheckbox)))           ;
          NewsListCursorAdapter.ChangeCheckBoxState(lastViewedArticleCheckbox,true,getActivity());
          lastViewedArticleCheckbox=cb;
        }
      }
    }
);
  }
  if (reloadCursorOnStartUp)   UpdateCurrentRssView(getActivity(),true);
 else   UpdateCurrentRssView(getActivity(),false);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  ((ActionBarActivity)getActivity()).getSupportActionBar().setTitle(titel);
}
Program: 26163
Project: 26163
Buggy source:
public void onScrollStateChanged(AbsListView view,int scrollState){
}

Fixed version (ground truth):
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
}
Program: 26164
Project: 26164
Buggy source:
@Override protected Void doInBackground(Void... voids){
  ReloadAdapter();
  return null;
}

Fixed version (ground truth):
@Override protected Tuple<ArrayList<AbstractItem>,SparseArray<SparseArray<ConcreteFeedItem>>> doInBackground(Void... voids){
  return ReloadAdapter();
}
Program: 26165
Project: 26165
Buggy source:
@Override protected void onPostExecute(Void aVoid){
  notifyReloadAdapterDataChanged();
  progressBar.setVisibility(View.GONE);
  super.onPostExecute(aVoid);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Tuple<ArrayList<AbstractItem>,SparseArray<SparseArray<ConcreteFeedItem>>> arrayListSparseArrayTuple){
  mCategoriesArrayList=arrayListSparseArrayTuple.key;
  mItemsArrayList=arrayListSparseArrayTuple.value;
  notifyDataSetChanged();
  NotifyDataSetChangedAsync();
  progressBar.setVisibility(View.GONE);
  super.onPostExecute(arrayListSparseArrayTuple);
}
Program: 26167
Project: 26167
Buggy source:
@Override public void finishedSync(String sync_type) throws RemoteException {
  Handler refresh=new Handler(Looper.getMainLooper());
  refresh.post(new Runnable(){
    public void run(){
      UpdateSyncButtonLayout();
    }
  }
);
  SYNC_TYPES st=SYNC_TYPES.valueOf(sync_type);
switch (st) {
case SYNC_TYPE__GET_API:
    break;
case SYNC_TYPE__ITEM_STATES:
  break;
case SYNC_TYPE__FOLDER:
break;
case SYNC_TYPE__FEEDS:
break;
case SYNC_TYPE__ITEMS:
Log.d(TAG,"String_Node_Str");
refresh=new Handler(Looper.getMainLooper());
refresh.post(new Runnable(){
public void run(){
ReloadAdapter();
NewsReaderListActivity nlActivity=(NewsReaderListActivity)getActivity();
if (nlActivity != null) {
nlActivity.UpdateItemList();
nlActivity.UpdatePodcastView();
}
SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
int newItemsCount=mPrefs.getInt(Constants.LAST_UPDATE_NEW_ITEMS_COUNT_STRING,0);
if (newItemsCount > 0) {
MessageBar messageBar=new MessageBar(getActivity(),true);
TextMessage textMessage=new TextMessage(newItemsCount + "String_Node_Str" + getString(R.string.message_bar_new_articles_available),getString(R.string.message_bar_reload),R.drawable.ic_menu_refresh);
textMessage.setClickListener(mListener);
messageBar.show(textMessage);
}
}
}
);
break;
}
}

Fixed version (ground truth):
@Override public void finishedSync(String sync_type) throws RemoteException {
  Handler refresh=new Handler(Looper.getMainLooper());
  refresh.post(new Runnable(){
    public void run(){
      ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
    }
  }
);
  SYNC_TYPES st=SYNC_TYPES.valueOf(sync_type);
switch (st) {
case SYNC_TYPE__GET_API:
    break;
case SYNC_TYPE__ITEM_STATES:
  break;
case SYNC_TYPE__FOLDER:
break;
case SYNC_TYPE__FEEDS:
break;
case SYNC_TYPE__ITEMS:
Log.d(TAG,"String_Node_Str");
refresh=new Handler(Looper.getMainLooper());
refresh.post(new Runnable(){
public void run(){
ReloadAdapter();
NewsReaderListActivity nlActivity=(NewsReaderListActivity)getActivity();
if (nlActivity != null) {
nlActivity.UpdateItemList();
nlActivity.UpdatePodcastView();
}
SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
int newItemsCount=mPrefs.getInt(Constants.LAST_UPDATE_NEW_ITEMS_COUNT_STRING,0);
if (newItemsCount > 0) {
MessageBar messageBar=new MessageBar(getActivity(),true);
TextMessage textMessage=new TextMessage(newItemsCount + "String_Node_Str" + getString(R.string.message_bar_new_articles_available),getString(R.string.message_bar_reload),R.drawable.ic_menu_refresh);
textMessage.setClickListener(mListener);
messageBar.show(textMessage);
}
}
}
);
break;
}
}
Program: 26168
Project: 26168
Buggy source:
@Override public void onStart(){
  Intent serviceIntent=new Intent(getActivity(),OwnCloudSyncService.class);
  mConnection=generateServiceConnection();
  getActivity().bindService(serviceIntent,mConnection,Context.BIND_AUTO_CREATE);
  super.onStart();
}

Fixed version (ground truth):
@Override public void onStart(){
  Intent serviceIntent=new Intent(getActivity(),OwnCloudSyncService.class);
  mConnection=generateServiceConnection();
  if (!isMyServiceRunning(OwnCloudSyncService.class)) {
    getActivity().startService(serviceIntent);
  }
  getActivity().bindService(serviceIntent,mConnection,Context.BIND_AUTO_CREATE);
  super.onStart();
}
Program: 26169
Project: 26169
Buggy source:
private ServiceConnection generateServiceConnection(){
  return new ServiceConnection(){
    @Override public void onServiceConnected(    ComponentName name,    IBinder binder){
      _ownCloudSyncService=IOwnCloudSyncService.Stub.asInterface(binder);
      try {
        _ownCloudSyncService.registerCallback(callback);
        SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
        if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))         StartSync();
        if (getActivity() instanceof NewsReaderListActivity)         ((NewsReaderListActivity)getActivity()).UpdateButtonSyncLayout();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
    @Override public void onServiceDisconnected(    ComponentName name){
      try {
        _ownCloudSyncService.unregisterCallback(callback);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
;
}

Fixed version (ground truth):
private ServiceConnection generateServiceConnection(){
  return new ServiceConnection(){
    @Override public void onServiceConnected(    ComponentName name,    IBinder binder){
      _ownCloudSyncService=IOwnCloudSyncService.Stub.asInterface(binder);
      try {
        _ownCloudSyncService.registerCallback(callback);
        SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
        if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))         StartSync();
        if (getActivity() instanceof NewsReaderListActivity)         ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
    @Override public void onServiceDisconnected(    ComponentName name){
      try {
        _ownCloudSyncService.unregisterCallback(callback);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
;
}
Program: 26170
Project: 26170
Buggy source:
private void HandleExceptionMessages(Exception ex){
  if (ex instanceof HttpHostConnectException)   ShowToastLong("String_Node_Str");
 else   if (ex instanceof HttpResponseException) {
    HttpResponseException responseException=(HttpResponseException)ex;
    ShowToastLong(responseException.getLocalizedMessage());
  }
 else   ShowToastLong(ex.getLocalizedMessage());
  UpdateSyncButtonLayout();
}

Fixed version (ground truth):
private void HandleExceptionMessages(Exception ex){
  if (ex instanceof HttpHostConnectException)   ShowToastLong("String_Node_Str");
 else   if (ex instanceof HttpResponseException) {
    HttpResponseException responseException=(HttpResponseException)ex;
    ShowToastLong(responseException.getLocalizedMessage());
  }
 else   ShowToastLong(ex.getLocalizedMessage());
  ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
}
Program: 26171
Project: 26171
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder binder){
  _ownCloudSyncService=IOwnCloudSyncService.Stub.asInterface(binder);
  try {
    _ownCloudSyncService.registerCallback(callback);
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
    if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))     StartSync();
    if (getActivity() instanceof NewsReaderListActivity)     ((NewsReaderListActivity)getActivity()).UpdateButtonSyncLayout();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder binder){
  _ownCloudSyncService=IOwnCloudSyncService.Stub.asInterface(binder);
  try {
    _ownCloudSyncService.registerCallback(callback);
    SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
    if (mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING,false))     StartSync();
    if (getActivity() instanceof NewsReaderListActivity)     ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 26172
Project: 26172
Buggy source:
@Override public void startedSync(String sync_type) throws RemoteException {
  Handler refresh=new Handler(Looper.getMainLooper());
  refresh.post(new Runnable(){
    public void run(){
      UpdateSyncButtonLayout();
    }
  }
);
}

Fixed version (ground truth):
@Override public void startedSync(String sync_type) throws RemoteException {
  Handler refresh=new Handler(Looper.getMainLooper());
  refresh.post(new Runnable(){
    public void run(){
      ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
      ;
    }
  }
);
}
Program: 26173
Project: 26173
Buggy source:
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null)   NewsReaderListActivity.StartLoginFragment((FragmentActivity)getActivity());
 else {
    try {
      if (!_ownCloudSyncService.isSyncRunning()) {
        new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();
        Bundle accBundle=new Bundle();
        accBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL,true);
        AccountManager mAccountManager=AccountManager.get(getActivity());
        Account[] accounts=mAccountManager.getAccounts();
        for (        Account acc : accounts)         if (acc.type.equals(AccountGeneral.ACCOUNT_TYPE))         ContentResolver.requestSync(acc,AccountGeneral.ACCOUNT_TYPE,accBundle);
      }
 else {
        UpdateSyncButtonLayout();
      }
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void StartSync(){
  SharedPreferences mPrefs=PreferenceManager.getDefaultSharedPreferences(getActivity());
  if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING,null) == null)   NewsReaderListActivity.StartLoginFragment((FragmentActivity)getActivity());
 else {
    try {
      if (!_ownCloudSyncService.isSyncRunning()) {
        new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();
        Bundle accBundle=new Bundle();
        accBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL,true);
        AccountManager mAccountManager=AccountManager.get(getActivity());
        Account[] accounts=mAccountManager.getAccounts();
        for (        Account acc : accounts)         if (acc.type.equals(AccountGeneral.ACCOUNT_TYPE))         ContentResolver.requestSync(acc,AccountGeneral.ACCOUNT_TYPE,accBundle);
      }
 else {
        ((NewsReaderListActivity)getActivity()).UpdateButtonLayout();
      }
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
  }
}
Program: 26174
Project: 26174
Buggy source:
private void finishedSync(SYNC_TYPES sync_type){
  List<IOwnCloudSyncServiceCallback> callbackList=getCallBackItemsAndBeginBroadcast();
  for (  IOwnCloudSyncServiceCallback icb : callbackList) {
    try {
      icb.finishedSync(sync_type.toString());
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
  }
  callbacks.finishBroadcast();
}

Fixed version (ground truth):
private void finishedSync(SYNC_TYPES sync_type){
  Log.v(TAG,"String_Node_Str" + sync_type.toString());
  List<IOwnCloudSyncServiceCallback> callbackList=getCallBackItemsAndBeginBroadcast();
  for (  IOwnCloudSyncServiceCallback icb : callbackList) {
    try {
      icb.finishedSync(sync_type.toString());
    }
 catch (    RemoteException e) {
      e.printStackTrace();
    }
  }
  callbacks.finishBroadcast();
}
Program: 26175
Project: 26175
Buggy source:
private static void init_webTemplate(Context context){
  if (web_template == null) {
    try {
      web_template=getTextFromAssets("String_Node_Str",context);
      String background_color_string=SearchString(web_template,"String_Node_Str","String_Node_Str");
      if (background_color_string != null) {
        if (background_color_string.matches("String_Node_Str"))         background_color=Color.parseColor(convertHexColorFrom3To6Characters(background_color_string));
 else         if (background_color_string.matches("String_Node_Str"))         background_color=Color.parseColor(background_color_string);
      }
      if (ThemeChooser.isDarkTheme(context))       web_template=web_template.replace("String_Node_Str","String_Node_Str");
      FontHelper fHelper=new FontHelper(context);
      web_template=web_template.replace("String_Node_Str",fHelper.getFontName());
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private static synchronized void init_webTemplate(Context context){
  if (web_template == null) {
    try {
      web_template=getTextFromAssets("String_Node_Str",context);
      String background_color_string=SearchString(web_template,"String_Node_Str","String_Node_Str");
      if (background_color_string != null) {
        if (background_color_string.matches("String_Node_Str"))         background_color=Color.parseColor(convertHexColorFrom3To6Characters(background_color_string));
 else         if (background_color_string.matches("String_Node_Str"))         background_color=Color.parseColor(background_color_string);
      }
      if (ThemeChooser.isDarkTheme(context))       web_template=web_template.replace("String_Node_Str","String_Node_Str");
      FontHelper fHelper=new FontHelper(context);
      web_template=web_template.replace("String_Node_Str",fHelper.getFontName());
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
}
Program: 26176
Project: 26176
Buggy source:
public static void InsertFeedsIntoDatabase(ArrayList<Feed> newFeeds,DatabaseConnectionOrm dbConn){
  List<Feed> oldFeeds=dbConn.getListOfFeeds();
  try {
    if (newFeeds != null) {
      for (      Feed feed : newFeeds)       dbConn.insertNewFeed(feed);
      for (      Feed feed : oldFeeds) {
        boolean found=false;
        for (int i=0; i < oldFeeds.size(); i++) {
          if (oldFeeds.get(i).getFeedTitle().equals(feed.getFeedTitle())) {
            found=true;
            break;
          }
        }
        if (!found) {
          dbConn.removeFeedById(feed.getId());
          Log.d(TAG,"String_Node_Str" + feed.getFeedTitle());
        }
      }
    }
  }
  finally {
  }
}

Fixed version (ground truth):
public static void InsertFeedsIntoDatabase(ArrayList<Feed> newFeeds,DatabaseConnectionOrm dbConn){
  List<Feed> oldFeeds=dbConn.getListOfFeeds();
  try {
    if (newFeeds != null) {
      for (      Feed feed : newFeeds)       dbConn.insertNewFeed(feed);
      for (      Feed feed : oldFeeds) {
        boolean found=false;
        for (int i=0; i < oldFeeds.size(); i++) {
          if (oldFeeds.get(i).getFeedTitle().equals(feed.getFeedTitle())) {
            feed.setAvgColour(oldFeeds.get(i).getAvgColour());
            dbConn.updateFeed(feed);
            found=true;
            break;
          }
        }
        if (!found) {
          dbConn.removeFeedById(feed.getId());
          Log.d(TAG,"String_Node_Str" + feed.getFeedTitle());
        }
      }
    }
  }
  finally {
  }
}
Program: 26178
Project: 26178
Buggy source:
@Override protected Void doInBackground(Void... params){
  if (text != null) {
    List<String> links=ImageHandler.getImageLinksFromText(text);
    for (    String link : links)     new GetImageAsyncTask(link,null,999,FileUtils.getPathImageCache(context),context,null).execute();
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... params){
  if (text != null) {
    List<String> links=ImageHandler.getImageLinksFromText(text);
    for (    String link : links)     new GetImageAsyncTask(link,null,999,FileUtils.getPathImageCache(context),context).execute();
  }
  return null;
}
Program: 26179
Project: 26179
Buggy source:
@Override protected void onPostExecute(Bitmap result){
  if (imageDownloadFinished != null)   imageDownloadFinished.DownloadFinished(AsyncTaskId,feedID,result);
  super.onPostExecute(result);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap result){
  if (imageDownloadFinished != null)   imageDownloadFinished.DownloadFinished(AsyncTaskId,result);
  super.onPostExecute(result);
}
Program: 26180
Project: 26180
Buggy source:
public GetImageAsyncTask(String WEB_URL_TO_FILE,ImageDownloadFinished imgDownloadFinished,int AsynkTaskId,String rootPath,Context cont,Long feedId){
  try {
    this.WEB_URL_TO_FILE=new URL(WEB_URL_TO_FILE);
  }
 catch (  Exception ex) {
    Log.d(TAG,ex.getLocalizedMessage() + "String_Node_Str" + WEB_URL_TO_FILE);
  }
  this.feedID=feedId;
  this.cont=cont;
  imageDownloadFinished=imgDownloadFinished;
  this.AsyncTaskId=AsynkTaskId;
  this.rootPath=rootPath;
}

Fixed version (ground truth):
public GetImageAsyncTask(String WEB_URL_TO_FILE,ImageDownloadFinished imgDownloadFinished,long AsynkTaskId,String rootPath,Context cont){
  try {
    this.WEB_URL_TO_FILE=new URL(WEB_URL_TO_FILE);
  }
 catch (  Exception ex) {
    Log.d(TAG,ex.getLocalizedMessage() + "String_Node_Str" + WEB_URL_TO_FILE);
  }
  this.cont=cont;
  imageDownloadFinished=imgDownloadFinished;
  this.AsyncTaskId=AsynkTaskId;
  this.rootPath=rootPath;
}
Program: 26181
Project: 26181
Buggy source:
public void PreCacheFavIcon(String WEB_URL_TO_FILE,Long feedID){
  int key=feedID.intValue();
  GetImageAsyncTask giAsync=new GetImageAsyncTask(WEB_URL_TO_FILE,favIconDownloadFinished,key,FileUtils.getPathFavIcons(context),context,feedID);
  giAsync.scaleImage=true;
  giAsync.dstHeight=2 * 32;
  giAsync.dstWidth=2 * 32;
  giAsync.feedID=feedID;
  AsyncTaskHelper.StartAsyncTask(giAsync,((Void)null));
}

Fixed version (ground truth):
public void PreCacheFavIcon(Feed feed){
  GetImageAsyncTask giAsync=new GetImageAsyncTask(feed.getFaviconUrl(),favIconDownloadFinished,feed.getId(),FileUtils.getPathFavIcons(context),context);
  giAsync.scaleImage=true;
  giAsync.dstHeight=2 * 32;
  giAsync.dstWidth=2 * 32;
  AsyncTaskHelper.StartAsyncTask(giAsync,((Void)null));
}