Program: 157541
Project: 157541
Buggy source:
private void addWords(Cursor cursor){
  int newCount=0;
  long newHash=0;
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      String name=cursor.getString(INDEX_NAME);
      if (name != null) {
        newHash+=name.hashCode();
        newCount++;
      }
      cursor.moveToNext();
    }
  }
  if (newCount == mContactsCount && newHash == mContactsHash) {
    cursor.close();
    return;
  }
  if (AnySoftKeyboardConfiguration.DEBUG)   Log.d(TAG,"String_Node_Str" + newCount + "String_Node_Str"+ mContactsCount+ "String_Node_Str"+ newHash+ "String_Node_Str"+ mContactsHash+ "String_Node_Str");
  mContactsCount=newCount;
  mContactsHash=newHash;
  clearDictionary();
  int loadedContacts=0;
  final int maxWordLength=MAX_WORD_LENGTH;
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      String name=cursor.getString(INDEX_NAME);
      if (name != null) {
        int len=name.length();
        for (int i=0; i < len; i++) {
          if (Character.isLetter(name.charAt(i))) {
            int j;
            for (j=i + 1; j < len; j++) {
              char c=name.charAt(j);
              if (!(c == '-' || c == '\'' || Character.isLetter(c))) {
                break;
              }
            }
            String word=name.substring(i,j);
            i=j - 1;
            final int wordLen=word.length();
            if (wordLen < maxWordLength && wordLen > 1) {
              if (AnySoftKeyboardConfiguration.DEBUG)               Log.d(TAG,"String_Node_Str" + word + "String_Node_Str");
              loadedContacts++;
              super.addWord(word,128);
            }
          }
        }
      }
      cursor.moveToNext();
    }
  }
  Log.i(TAG,"String_Node_Str" + loadedContacts + "String_Node_Str");
  cursor.close();
}

Fixed version (ground truth):
private void addWords(Cursor cursor){
  int newCount=0;
  long newHash=0;
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      String name=cursor.getString(INDEX_NAME);
      if (name != null) {
        newHash+=name.hashCode();
        newCount++;
      }
      cursor.moveToNext();
    }
  }
  if (newCount == mContactsCount && newHash == mContactsHash) {
    cursor.close();
    return;
  }
  if (AnySoftKeyboardConfiguration.DEBUG)   Log.d(TAG,"String_Node_Str" + newCount + "String_Node_Str"+ mContactsCount+ "String_Node_Str"+ newHash+ "String_Node_Str"+ mContactsHash+ "String_Node_Str");
  mContactsCount=newCount;
  mContactsHash=newHash;
  clearDictionary();
  int loadedContacts=0;
  final int maxWordLength=MAX_WORD_LENGTH;
  if (cursor.moveToFirst()) {
    while (!cursor.isAfterLast()) {
      String name=cursor.getString(INDEX_NAME);
      if (name != null) {
        int len=name.length();
        for (int i=0; i < len; i++) {
          if (Character.isLetter(name.charAt(i))) {
            int j;
            for (j=i + 1; j < len; j++) {
              char c=name.charAt(j);
              if (!(c == '-' || c == '\'' || Character.isLetter(c))) {
                break;
              }
            }
            String word=name.substring(i,j);
            i=j - 1;
            final int wordLen=word.length();
            if (wordLen < maxWordLength && wordLen > 1) {
              if (AnySoftKeyboardConfiguration.DEBUG)               Log.d(TAG,"String_Node_Str" + word + "String_Node_Str");
              loadedContacts++;
              addWordFromStorage(word,128);
            }
          }
        }
      }
      cursor.moveToNext();
    }
  }
  Log.i(TAG,"String_Node_Str" + loadedContacts + "String_Node_Str");
  cursor.close();
}