Program: 92591
Project: 92591
Buggy source:
/** 
 * finds the icons within a Editable, and tries to map the the available (given via the fonts param) icons on it Use this whenever possible, as this method does update the Editable, and does not have to create a new Spanned
 * @param editable
 * @param fonts
 * @return
 */
public static LinkedList<StyleContainer> findIconsFromEditable(Editable editable,HashMap<String,ITypeface> fonts){
  LinkedList<StyleContainer> styleContainers=new LinkedList<>();
  LinkedList<StyleContainer> existingSpans=new LinkedList<>();
  for (  ParcelableSpan span : editable.getSpans(0,editable.length(),ParcelableSpan.class)) {
    existingSpans.add(new StyleContainer(editable.getSpanStart(span),editable.getSpanEnd(span),span,editable.getSpanFlags(span)));
  }
  for (  CharacterStyle span : editable.getSpans(0,editable.length(),CharacterStyle.class)) {
    existingSpans.add(new StyleContainer(editable.getSpanStart(span),editable.getSpanEnd(span),span,editable.getSpanFlags(span)));
  }
  try {
    editable.clearSpans();
  }
 catch (  Exception ex) {
  }
  int iconStart=-1;
  for (int i=0; i < editable.length(); i++) {
    Character c=editable.charAt(i);
    if (c == ICON_START) {
      iconStart=i;
    }
 else     if (c == ICON_END) {
      if (iconStart > -1) {
        StyleContainer styleContainer=placeFontIcon(editable,iconStart,i,fonts);
        if (styleContainer != null) {
          styleContainers.add(styleContainer);
          for (          StyleContainer existingStyleContainer : existingSpans) {
            if (existingStyleContainer.startIndex > i) {
              existingStyleContainer.startIndex=existingStyleContainer.startIndex - (i - iconStart);
              existingStyleContainer.endIndex=existingStyleContainer.endIndex - (i - iconStart);
            }
 else             if (existingStyleContainer.endIndex > i) {
              existingStyleContainer.endIndex=existingStyleContainer.endIndex - (i - iconStart);
            }
          }
          i=i - iconStart;
        }
      }
      iconStart=-1;
    }
  }
  styleContainers.addAll(existingSpans);
  return styleContainers;
}

Fixed version (ground truth):
/** 
 * finds the icons within a Editable, and tries to map the the available (given via the fonts param) icons on it Use this whenever possible, as this method does update the Editable, and does not have to create a new Spanned
 * @param editable
 * @param fonts
 * @return
 */
public static LinkedList<StyleContainer> findIconsFromEditable(Editable editable,HashMap<String,ITypeface> fonts){
  LinkedList<StyleContainer> styleContainers=new LinkedList<>();
  LinkedList<StyleContainer> existingSpans=new LinkedList<>();
  for (  ParcelableSpan span : editable.getSpans(0,editable.length(),ParcelableSpan.class)) {
    existingSpans.add(new StyleContainer(editable.getSpanStart(span),editable.getSpanEnd(span),span,editable.getSpanFlags(span)));
  }
  for (  CharacterStyle span : editable.getSpans(0,editable.length(),CharacterStyle.class)) {
    existingSpans.add(new StyleContainer(editable.getSpanStart(span),editable.getSpanEnd(span),span,editable.getSpanFlags(span)));
  }
  try {
    editable.clearSpans();
  }
 catch (  Exception ex) {
  }
  int iconStart=-1;
  for (int i=0; i < editable.length(); i++) {
    Character c=editable.charAt(i);
    if (c == ICON_START) {
      iconStart=i;
    }
 else     if (c == ICON_END) {
      if (iconStart > -1) {
        StyleContainer styleContainer=placeFontIcon(editable,iconStart,i,fonts);
        if (styleContainer != null) {
          styleContainers.add(styleContainer);
          for (          StyleContainer existingStyleContainer : existingSpans) {
            if (existingStyleContainer.startIndex > i) {
              existingStyleContainer.startIndex=existingStyleContainer.startIndex - (i - iconStart);
              existingStyleContainer.endIndex=existingStyleContainer.endIndex - (i - iconStart);
            }
 else             if (existingStyleContainer.endIndex > i) {
              existingStyleContainer.endIndex=existingStyleContainer.endIndex - (i - iconStart);
            }
          }
          i=iconStart;
        }
      }
      iconStart=-1;
    }
  }
  styleContainers.addAll(existingSpans);
  return styleContainers;
}