Program: 157566
Project: 157566
Buggy source:
@Override protected Key createKeyFromXml(Resources res,Row parent,int x,int y,XmlResourceParser parser){
  if (mSpecialShiftKeys == null)   mSpecialShiftKeys=new HashMap<Character,ShiftedKeyData>();
  AnyKey key=new AnyKey(res,parent,x,y,parser);
  if ((key.codes != null) && (key.codes.length > 0)) {
    final int primaryCode=key.codes[0];
    if (Workarounds.isRightToLeftCharacter((char)primaryCode))     mRightToLeftLayout=true;
switch (primaryCode) {
case 10:
case KEYCODE_DELETE:
case KEYCODE_SHIFT:
      key=new LessSensitiveAnyKey(res,parent,x,y,parser);
  }
  if (primaryCode == 10) {
    mEnterKey=key;
  }
 else   if (primaryCode == KEYCODE_SHIFT) {
    mShiftKey=key;
    mOffShiftIcon=mShiftKey.icon;
  }
 else   if ((primaryCode == AnyKeyboard.KEYCODE_SMILEY) && (parent.rowEdgeFlags == Keyboard.EDGE_BOTTOM)) {
    mSmileyKey=key;
  }
 else   if ((primaryCode == 63) && (parent.rowEdgeFlags == Keyboard.EDGE_BOTTOM)) {
    mQuestionMarkKey=key;
  }
 else   if ((primaryCode == Keyboard.KEYCODE_MODE_CHANGE) || (primaryCode == AnyKeyboard.KEYCODE_LANG_CHANGE)) {
    final String keysMode=AnySoftKeyboardConfiguration.getInstance().getChangeLayoutKeysSize();
    if (keysMode.equals("String_Node_Str")) {
      key.label=null;
      key.height=0;
      key.width=0;
    }
 else     if (keysMode.equals("String_Node_Str")) {
      String keyText=(primaryCode == Keyboard.KEYCODE_MODE_CHANGE) ? res.getString(R.string.change_symbols_regular) : res.getString(R.string.change_lang_regular);
      key.label=keyText;
    }
 else {
      String keyText=(primaryCode == Keyboard.KEYCODE_MODE_CHANGE) ? res.getString(R.string.change_symbols_wide) : res.getString(R.string.change_lang_wide);
      key.label=keyText;
    }
  }
 else {
    if (isAlphabetKey(key)) {
      key.label="String_Node_Str" + ((char)primaryCode);
    }
  }
}
if (mDebug) {
  final int primaryKey=((key.codes != null) && key.codes.length > 0) ? key.codes[0] : -1;
  Log.v("String_Node_Str","String_Node_Str" + primaryKey + "String_Node_Str"+ key.width+ "String_Node_Str"+ key.height+ "String_Node_Str"+ key.label+ "String_Node_Str");
}
setPopupKeyChars(key);
if ((key.codes != null) && (key.codes.length > 1)) {
  final int primaryCode=key.codes[0];
  if ((primaryCode > 0) && (primaryCode < Character.MAX_VALUE)) {
    Character primary=new Character((char)primaryCode);
    ShiftedKeyData keyData=new ShiftedKeyData(key);
    if (!mSpecialShiftKeys.containsKey(primary))     mSpecialShiftKeys.put(primary,keyData);
    if (mDebug)     Log.v("String_Node_Str","String_Node_Str" + primary + "String_Node_Str"+ keyData.ShiftCharacter+ "String_Node_Str");
  }
}
return key;
}

Fixed version (ground truth):
@Override protected Key createKeyFromXml(Resources res,Row parent,int x,int y,XmlResourceParser parser){
  if (mSpecialShiftKeys == null)   mSpecialShiftKeys=new HashMap<Character,ShiftedKeyData>();
  AnyKey key=new AnyKey(res,parent,x,y,parser);
  if ((key.codes != null) && (key.codes.length > 0)) {
    final int primaryCode=key.codes[0];
    if (Workarounds.isRightToLeftCharacter((char)primaryCode))     mRightToLeftLayout=true;
switch (primaryCode) {
case 10:
case KEYCODE_DELETE:
case KEYCODE_SHIFT:
      key=new LessSensitiveAnyKey(res,parent,x,y,parser);
  }
  if (primaryCode == 10) {
    mEnterKey=key;
  }
 else   if (primaryCode == KEYCODE_SHIFT) {
    mShiftKey=key;
  }
 else   if ((primaryCode == AnyKeyboard.KEYCODE_SMILEY) && (parent.rowEdgeFlags == Keyboard.EDGE_BOTTOM)) {
    mSmileyKey=key;
  }
 else   if ((primaryCode == 63) && (parent.rowEdgeFlags == Keyboard.EDGE_BOTTOM)) {
    mQuestionMarkKey=key;
  }
 else   if ((primaryCode == Keyboard.KEYCODE_MODE_CHANGE) || (primaryCode == AnyKeyboard.KEYCODE_LANG_CHANGE)) {
    final String keysMode=AnySoftKeyboardConfiguration.getInstance().getChangeLayoutKeysSize();
    if (keysMode.equals("String_Node_Str")) {
      key.label=null;
      key.height=0;
      key.width=0;
    }
 else     if (keysMode.equals("String_Node_Str")) {
      String keyText=(primaryCode == Keyboard.KEYCODE_MODE_CHANGE) ? res.getString(R.string.change_symbols_regular) : res.getString(R.string.change_lang_regular);
      key.label=keyText;
    }
 else {
      String keyText=(primaryCode == Keyboard.KEYCODE_MODE_CHANGE) ? res.getString(R.string.change_symbols_wide) : res.getString(R.string.change_lang_wide);
      key.label=keyText;
    }
  }
 else {
    if (isAlphabetKey(key)) {
      key.label="String_Node_Str" + ((char)primaryCode);
    }
  }
}
if (mDebug) {
  final int primaryKey=((key.codes != null) && key.codes.length > 0) ? key.codes[0] : -1;
  Log.v("String_Node_Str","String_Node_Str" + primaryKey + "String_Node_Str"+ key.width+ "String_Node_Str"+ key.height+ "String_Node_Str"+ key.label+ "String_Node_Str");
}
setPopupKeyChars(key);
if ((key.codes != null) && (key.codes.length > 1)) {
  final int primaryCode=key.codes[0];
  if ((primaryCode > 0) && (primaryCode < Character.MAX_VALUE)) {
    Character primary=new Character((char)primaryCode);
    ShiftedKeyData keyData=new ShiftedKeyData(key);
    if (!mSpecialShiftKeys.containsKey(primary))     mSpecialShiftKeys.put(primary,keyData);
    if (mDebug)     Log.v("String_Node_Str","String_Node_Str" + primary + "String_Node_Str"+ keyData.ShiftCharacter+ "String_Node_Str");
  }
}
return key;
}