nus-yam/ex-repair huggingface dataset:
Program: 32969
Project: 32969
Buggy source:
@Override public void onScrolled(RecyclerView view,int dx,int dy){
  int lastVisibleItemPosition=0;
  int totalItemCount=mLayoutManager.getItemCount();
  if (mLayoutManager instanceof StaggeredGridLayoutManager) {
    int[] lastVisibleItemPositions=((StaggeredGridLayoutManager)mLayoutManager).findLastVisibleItemPositions(null);
    lastVisibleItemPosition=getLastVisibleItem(lastVisibleItemPositions);
  }
 else   if (mLayoutManager instanceof LinearLayoutManager) {
    lastVisibleItemPosition=((LinearLayoutManager)mLayoutManager).findLastVisibleItemPosition();
  }
 else   if (mLayoutManager instanceof GridLayoutManager) {
    lastVisibleItemPosition=((GridLayoutManager)mLayoutManager).findLastVisibleItemPosition();
  }
  if (totalItemCount < previousTotalItemCount) {
    this.currentPage=this.startingPageIndex;
    this.previousTotalItemCount=totalItemCount;
    if (totalItemCount == 0) {
      this.loading=true;
    }
  }
  if (loading && (totalItemCount > previousTotalItemCount)) {
    loading=false;
    previousTotalItemCount=totalItemCount;
  }
  if (!loading && (lastVisibleItemPosition + visibleThreshold) > totalItemCount) {
    currentPage++;
    onLoadMore(currentPage,totalItemCount);
    loading=true;
  }
}

Fixed version (ground truth):
@Override public void onScrolled(RecyclerView view,int dx,int dy){
  int lastVisibleItemPosition=0;
  int totalItemCount=mLayoutManager.getItemCount();
  if (mLayoutManager instanceof StaggeredGridLayoutManager) {
    int[] lastVisibleItemPositions=((StaggeredGridLayoutManager)mLayoutManager).findLastVisibleItemPositions(null);
    lastVisibleItemPosition=getLastVisibleItem(lastVisibleItemPositions);
  }
 else   if (mLayoutManager instanceof LinearLayoutManager) {
    lastVisibleItemPosition=((LinearLayoutManager)mLayoutManager).findLastVisibleItemPosition();
  }
 else   if (mLayoutManager instanceof GridLayoutManager) {
    lastVisibleItemPosition=((GridLayoutManager)mLayoutManager).findLastVisibleItemPosition();
  }
  if (totalItemCount < previousTotalItemCount) {
    this.currentPage=this.startingPageIndex;
    this.previousTotalItemCount=totalItemCount;
    if (totalItemCount == 0) {
      this.loading=true;
    }
 else {
      this.loading=false;
    }
  }
  if (loading && (totalItemCount > previousTotalItemCount)) {
    loading=false;
    previousTotalItemCount=totalItemCount;
  }
  if (!loading && (lastVisibleItemPosition + visibleThreshold) > totalItemCount) {
    currentPage++;
    onLoadMore(currentPage,totalItemCount);
    loading=true;
  }
}
Program: 32970
Project: 32970
Buggy source:
@Override public void onLoadMore(int current_page){
  mClientListPresenter.loadClients(true,clientList.size());
}

Fixed version (ground truth):
@Override public void onLoadMore(int page,int totalItemCount){
  mClientListPresenter.loadClients(true,totalItemCount);
}
Program: 32971
Project: 32971
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  rootView=inflater.inflate(R.layout.fragment_client,container,false);
  setHasOptionsMenu(true);
  setToolbarTitle(getResources().getString(R.string.clients));
  ButterKnife.bind(this,rootView);
  mClientListPresenter.attachView(this);
  showUserInterface();
  rv_clients.addOnScrollListener(new EndlessRecyclerOnScrollListener(mLayoutManager){
    @Override public void onLoadMore(    int current_page){
      mClientListPresenter.loadClients(true,clientList.size());
    }
  }
);
  if (isParentFragment) {
    mClientListPresenter.showParentClients(clientList);
  }
 else {
    mClientListPresenter.loadClients(false,0);
  }
  mClientListPresenter.loadDatabaseClients();
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  rootView=inflater.inflate(R.layout.fragment_client,container,false);
  setHasOptionsMenu(true);
  setToolbarTitle(getResources().getString(R.string.clients));
  ButterKnife.bind(this,rootView);
  mClientListPresenter.attachView(this);
  showUserInterface();
  rv_clients.addOnScrollListener(new EndlessRecyclerViewScrollListener(mLayoutManager){
    @Override public void onLoadMore(    int page,    int totalItemCount){
      mClientListPresenter.loadClients(true,totalItemCount);
    }
  }
);
  if (isParentFragment) {
    mClientListPresenter.showParentClients(clientList);
  }
 else {
    mClientListPresenter.loadClients(false,0);
  }
  mClientListPresenter.loadDatabaseClients();
  return rootView;
}
Program: 32972
Project: 32972
Buggy source:
public void syncClientAndUpdateUI(){
  mLoanAndRepaymentSyncIndex=0;
  mSavingsAndTransactionSyncIndex=0;
  updateTotalSyncProgressBarAndCount();
  if (mClientSyncIndex != mClientList.size()) {
    updateClientName();
    syncClientAccounts(mClientList.get(mClientSyncIndex).getId());
  }
 else {
    getMvpView().showClientsSyncSuccessfully();
  }
}

Fixed version (ground truth):
public void syncClientAndUpdateUI(){
  mLoanAndRepaymentSyncIndex=0;
  mSavingsAndTransactionSyncIndex=0;
  mLoanAccountSyncStatus=false;
  updateTotalSyncProgressBarAndCount();
  if (mClientSyncIndex != mClientList.size()) {
    updateClientName();
    syncClientAccounts(mClientList.get(mClientSyncIndex).getId());
  }
 else {
    getMvpView().showClientsSyncSuccessfully();
  }
}
Program: 32973
Project: 32973
Buggy source:
@Override public void onDatePicked(String date){
  if (isdisbursementDate) {
    tvDisbursementonDate.setText(date);
    isdisbursementDate=false;
  }
  if (issubmittedDate) {
    tvSubmittedonDate.setText(date);
    issubmittedDate=false;
  }
}

Fixed version (ground truth):
@Override public void onDatePicked(String date){
  if (isdisbursementDate) {
    tvDisbursementonDate.setText(date);
    disbursementon_date=date;
    isdisbursementDate=false;
  }
  if (issubmittedDate) {
    tvSubmittedonDate.setText(date);
    submittion_date=date;
    issubmittedDate=false;
  }
}
Program: 32974
Project: 32974
Buggy source:
@Override public void onDatePicked(String date){
  if (isSubmissionDate) {
    tvSubmittedOnDate.setText(date);
    isSubmissionDate=false;
  }
  if (isDisbursebemntDate) {
    tvDisbursementOnDate.setText(date);
    isDisbursebemntDate=false;
  }
}

Fixed version (ground truth):
@Override public void onDatePicked(String date){
  if (isSubmissionDate) {
    tvSubmittedOnDate.setText(date);
    submissionDate=date;
    isSubmissionDate=false;
  }
  if (isDisbursebemntDate) {
    tvDisbursementOnDate.setText(date);
    disbursementDate=date;
    isDisbursebemntDate=false;
  }
}
Program: 32975
Project: 32975
Buggy source:
public void approveLoan(){
  LoanAccountApproval loanAccountApproval=LoanAccountApproval.newInstance(loanAccountNumber);
  FragmentTransaction fragmentTransaction=getActivity().getSupportFragmentManager().beginTransaction();
  fragmentTransaction.addToBackStack(FragmentConstants.FRAG_LOAN_ACCOUNT_SUMMARY);
  fragmentTransaction.replace(container,loanAccountApproval);
  fragmentTransaction.commit();
}

Fixed version (ground truth):
public void approveLoan(){
  LoanAccountApproval loanAccountApproval=LoanAccountApproval.newInstance(loanAccountNumber,clientLoanWithAssociations);
  FragmentTransaction fragmentTransaction=getActivity().getSupportFragmentManager().beginTransaction();
  fragmentTransaction.addToBackStack(FragmentConstants.FRAG_LOAN_ACCOUNT_SUMMARY);
  fragmentTransaction.replace(container,loanAccountApproval);
  fragmentTransaction.commit();
}
Program: 32976
Project: 32976
Buggy source:
@Override public void onDatePicked(String date){
  tvSubmissionDate.setText(date);
  setSubmissionDate();
}

Fixed version (ground truth):
@Override public void onDatePicked(String date){
  tvSubmissionDate.setText(date);
  submission_date=date;
  setSubmissionDate();
}
Program: 32977
Project: 32977
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_dashboard);
  ButterKnife.bind(this);
  replaceFragment(new ClientSearchFragment(),false,R.id.container);
  setupNavigationBar();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_dashboard);
  ButterKnife.bind(this);
  replaceFragment(new ClientSearchFragment(),false,R.id.container);
  setupNavigationBar();
  addOnBackStackChangedListener();
}
Program: 32978
Project: 32978
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.mItem_create_new_client:
    openCreateClient();
  break;
case R.id.mItem_create_new_center:
openCreateCenter();
break;
case R.id.mItem_create_new_group:
openCreateGroup();
break;
case R.id.logout:
logout();
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.mItem_create_new_client:
    setActionBarTitle(R.string.create_client);
  openCreateClient();
break;
case R.id.mItem_create_new_center:
setActionBarTitle(R.string.create_center);
openCreateCenter();
break;
case R.id.mItem_create_new_group:
openCreateGroup();
setActionBarTitle(R.string.create_group);
break;
case R.id.logout:
logout();
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}
Program: 32979
Project: 32979
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  getMenuInflater().inflate(R.menu.client_search,menu);
  return super.onCreateOptionsMenu(menu);
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  this.menu=menu;
  getMenuInflater().inflate(R.menu.menu_main,menu);
  return super.onCreateOptionsMenu(menu);
}
Program: 32980
Project: 32980
Buggy source:
@Override public void showAllSurvey(final List<Survey> surveys){
  SurveyListAdapter surveyListAdapter=new SurveyListAdapter(getActivity(),surveys);
  lv_surveys_list.setAdapter(surveyListAdapter);
  lv_surveys_list.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long l){
      mListener.loadSurveyQuestion(surveys.get(position),clientId);
    }
  }
);
}

Fixed version (ground truth):
@Override public void showAllSurvey(final List<Survey> surveys){
  if (surveys.size() == 0) {
    surveySelectText.setText(getResources().getString(R.string.no_survey_available_for_client));
  }
 else {
    SurveyListAdapter surveyListAdapter=new SurveyListAdapter(getActivity(),surveys);
    lv_surveys_list.setAdapter(surveyListAdapter);
    lv_surveys_list.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> adapterView,      View view,      int position,      long l){
        mListener.loadSurveyQuestion(surveys.get(position),clientId);
      }
    }
);
  }
}
Program: 32981
Project: 32981
Buggy source:
public OkHttpClient getMifosOkHttpClient(){
  OkHttpClient.Builder builder=new OkHttpClient.Builder();
  try {
    TrustManager[] trustAllCerts={new X509TrustManager(){
      @Override public void checkClientTrusted(      X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public void checkServerTrusted(      X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public X509Certificate[] getAcceptedIssuers(){
        return new X509Certificate[0];
      }
    }
};
    SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(null,trustAllCerts,new java.security.SecureRandom());
    SSLSocketFactory sslSocketFactory=sslContext.getSocketFactory();
    HttpLoggingInterceptor logger=new HttpLoggingInterceptor();
    logger.setLevel(Level.BODY);
    builder.sslSocketFactory(sslSocketFactory);
    builder.hostnameVerifier(new HostnameVerifier(){
      @Override public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  HttpLoggingInterceptor logger=new HttpLoggingInterceptor();
  logger.setLevel(Level.BODY);
  builder.connectTimeout(30,TimeUnit.SECONDS);
  builder.readTimeout(30,TimeUnit.SECONDS);
  builder.addInterceptor(logger);
  builder.addInterceptor(new MifosInterceptor());
  builder.addNetworkInterceptor(new StethoInterceptor());
  return builder.build();
}

Fixed version (ground truth):
public OkHttpClient getMifosOkHttpClient(){
  OkHttpClient.Builder builder=new OkHttpClient.Builder();
  try {
    TrustManager[] trustAllCerts={new X509TrustManager(){
      @Override public void checkClientTrusted(      X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public void checkServerTrusted(      X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public X509Certificate[] getAcceptedIssuers(){
        return new X509Certificate[0];
      }
    }
};
    SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(null,trustAllCerts,new java.security.SecureRandom());
    SSLSocketFactory sslSocketFactory=sslContext.getSocketFactory();
    HttpLoggingInterceptor logger=new HttpLoggingInterceptor();
    logger.setLevel(Level.BODY);
    builder.sslSocketFactory(sslSocketFactory);
    builder.hostnameVerifier(new HostnameVerifier(){
      @Override public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  HttpLoggingInterceptor logger=new HttpLoggingInterceptor();
  logger.setLevel(Level.BODY);
  builder.connectTimeout(60,TimeUnit.SECONDS);
  builder.readTimeout(60,TimeUnit.SECONDS);
  builder.addInterceptor(logger);
  builder.addInterceptor(new MifosInterceptor());
  builder.addNetworkInterceptor(new StethoInterceptor());
  return builder.build();
}
Program: 32982
Project: 32982
Buggy source:
/** 
 * Sync the Client Account with Client Id. This method fetching the Client Accounts from the REST API using retrofit 2 and saving these accounts to Database with DatabaseHelperClient and then DataManagerClient gives the returns the Clients Accounts to Presenter. <p> <p> onNext : As Client Accounts Successfully sync then now sync the there Loan and LoanRepayment onError :
 * @param clientId Client Id
 */
public void syncClientAccounts(int clientId){
  checkViewAttached();
  mSubscriptions.add(mDataManagerClient.syncClientAccounts(clientId).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Subscriber<ClientAccounts>(){
    @Override public void onCompleted(){
    }
    @Override public void onError(    Throwable e){
      getMvpView().showError(R.string.failed_to_sync_clientaccounts);
      mFailedSyncClient.add(mClientList.get(mClientSyncIndex));
      getMvpView().showSyncedFailedClients(mFailedSyncClient.size());
      mClientSyncIndex=mClientSyncIndex + 1;
      checkNetworkConnectionAndSyncClient();
    }
    @Override public void onNext(    ClientAccounts clientAccounts){
      mLoanAccountList=getActiveLoanAccounts(clientAccounts.getLoanAccounts());
      mSavingsAccountList=getActiveSavingsAccounts(clientAccounts.getSavingsAccounts());
      getMvpView().setMaxSingleSyncClientProgressBar(mLoanAccountList.size() + mSavingsAccountList.size());
      checkAccountsSyncStatusAndSyncAccounts();
    }
  }
));
}

Fixed version (ground truth):
/** 
 * Sync the Client Account with Client Id. This method fetching the Client Accounts from the REST API using retrofit 2 and saving these accounts to Database with DatabaseHelperClient and then DataManagerClient gives the returns the Clients Accounts to Presenter. <p/> <p/> onNext : As Client Accounts Successfully sync then now sync the there Loan and LoanRepayment onError :
 * @param clientId Client Id
 */
public void syncClientAccounts(int clientId){
  checkViewAttached();
  mSubscriptions.add(mDataManagerClient.syncClientAccounts(clientId).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Subscriber<ClientAccounts>(){
    @Override public void onCompleted(){
    }
    @Override public void onError(    Throwable e){
      getMvpView().showError(R.string.failed_to_sync_clientaccounts);
      mFailedSyncClient.add(mClientList.get(mClientSyncIndex));
      getMvpView().showSyncedFailedClients(mFailedSyncClient.size());
      mClientSyncIndex=mClientSyncIndex + 1;
      checkNetworkConnectionAndSyncClient();
    }
    @Override public void onNext(    ClientAccounts clientAccounts){
      mLoanAccountList=getActiveLoanAccounts(clientAccounts.getLoanAccounts());
      mSavingsAccountList=getActiveSavingsAccounts(clientAccounts.getSavingsAccounts());
      getMvpView().setMaxSingleSyncClientProgressBar(mLoanAccountList.size() + mSavingsAccountList.size());
      checkAccountsSyncStatusAndSyncAccounts();
    }
  }
));
}
Program: 32983
Project: 32983
Buggy source:
public void onAccountSyncFailed(){
  int singleSyncClientMax=getMvpView().getMaxSingleSyncClientProgressBar();
  getMvpView().updateSingleSyncClientProgressBar(singleSyncClientMax);
  mClientSyncIndex=mClientSyncIndex + 1;
  mFailedSyncClient.add(mClientList.get(mClientSyncIndex));
  getMvpView().showSyncedFailedClients(mFailedSyncClient.size());
  checkNetworkConnectionAndSyncClient();
}

Fixed version (ground truth):
public void onAccountSyncFailed(Throwable e){
  try {
    if (e instanceof HttpException) {
      int singleSyncClientMax=getMvpView().getMaxSingleSyncClientProgressBar();
      getMvpView().updateSingleSyncClientProgressBar(singleSyncClientMax);
      mFailedSyncClient.add(mClientList.get(mClientSyncIndex));
      mClientSyncIndex=mClientSyncIndex + 1;
      getMvpView().showSyncedFailedClients(mFailedSyncClient.size());
      checkNetworkConnectionAndSyncClient();
    }
  }
 catch (  Throwable throwable) {
    RxJavaPlugins.getInstance().getErrorHandler().handleError(throwable);
  }
}
Program: 32985
Project: 32985
Buggy source:
public List<SavingsAccount> getActiveSavingsAccounts(List<SavingsAccount> savingsAccounts){
  final List<SavingsAccount> accounts=new ArrayList<>();
  Observable.from(savingsAccounts).filter(new Func1<SavingsAccount,Boolean>(){
    @Override public Boolean call(    SavingsAccount savingsAccount){
      return savingsAccount.getStatus().getActive();
    }
  }
).subscribe(new Action1<SavingsAccount>(){
    @Override public void call(    SavingsAccount savingsAccount){
      accounts.add(savingsAccount);
    }
  }
);
  return accounts;
}

Fixed version (ground truth):
public List<SavingsAccount> getActiveSavingsAccounts(List<SavingsAccount> savingsAccounts){
  final List<SavingsAccount> accounts=new ArrayList<>();
  Observable.from(savingsAccounts).filter(new Func1<SavingsAccount,Boolean>(){
    @Override public Boolean call(    SavingsAccount savingsAccount){
      return (savingsAccount.getStatus().getActive() && !savingsAccount.isRecurring());
    }
  }
).subscribe(new Action1<SavingsAccount>(){
    @Override public void call(    SavingsAccount savingsAccount){
      accounts.add(savingsAccount);
    }
  }
);
  return accounts;
}
Program: 32987
Project: 32987
Buggy source:
public Integer getFeeChargesCharged(){
  return feeChargesCharged;
}

Fixed version (ground truth):
public Double getFeeChargesCharged(){
  return feeChargesCharged;
}
Program: 32988
Project: 32988
Buggy source:
public void setInterestWaived(Integer interestWaived){
  this.interestWaived=interestWaived;
}

Fixed version (ground truth):
public void setInterestWaived(Double interestWaived){
  this.interestWaived=interestWaived;
}
Program: 32989
Project: 32989
Buggy source:
public Integer getFeeChargesOverdue(){
  return feeChargesOverdue;
}

Fixed version (ground truth):
public Double getFeeChargesOverdue(){
  return feeChargesOverdue;
}
Program: 32990
Project: 32990
Buggy source:
public Integer getFeeChargesWaived(){
  return feeChargesWaived;
}

Fixed version (ground truth):
public Double getFeeChargesWaived(){
  return feeChargesWaived;
}
Program: 32991
Project: 32991
Buggy source:
public void setFeeChargesOverdue(Integer feeChargesOverdue){
  this.feeChargesOverdue=feeChargesOverdue;
}

Fixed version (ground truth):
public void setFeeChargesOverdue(Double feeChargesOverdue){
  this.feeChargesOverdue=feeChargesOverdue;
}
Program: 32992
Project: 32992
Buggy source:
public Integer getFeeChargesPaid(){
  return feeChargesPaid;
}

Fixed version (ground truth):
public Double getFeeChargesPaid(){
  return feeChargesPaid;
}
Program: 32993
Project: 32993
Buggy source:
public void setFeeChargesCharged(Integer feeChargesCharged){
  this.feeChargesCharged=feeChargesCharged;
}

Fixed version (ground truth):
public void setFeeChargesCharged(Double feeChargesCharged){
  this.feeChargesCharged=feeChargesCharged;
}
Program: 32994
Project: 32994
Buggy source:
public void setFeeChargesWaived(Integer feeChargesWaived){
  this.feeChargesWaived=feeChargesWaived;
}

Fixed version (ground truth):
public void setFeeChargesWaived(Double feeChargesWaived){
  this.feeChargesWaived=feeChargesWaived;
}
Program: 32995
Project: 32995
Buggy source:
public Integer getTotalWaived(){
  return totalWaived;
}

Fixed version (ground truth):
public Double getTotalWaived(){
  return totalWaived;
}
Program: 32996
Project: 32996
Buggy source:
public void setFeeChargesPaid(Integer feeChargesPaid){
  this.feeChargesPaid=feeChargesPaid;
}

Fixed version (ground truth):
public void setFeeChargesPaid(Double feeChargesPaid){
  this.feeChargesPaid=feeChargesPaid;
}
Program: 32997
Project: 32997
Buggy source:
public void setTotalWaived(Integer totalWaived){
  this.totalWaived=totalWaived;
}

Fixed version (ground truth):
public void setTotalWaived(Double totalWaived){
  this.totalWaived=totalWaived;
}
Program: 32998
Project: 32998
Buggy source:
public Integer getInterestWaived(){
  return interestWaived;
}

Fixed version (ground truth):
public Double getInterestWaived(){
  return interestWaived;
}
Program: 33000
Project: 33000
Buggy source:
private boolean getData(){
  boolean isAllDetailsFilled=true;
  if (etStaffId.getText().toString().length() > 0 && tvSelectDate.getText().toString().length() > 0 && etBranchId.getText().toString().length() > 0) {
    staffId=Integer.parseInt(etStaffId.getEditableText().toString());
    date=tvSelectDate.getText().toString();
    branchId=Integer.parseInt(etBranchId.getEditableText().toString());
  }
 else {
    isAllDetailsFilled=false;
    Toaster.show(findViewById(android.R.id.content),"String_Node_Str");
  }
  return isAllDetailsFilled;
}

Fixed version (ground truth):
private boolean getData(){
  boolean isAllDetailsFilled=true;
  if (etStaffId.getText().toString().length() > 0 && tvSelectDate.getText().toString().length() > 0 && etBranchId.getText().toString().length() > 0) {
    date=tvSelectDate.getText().toString();
    isAllDetailsFilled=hasValidStaffAndBranchId();
  }
 else {
    isAllDetailsFilled=false;
    Toaster.show(findViewById(android.R.id.content),"String_Node_Str");
  }
  return isAllDetailsFilled;
}
Program: 33002
Project: 33002
Buggy source:
@Override protected Void doInBackground(Integer... integers){
  Log.d(TAG,"String_Node_Str");
  SharedPreferences pref=PreferenceManager.getDefaultSharedPreferences(Constants.applicationContext);
  String authToken=pref.getString(User.AUTHENTICATION_KEY,"String_Node_Str");
  String mInstanceUrl=pref.getString(Constants.INSTANCE_URL_KEY,getString(R.string.default_instance_url));
  String url=Constants.PROTOCOL_HTTPS + mInstanceUrl + Constants.API_PATH+ "String_Node_Str"+ "String_Node_Str"+ integers[0]+ "String_Node_Str";
  try {
    HttpURLConnection httpURLConnection=(HttpURLConnection)(new URL(url)).openConnection();
    httpURLConnection.setRequestMethod("String_Node_Str");
    httpURLConnection.setRequestProperty("String_Node_Str","String_Node_Str");
    httpURLConnection.setRequestProperty(((MifosApplication)getActivity().getApplication()).api.HEADER_AUTHORIZATION,authToken);
    httpURLConnection.setRequestProperty("String_Node_Str","String_Node_Str");
    httpURLConnection.setDoInput(true);
    httpURLConnection.connect();
    Log.i("String_Node_Str","String_Node_Str");
    InputStream inputStream=httpURLConnection.getInputStream();
    bmp=BitmapFactory.decodeStream(inputStream);
    httpURLConnection.disconnect();
    Log.i("String_Node_Str","String_Node_Str");
  }
 catch (  MalformedURLException e) {
  }
catch (  IOException ioe) {
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Integer... integers){
  Log.d(TAG,"String_Node_Str");
  SharedPreferences pref=PreferenceManager.getDefaultSharedPreferences(Constants.applicationContext);
  String authToken=pref.getString(User.AUTHENTICATION_KEY,"String_Node_Str");
  String mInstanceUrl=pref.getString(Constants.INSTANCE_URL_KEY,getString(R.string.default_instance_url));
  String url=mInstanceUrl + "String_Node_Str" + "String_Node_Str"+ integers[0]+ "String_Node_Str";
  try {
    HttpURLConnection httpURLConnection=(HttpURLConnection)(new URL(url)).openConnection();
    httpURLConnection.setRequestMethod("String_Node_Str");
    httpURLConnection.setRequestProperty("String_Node_Str","String_Node_Str");
    httpURLConnection.setRequestProperty(((MifosApplication)getActivity().getApplication()).api.HEADER_AUTHORIZATION,authToken);
    httpURLConnection.setRequestProperty("String_Node_Str","String_Node_Str");
    httpURLConnection.setDoInput(true);
    httpURLConnection.connect();
    Log.i("String_Node_Str","String_Node_Str");
    InputStream inputStream=httpURLConnection.getInputStream();
    bmp=BitmapFactory.decodeStream(inputStream);
    httpURLConnection.disconnect();
    Log.i("String_Node_Str","String_Node_Str");
  }
 catch (  MalformedURLException e) {
  }
catch (  IOException ioe) {
  }
  return null;
}
Program: 33003
Project: 33003
Buggy source:
private void updateMyInstanceUrl(){
  String textUnderConstruction;
  if (!et_port.getEditableText().toString().isEmpty()) {
    port=Integer.valueOf(et_port.getEditableText().toString().trim());
    textUnderConstruction=constructInstanceUrl(et_instanceURL.getEditableText().toString(),port);
  }
 else {
    textUnderConstruction=constructInstanceUrl(et_instanceURL.getEditableText().toString(),null);
  }
  tv_constructed_instance_url.setText(textUnderConstruction);
  if (!validateURL(textUnderConstruction)) {
    tv_constructed_instance_url.setTextColor(getResources().getColor(R.color.red));
  }
 else {
    tv_constructed_instance_url.setTextColor(getResources().getColor(R.color.deposit_green));
  }
}

Fixed version (ground truth):
private void updateMyInstanceUrl(){
  String textUnderConstruction;
  if (!et_port.getEditableText().toString().isEmpty()) {
    port=Integer.valueOf(et_port.getEditableText().toString().trim());
    textUnderConstruction=constructInstanceUrl(et_instanceURL.getEditableText().toString(),port);
  }
 else {
    port=null;
    textUnderConstruction=constructInstanceUrl(et_instanceURL.getEditableText().toString(),null);
  }
  tv_constructed_instance_url.setText(textUnderConstruction);
  if (!validateURL(textUnderConstruction)) {
    tv_constructed_instance_url.setTextColor(getResources().getColor(R.color.red));
  }
 else {
    tv_constructed_instance_url.setTextColor(getResources().getColor(R.color.deposit_green));
  }
}
Program: 33004
Project: 33004
Buggy source:
/** 
 * Stores the domain name in shared preferences if the login was successful, so that it can be referenced later or with multiple login/logouts user doesn't need to type in the domain name over and over again.
 * @param instanceURL
 */
public void saveLastAccessedInstanceDomainName(String instanceURL){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(Constants.INSTANCE_URL_KEY,instanceURL);
  editor.commit();
  editor.apply();
}

Fixed version (ground truth):
/** 
 * Stores the domain name in shared preferences if the login was successful, so that it can be referenced later or with multiple login/logouts user doesn't need to type in the domain name over and over again.
 * @param instanceDomain
 */
public void saveLastAccessedInstanceDomainName(String instanceDomain){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(Constants.INSTANCE_DOMAIN_KEY,instanceDomain);
  editor.apply();
}
Program: 33005
Project: 33005
Buggy source:
/** 
 * Stores the port in shared preferences if the login was successful, so that it can be referenced later or with multiple login/logouts user doesn't need to type in the domain name over and over again.
 * @param instancePort
 */
public void saveLastAccessedInstancePort(String instancePort){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(Constants.INSTANCE_PORT_KEY,instancePort);
  editor.commit();
  editor.apply();
}

Fixed version (ground truth):
/** 
 * Stores the port in shared preferences if the login was successful, so that it can be referenced later or with multiple login/logouts user doesn't need to type in the instance port over and over again.
 * @param instancePort
 */
public void saveLastAccessedInstancePort(String instancePort){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(Constants.INSTANCE_PORT_KEY,instancePort);
  editor.apply();
}
Program: 33006
Project: 33006
Buggy source:
@Override public void success(User user,Response response){
  ((MifosApplication)getApplication()).api=api;
  progressDialog.dismiss();
  Toast.makeText(context,getString(R.string.toast_welcome) + "String_Node_Str" + user.getUsername(),Toast.LENGTH_SHORT).show();
  saveLastAccessedInstanceDomainName(et_instanceURL.getEditableText().toString());
  if (!et_port.getEditableText().toString().trim().isEmpty()) {
    saveLastAccessedInstancePort(et_port.getEditableText().toString());
  }
  saveAuthenticationKey("String_Node_Str" + user.getBase64EncodedAuthenticationKey());
  Intent intent=new Intent(LoginActivity.this,DashboardFragmentActivity.class);
  startActivity(intent);
  finish();
}

Fixed version (ground truth):
@Override public void success(User user,Response response){
  ((MifosApplication)getApplication()).api=api;
  progressDialog.dismiss();
  Toast.makeText(context,getString(R.string.toast_welcome) + "String_Node_Str" + user.getUsername(),Toast.LENGTH_SHORT).show();
  saveLastAccessedInstanceUrl(instanceURL);
  saveLastAccessedInstanceDomainName(et_instanceURL.getEditableText().toString());
  if (!et_port.getEditableText().toString().trim().isEmpty()) {
    saveLastAccessedInstancePort(et_port.getEditableText().toString());
  }
  String lastAccessedTenantIdentifier=et_tenantIdentifier.getEditableText().toString().trim().isEmpty() || et_tenantIdentifier.getEditableText() == null ? "String_Node_Str" : et_tenantIdentifier.getEditableText().toString().trim();
  saveLastAccessedTenant(lastAccessedTenantIdentifier);
  saveAuthenticationKey("String_Node_Str" + user.getBase64EncodedAuthenticationKey());
  Intent intent=new Intent(LoginActivity.this,DashboardFragmentActivity.class);
  startActivity(intent);
  finish();
}
Program: 33007
Project: 33007
Buggy source:
/** 
 * After the user is authenticated the Base64 encoded auth token is saved in Shared Preferences so that user can be logged in when returning to the app even if the app is terminated from the background.
 * @param authenticationKey
 */
public void saveAuthenticationKey(String authenticationKey){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(User.AUTHENTICATION_KEY,authenticationKey);
  editor.commit();
  editor.apply();
}

Fixed version (ground truth):
/** 
 * After the user is authenticated the Base64 encoded auth token is saved in Shared Preferences so that user can be logged in when returning to the app even if the app is terminated from the background.
 * @param authenticationKey
 */
public void saveAuthenticationKey(String authenticationKey){
  SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putString(User.AUTHENTICATION_KEY,authenticationKey);
  editor.apply();
}
Program: 33008
Project: 33008
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_splash);
  getSupportActionBar().hide();
  Crashlytics.start(this);
  if (savedInstanceState == null) {
    getSupportFragmentManager().beginTransaction().add(R.id.container,new PlaceholderFragment()).commit();
  }
  context=SplashScreenActivity.this.getApplicationContext();
  Constants.applicationContext=getApplicationContext();
  sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  authenticationToken=sharedPreferences.getString(User.AUTHENTICATION_KEY,"String_Node_Str");
  if (authenticationToken.equals("String_Node_Str")) {
    startActivity(new Intent(SplashScreenActivity.this,LoginActivity.class));
  }
 else {
    startActivity(new Intent(SplashScreenActivity.this,DashboardFragmentActivity.class));
  }
  finish();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_splash);
  getSupportActionBar().hide();
  Crashlytics.start(this);
  if (savedInstanceState == null) {
    getSupportFragmentManager().beginTransaction().add(R.id.container,new PlaceholderFragment()).commit();
  }
  context=SplashScreenActivity.this.getApplicationContext();
  Constants.applicationContext=getApplicationContext();
  sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  authenticationToken=sharedPreferences.getString(User.AUTHENTICATION_KEY,"String_Node_Str");
  if (authenticationToken.equals("String_Node_Str")) {
    startActivity(new Intent(SplashScreenActivity.this,LoginActivity.class));
  }
 else {
    SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
    String instanceURL=sharedPreferences.getString(Constants.INSTANCE_URL_KEY,null);
    String tenantIdentifier=sharedPreferences.getString(Constants.TENANT_IDENTIFIER_KEY,null);
    ((MifosApplication)getApplication()).api=new API(instanceURL,tenantIdentifier,false);
    startActivity(new Intent(SplashScreenActivity.this,DashboardFragmentActivity.class));
  }
  finish();
}
Program: 33009
Project: 33009
Buggy source:
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  inflater.inflate(R.menu.menu_sync,menu);
  syncItem=menu.findItem(R.id.action_sync);
  if (centerId != -1) {
    List<MeetingCenter> center=Select.from(MeetingCenter.class).where(Condition.prop("String_Node_Str").eq(centerId)).list();
    if (center.get(0).getIsSynced() == 1)     syncItem.setEnabled(false);
  }
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  inflater.inflate(R.menu.menu_sync,menu);
  syncItem=menu.findItem(R.id.action_sync);
  if (centerId != -1) {
    List<MeetingCenter> center=new ArrayList<MeetingCenter>();
    center.addAll(Select.from(MeetingCenter.class).where(Condition.prop("String_Node_Str").eq(centerId)).list());
    if (center.size() > 0 && center.get(0).getIsSynced() == 1)     syncItem.setEnabled(false);
  }
}
Program: 33010
Project: 33010
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getItemId() == R.id.action_sync) {
    LayoutInflater inflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View syncProgress=inflater.inflate(R.layout.sync_progress,null);
    MenuItemCompat.setActionView(item,syncProgress);
    if (centerId != -1) {
      RepaymentTransactionSyncService syncService=new RepaymentTransactionSyncService(this,centerId);
      syncService.syncRepayments();
    }
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getItemId() == R.id.action_sync) {
    LayoutInflater inflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View syncProgress=inflater.inflate(R.layout.sync_progress,null);
    MenuItemCompat.setActionView(item,syncProgress);
    if (centerId != -1) {
      RepaymentTransactionSyncService syncService=new RepaymentTransactionSyncService(this,centerId);
      syncService.syncRepayments(getActivity());
    }
  }
  return super.onOptionsItemSelected(item);
}
Program: 33011
Project: 33011
Buggy source:
public void syncRepayments(){
  List<RepaymentTransaction> transactions=Select.from(RepaymentTransaction.class).list();
  Log.i(TAG,"String_Node_Str" + transactions);
  List<MeetingCenter> centerList=Select.from(MeetingCenter.class).where(com.orm.query.Condition.prop("String_Node_Str").eq(centerId)).list();
  MeetingCenter center=centerList.get(0);
  if (transactions.size() > 0) {
    List<BulkRepaymentTransactions> repaymentTransactions=new ArrayList<BulkRepaymentTransactions>();
    for (    RepaymentTransaction transaction : transactions) {
      Loan loan=transaction.getLoan();
      if (loan.getAccountStatusId() == 300) {
        repaymentTransactions.add(new BulkRepaymentTransactions(loan.getLoanId(),transaction.getTransactionAmount()));
      }
    }
    BulkRepaymentTransactions[] repaymentTransactionArray=new BulkRepaymentTransactions[repaymentTransactions.size()];
    repaymentTransactions.toArray(repaymentTransactionArray);
    CollectionSheetPayload payload=new CollectionSheetPayload();
    payload.bulkRepaymentTransactions=repaymentTransactionArray;
    payload.setCalendarId(center.getCollectionMeetingCalendar().getCalendarId());
    payload.setTransactionDate(DateHelper.getPayloadDate());
    SaveCollectionSheetTask task=new SaveCollectionSheetTask();
    task.execute(payload);
  }
 else   syncFinishListener.onSyncFinish("String_Node_Str",false);
}

Fixed version (ground truth):
public void syncRepayments(Context context){
  List<RepaymentTransaction> transactions=Select.from(RepaymentTransaction.class).list();
  Log.i(TAG,"String_Node_Str" + transactions);
  List<MeetingCenter> centerList=Select.from(MeetingCenter.class).where(com.orm.query.Condition.prop("String_Node_Str").eq(centerId)).list();
  MeetingCenter center=centerList.get(0);
  if (transactions.size() > 0) {
    List<BulkRepaymentTransactions> repaymentTransactions=new ArrayList<BulkRepaymentTransactions>();
    for (    RepaymentTransaction transaction : transactions) {
      Loan loan=transaction.getLoan();
      if (loan.getAccountStatusId() == 300) {
        repaymentTransactions.add(new BulkRepaymentTransactions(loan.getLoanId(),transaction.getTransactionAmount()));
      }
    }
    BulkRepaymentTransactions[] repaymentTransactionArray=new BulkRepaymentTransactions[repaymentTransactions.size()];
    repaymentTransactions.toArray(repaymentTransactionArray);
    CollectionSheetPayload payload=new CollectionSheetPayload();
    payload.bulkRepaymentTransactions=repaymentTransactionArray;
    payload.setCalendarId(center.getCollectionMeetingCalendar().getCalendarId());
    payload.setTransactionDate(DateHelper.getPayloadDate(context));
    SaveCollectionSheetTask task=new SaveCollectionSheetTask();
    task.execute(payload);
  }
 else   syncFinishListener.onSyncFinish("String_Node_Str",false);
}
Program: 33012
Project: 33012
Buggy source:
private Payload getPayload(Context context,MeetingCenter center){
  final Payload payload=new Payload();
  payload.setTransactionDate(DateHelper.getPayloadDate());
  payload.setCalendarId(center.getCollectionMeetingCalendar().getCalendarInstanceId());
  return payload;
}

Fixed version (ground truth):
private Payload getPayload(Context context,MeetingCenter center){
  final Payload payload=new Payload();
  payload.setTransactionDate(DateHelper.getPayloadDate(context));
  payload.setCalendarId(center.getCollectionMeetingCalendar().getCalendarInstanceId());
  return payload;
}
Program: 33013
Project: 33013
Buggy source:
@Override public void loadClientsOfGroup(List<Client> clientList){
  ClientListFragment clientListFragment=ClientListFragment.newInstance(clientList);
  FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
  fragmentTransaction.addToBackStack(FragmentConstants.FRAG_GROUP_LIST);
  fragmentTransaction.replace(R.id.center_container,clientListFragment);
  fragmentTransaction.commitAllowingStateLoss();
}

Fixed version (ground truth):
@Override public void loadClientsOfGroup(List<Client> clientList){
  ClientListFragment clientListFragment=ClientListFragment.newInstance(clientList,true);
  FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
  fragmentTransaction.addToBackStack(FragmentConstants.FRAG_GROUP_LIST);
  fragmentTransaction.replace(R.id.center_container,clientListFragment);
  fragmentTransaction.commitAllowingStateLoss();
}
Program: 33015
Project: 33015
Buggy source:
public static ClientListFragment newInstance(List<Client> clientList){
  ClientListFragment clientListFragment=new ClientListFragment();
  clientListFragment.setClientList(clientList);
  return clientListFragment;
}

Fixed version (ground truth):
public static ClientListFragment newInstance(List<Client> clientList,boolean isParentFragmentAGroupFragment){
  ClientListFragment clientListFragment=new ClientListFragment();
  clientListFragment.setClientList(clientList);
  if (isParentFragmentAGroupFragment) {
    clientListFragment.setInfiniteScrollEnabled(false);
  }
  return clientListFragment;
}
Program: 33016
Project: 33016
Buggy source:
@Override public void success(Page<Client> page,Response response){
  clientList=page.getPageItems();
  inflateClientList();
  swipeRefreshLayout.setRefreshing(false);
}

Fixed version (ground truth):
@Override public void success(Page<Client> clientPage,Response response){
  clientList.addAll(clientPage.getPageItems());
  clientNameListAdapter.notifyDataSetChanged();
  index=lv_clients.getFirstVisiblePosition();
  View v=lv_clients.getChildAt(0);
  top=(v == null) ? 0 : v.getTop();
  lv_clients.setSelectionFromTop(index,top);
  swipeRefreshLayout.setRefreshing(false);
}
Program: 33017
Project: 33017
Buggy source:
@Override public boolean onTouch(View v,MotionEvent event){
  final MFDatePicker mfDatePicker=new MFDatePicker();
  mfDatePicker.setOnDatePickListener(new MFDatePicker.OnDatePickListener(){
    @Override public void onDatePicked(    String date){
      setValue(date);
      mfDatePicker.dismiss();
    }
  }
);
  mfDatePicker.show(fragmentManager,MFDatePicker.TAG);
  return true;
}

Fixed version (ground truth):
@Override public boolean onTouch(View v,MotionEvent event){
  if (MotionEvent.ACTION_UP == event.getAction()) {
    final MFDatePicker mfDatePicker=new MFDatePicker();
    mfDatePicker.setOnDatePickListener(new MFDatePicker.OnDatePickListener(){
      @Override public void onDatePicked(      String date){
        setValue(date);
        mfDatePicker.dismiss();
      }
    }
);
    mfDatePicker.show(fragmentManager,MFDatePicker.TAG);
  }
  return true;
}
Program: 33018
Project: 33018
Buggy source:
public void setIsDateField(Boolean isDateField,final FragmentManager fragmentManager){
  this.isDateField=isDateField;
  if (isDateField()) {
    input.setOnTouchListener(new View.OnTouchListener(){
      @Override public boolean onTouch(      View v,      MotionEvent event){
        final MFDatePicker mfDatePicker=new MFDatePicker();
        mfDatePicker.setOnDatePickListener(new MFDatePicker.OnDatePickListener(){
          @Override public void onDatePicked(          String date){
            setValue(date);
            mfDatePicker.dismiss();
          }
        }
);
        mfDatePicker.show(fragmentManager,MFDatePicker.TAG);
        return true;
      }
    }
);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void setIsDateField(Boolean isDateField,final FragmentManager fragmentManager){
  this.isDateField=isDateField;
  if (isDateField()) {
    input.setOnTouchListener(new View.OnTouchListener(){
      @Override public boolean onTouch(      View v,      MotionEvent event){
        if (MotionEvent.ACTION_UP == event.getAction()) {
          final MFDatePicker mfDatePicker=new MFDatePicker();
          mfDatePicker.setOnDatePickListener(new MFDatePicker.OnDatePickListener(){
            @Override public void onDatePicked(            String date){
              setValue(date);
              mfDatePicker.dismiss();
            }
          }
);
          mfDatePicker.show(fragmentManager,MFDatePicker.TAG);
        }
        return true;
      }
    }
);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 33019
Project: 33019
Buggy source:
@Override public void afterTextChanged(Editable s){
  CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),Double.parseDouble(s.toString()));
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  try {
    CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),s.toString().equals("String_Node_Str") ? 0.00 : Double.parseDouble(s.toString()));
  }
 catch (  NumberFormatException e) {
    CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),0.00);
  }
}
Program: 33020
Project: 33020
Buggy source:
@Override public View getView(final int position,View convertView,ViewGroup parent){
  final ReusableViewHolder reusableViewHolder;
  if (convertView == null) {
    convertView=layoutInflater.inflate(R.layout.row_collection_sheet_loan,null);
    reusableViewHolder=new ReusableViewHolder(convertView);
    convertView.setTag(reusableViewHolder);
  }
 else {
    reusableViewHolder=(ReusableViewHolder)convertView.getTag();
  }
  Double transactionAmount=CollectionListAdapter.sRepaymentTransactions.get(loans.get(position).getLoanId());
  reusableViewHolder.tv_amountDue.setText(String.valueOf(loans.get(position).getTotalDue()));
  reusableViewHolder.tv_loanShortName.setText(loans.get(position).getProductShortName());
  reusableViewHolder.et_amountPaid.setText(String.valueOf(transactionAmount));
  reusableViewHolder.et_amountPaid.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),Double.parseDouble(s.toString()));
    }
  }
);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(final int position,View convertView,ViewGroup parent){
  final ReusableViewHolder reusableViewHolder;
  if (convertView == null) {
    convertView=layoutInflater.inflate(R.layout.row_collection_sheet_loan,null);
    reusableViewHolder=new ReusableViewHolder(convertView);
    convertView.setTag(reusableViewHolder);
  }
 else {
    reusableViewHolder=(ReusableViewHolder)convertView.getTag();
  }
  Double transactionAmount=CollectionListAdapter.sRepaymentTransactions.get(loans.get(position).getLoanId());
  reusableViewHolder.tv_amountDue.setText(String.valueOf(loans.get(position).getTotalDue()));
  reusableViewHolder.tv_loanShortName.setText(loans.get(position).getProductShortName());
  reusableViewHolder.et_amountPaid.setText(String.valueOf(transactionAmount));
  reusableViewHolder.et_amountPaid.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      try {
        CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),s.toString().equals("String_Node_Str") ? 0.00 : Double.parseDouble(s.toString()));
      }
 catch (      NumberFormatException e) {
        CollectionListAdapter.sRepaymentTransactions.put(loans.get(position).getLoanId(),0.00);
      }
    }
  }
);
  return convertView;
}