title: strange ArrayIndexOutOfBoundsException
body: <p>I have encountered a very strange exception. It runs well in here, but my customers keep encounter this exception and then crash, It have taken me many hours to figure it out, but unfortunately still no luck so far, any help will be appreciated!</p>
  
  <p>This is the code:</p>
  
  <pre><code>protected void onPostExecute(List&lt;File&gt; result) {
      try {
          mBooks.clear();
          if (result != null) {
              ArrayList&lt;BookInfo&gt; newBooks = new ArrayList&lt;BookInfo&gt;();
              for (File f : result) {
                  BookInfo bi = new BookInfo(BookCollections.this, f);
                  if (!contains(bi)) {
                      newBooks.add(bi);
                  }
              }
              mDB.insertBooks(newBooks);
              mBooks.addAll(newBooks);
              new AlertDialog.Builder(BookCollections.this)
                      .setTitle(newBooks.size() + " Books found!")
                      .setPositiveButton(android.R.string.ok, null)
                      .setView(
              new BookInfoList(BookCollections.this,
              newBooks)).show();
          }
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          mScanDlg.dismiss();
          notifyDataSetChanged();
      }
  }
  
  private boolean contains(BookInfo bi) {
      if (bi == null) {
          return true;
      }
      for (BookInfo book : mBooks) {
          if (book.equalTo(bi)) {
              return true;
          }
      }
      for (FolderInfo fi : mFolders) {
          if (fi.getBooks() != null) {
              for (BookInfo book : fi.getBooks()) {
                  if (book.equalTo(bi)) {
                      return true;
                  }
              }
          }
      }
      return false;
  }
  </code></pre>
  
  <p>Please help me. Thanks</p>
  
  <p>This exception(java.lang.ArrayIndexOutOfBoundsException) raise up between </p>
  
  <pre><code>for (File f : result) {
      BookInfo bi = new BookInfo(BookCollections.this, f);
      if (!contains(bi)) {
          newBooks.add(bi);
      }
  }
  </code></pre>