Buggy code:
public class NewsLoader implements Response . ErrorListener , Response . Listener < String > { public static final String TAG = NewsLoader . class . getSimpleName ( ) ; public static final int INTERNET_CONNECTION_ERROR = 1 ; private int mPageIndex = 0 ; private int mUpdatePageIndex = 0 ; private Context mContext ; private String mBoardUrl ; private ArrayList < BoardNews > mData ; private String mErrorMessage ; private int mErrorCode ; private boolean mIsDataLoadCorrectly ; private boolean mIsRecursive = true ; private boolean mIsUpdateLoopBreak = false ; private NewsRecordAdapter mAdapter ; private Handler mHandler ; private NewsLoader . RequestType mRequestType ; private boolean mIsNextPageNeeded ; public NewsLoader ( String dataUrl , Context context ) { } @ Override public void onResponse ( String response ) { } @ Override public void onErrorResponse ( VolleyError error ) { } public boolean fetchFromDB ( int offsetPages , boolean isNextPageNeeded ) { } public boolean fetchFromDB ( ) { } public boolean fetchFromInternet ( int startpage , boolean isNextPageNeeded ) throws InterruptedException , ExecutionException { StringRequest stringRequest ; for ( int i = startpage ; i < ( ( mPageIndex ) + 1 ) ; i ++ ) { RequestFuture < String > future = RequestFuture . newFuture ( ) ; <START_BUG> stringRequest = new StringRequest ( Method . GET , ( ( mBoardUrl ) + i ) , future , future ) ; <END_BUG> BoardNewsApplication . getInstance ( ) . getRequestQueue ( ) . add ( stringRequest ) ; String response = null ; try { response = future . get ( 20 , TimeUnit . SECONDS ) ; } catch ( TimeoutException e ) { e . printStackTrace ( ) ; } if ( ( response == null ) && ( mIsRecursive ) ) { mIsRecursive = false ; fetchFromInternet ( startpage , isNextPageNeeded ) ; } else { mData = parse ( response ) ; syncDB ( ) ; mIsDataLoadCorrectly = true ; } } if ( ( mIsDataLoadCorrectly ) && ( isNextPageNeeded || ( ( mPageIndex ) == 1 ) ) ) { ( mPageIndex ) ++ ; } return mIsDataLoadCorrectly ; } public boolean syncDB ( ) { } public void registerRequestForUpdateAllDB ( ) { } private void updateAllDB ( String response ) { } public void registerInternetRequestWithListener ( int startpage , Handler handler , boolean isNextPageNeeded , NewsRecordAdapter adapter ) throws InterruptedException , ExecutionException { } private void parseNewsFromInternet ( String response ) { } public boolean fetchLastNews ( ) throws InterruptedException , ExecutionException { } private BoardNews parseOne ( String HTML ) { } private ArrayList < BoardNews > parse ( String HTML ) { } private BoardNews parseHtmlElements ( Element newsTopic ) { } public int getErrorCode ( ) { } public int getPageIndex ( ) { } public void setPageIndex ( int pageIndex ) { } public String getBoardUrl ( ) { } public void setBoardUrl ( String boardUrl ) { } public String getErrorMessage ( ) { } public void setErrorMessage ( String errorMessage ) { } public ArrayList < BoardNews > getData ( ) { } public void setData ( ArrayList < BoardNews > data ) { } public void clearDataBase ( ) { } public void setAdapter ( NewsRecordAdapter adapter ) { } private enum RequestType { REQUEST_FOR_DB , REQUEST_FOR_INTERNET ; } }

Fix:
stringRequest = new StringRequest ( Method . GET , ( ( mBoardUrl ) + ( i + 1 ) ) , future , future ) ;