Program: 33014
Project: 33014
Buggy source:
public void inflateClientList(){
  final ClientNameListAdapter clientNameListAdapter=new ClientNameListAdapter(context,clientList);
  lv_clients.setAdapter(clientNameListAdapter);
  lv_clients.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      Intent clientActivityIntent=new Intent(getActivity(),ClientActivity.class);
      clientActivityIntent.putExtra(Constants.CLIENT_ID,clientList.get(i).getId());
      startActivity(clientActivityIntent);
    }
  }
);
  lv_clients.setOnScrollListener(new AbsListView.OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView absListView,    int i){
    }
    @Override public void onScroll(    AbsListView absListView,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      if (firstVisibleItem + visibleItemCount >= totalItemCount) {
        offset+=limit + 1;
        swipeRefreshLayout.setRefreshing(true);
        API.clientService.listAllClients(offset,limit,new Callback<Page<Client>>(){
          @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);
          }
          @Override public void failure(          RetrofitError retrofitError){
            swipeRefreshLayout.setRefreshing(false);
            if (getActivity() != null) {
              try {
                Log.i("String_Node_Str","String_Node_Str" + retrofitError.getResponse().getStatus());
                if (retrofitError.getResponse().getStatus() == HttpStatus.SC_UNAUTHORIZED) {
                  Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
                  startActivity(new Intent(getActivity(),LogoutActivity.class));
                  getActivity().finish();
                }
 else {
                  Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
                }
              }
 catch (              NullPointerException npe) {
                Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
              }
            }
          }
        }
);
      }
    }
  }
);
}

Fixed version (ground truth):
public void inflateClientList(){
  final ClientNameListAdapter clientNameListAdapter=new ClientNameListAdapter(context,clientList);
  lv_clients.setAdapter(clientNameListAdapter);
  lv_clients.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      Intent clientActivityIntent=new Intent(getActivity(),ClientActivity.class);
      clientActivityIntent.putExtra(Constants.CLIENT_ID,clientList.get(i).getId());
      startActivity(clientActivityIntent);
    }
  }
);
  if (isInfiniteScrollEnabled) {
    setInfiniteScrollListener(clientNameListAdapter);
  }
}