Program: 157323
Project: 157323
Buggy source:
public AnyKey(@NonNull AddOn.AddOnResourceMapping resourceMapping,Context askContext,Context keyboardContext,Keyboard.Row parent,KeyboardDimens keyboardDimens,int x,int y,XmlResourceParser parser){
  super(resourceMapping,askContext,keyboardContext,parent,keyboardDimens,x,y,parser);
  mEnabled=true;
  mFunctionalKey=false;
  longPressCode=0;
  shiftedKeyLabel=null;
  hintLabel=null;
  TypedArray a=keyboardContext.obtainStyledAttributes(Xml.asAttributeSet(parser),resourceMapping.getRemoteStyleableArrayFromLocal(R.styleable.KeyboardLayout_Key));
  int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    final int remoteIndex=a.getIndex(i);
    final int localAttrId=R.styleable.KeyboardLayout_Key[remoteIndex];
    try {
switch (localAttrId) {
case R.attr.shiftedCodes:
        shiftedCodes=KeyboardSupport.getKeyCodesFromTypedArray(a,remoteIndex);
      break;
case R.attr.longPressCode:
    longPressCode=a.getInt(remoteIndex,0);
  break;
case R.attr.isFunctional:
mFunctionalKey=a.getBoolean(remoteIndex,false);
break;
case R.attr.shiftedKeyLabel:
shiftedKeyLabel=a.getString(remoteIndex);
break;
case R.attr.hintLabel:
hintLabel=a.getString(remoteIndex);
break;
case R.attr.tags:
String tags=a.getString(remoteIndex);
if (!TextUtils.isEmpty(tags)) {
mKeyTags=Arrays.asList(tags.split("String_Node_Str"));
}
break;
}
}
 catch (Exception e) {
Logger.w(TAG,"String_Node_Str",e);
}
}
a.recycle();
if (shiftedCodes.length != codes.length) {
int[] wrongSizedShiftCodes=shiftedCodes;
shiftedCodes=new int[codes.length];
int i;
for (i=0; i < wrongSizedShiftCodes.length && i < codes.length; i++) shiftedCodes[i]=wrongSizedShiftCodes[i];
for (; i < codes.length; i++) {
final int code=codes[i];
if (Character.isLetter(code)) shiftedCodes[i]=Character.toUpperCase(code);
 else shiftedCodes[i]=code;
}
}
if (popupCharacters != null && popupCharacters.length() == 0) {
popupResId=0;
}
}

Fixed version (ground truth):
public AnyKey(@NonNull AddOn.AddOnResourceMapping resourceMapping,Context askContext,Context keyboardContext,Keyboard.Row parent,KeyboardDimens keyboardDimens,int x,int y,XmlResourceParser parser){
  super(resourceMapping,askContext,keyboardContext,parent,keyboardDimens,x,y,parser);
  mEnabled=true;
  mFunctionalKey=false;
  longPressCode=0;
  shiftedKeyLabel=null;
  hintLabel=null;
  TypedArray a=keyboardContext.obtainStyledAttributes(Xml.asAttributeSet(parser),resourceMapping.getRemoteStyleableArrayFromLocal(R.styleable.KeyboardLayout_Key));
  int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    final int remoteIndex=a.getIndex(i);
    final int localAttrId=R.styleable.KeyboardLayout_Key[remoteIndex];
    try {
switch (localAttrId) {
case R.attr.shiftedCodes:
        shiftedCodes=KeyboardSupport.getKeyCodesFromTypedArray(a,remoteIndex);
      break;
case R.attr.longPressCode:
    longPressCode=a.getInt(remoteIndex,0);
  break;
case R.attr.isFunctional:
mFunctionalKey=a.getBoolean(remoteIndex,false);
break;
case R.attr.shiftedKeyLabel:
shiftedKeyLabel=a.getString(remoteIndex);
break;
case R.attr.hintLabel:
hintLabel=a.getString(remoteIndex);
break;
case R.attr.tags:
String tags=a.getString(remoteIndex);
if (!TextUtils.isEmpty(tags)) {
mKeyTags=Arrays.asList(tags.split("String_Node_Str"));
}
break;
}
}
 catch (Exception e) {
Logger.w(TAG,"String_Node_Str",e);
}
}
a.recycle();
if (shiftedCodes.length != codes.length) {
int[] wrongSizedShiftCodes=shiftedCodes;
shiftedCodes=new int[codes.length];
int i;
for (i=0; i < wrongSizedShiftCodes.length && i < codes.length; i++) shiftedCodes[i]=wrongSizedShiftCodes[i];
for (; i < codes.length; i++) {
final int code=codes[i];
if (Character.isLetter(code)) shiftedCodes[i]=Character.toUpperCase(code);
 else shiftedCodes[i]=code;
}
}
mShiftCodesAlways=shiftedCodes.length == 0 || Character.isLetter(shiftedCodes[0]);
if (popupCharacters != null && popupCharacters.length() == 0) {
popupResId=0;
}
}