Program: 20421
Project: 20421
Buggy source:
private CharSequence parseNode(Theme theme,Post post,Node node){
  if (node instanceof TextNode) {
    String text=((TextNode)node).text();
    SpannableString spannable=new SpannableString(text);
    detectLinks(theme,post,text,spannable);
    return spannable;
  }
 else {
switch (node.nodeName()) {
case "String_Node_Str":
{
        return "String_Node_Str";
      }
case "String_Node_Str":
{
      Element span=(Element)node;
      SpannableString quote;
      Set<String> classes=span.classNames();
      if (classes.contains("String_Node_Str")) {
        quote=new SpannableString(span.text());
        quote.setSpan(new ForegroundColorSpan(theme.quoteColor),0,quote.length(),0);
        quote.setSpan(new StrikethroughSpan(),0,quote.length(),0);
      }
 else       if (classes.contains("String_Node_Str")) {
        quote=new SpannableString("String_Node_Str" + span.text());
        String style=span.attr("String_Node_Str");
        if (!TextUtils.isEmpty(style)) {
          style=style.replace("String_Node_Str","String_Node_Str");
          Matcher matcher=colorPattern.matcher(style);
          int hexColor=0xff0000;
          if (matcher.find()) {
            String group=matcher.group(1);
            if (!TextUtils.isEmpty(group)) {
              try {
                hexColor=Integer.parseInt(group,16);
              }
 catch (              NumberFormatException ignored) {
              }
            }
          }
          if (hexColor >= 0 && hexColor <= 0xffffff) {
            quote.setSpan(new ForegroundColorSpan(0xff000000 + hexColor),0,quote.length(),0);
            quote.setSpan(new StyleSpan(Typeface.BOLD),0,quote.length(),0);
          }
        }
      }
 else       if (classes.contains("String_Node_Str")) {
        return null;
      }
 else {
        quote=new SpannableString(span.text());
        quote.setSpan(new ForegroundColorSpan(theme.inlineQuoteColor),0,quote.length(),0);
        detectLinks(theme,post,span.text(),quote);
      }
      return quote;
    }
case "String_Node_Str":
{
    Element table=(Element)node;
    List<CharSequence> parts=new ArrayList<>();
    Elements tableRows=table.getElementsByTag("String_Node_Str");
    for (int i=0; i < tableRows.size(); i++) {
      Element tableRow=tableRows.get(i);
      if (tableRow.text().length() > 0) {
        Elements tableDatas=tableRow.getElementsByTag("String_Node_Str");
        for (int j=0; j < tableDatas.size(); j++) {
          Element tableData=tableDatas.get(j);
          SpannableString tableDataPart=new SpannableString(tableData.text());
          if (tableData.getElementsByTag("String_Node_Str").size() > 0) {
            tableDataPart.setSpan(new StyleSpan(Typeface.BOLD),0,tableDataPart.length(),0);
            tableDataPart.setSpan(new UnderlineSpan(),0,tableDataPart.length(),0);
          }
          parts.add(tableDataPart);
          if (j < tableDatas.size() - 1) {
            parts.add("String_Node_Str");
          }
        }
        if (i < tableRows.size() - 1) {
          parts.add("String_Node_Str");
        }
      }
    }
    SpannableString tableTotal=new SpannableString(TextUtils.concat(parts.toArray(new CharSequence[parts.size()])));
    tableTotal.setSpan(new ForegroundColorSpan(theme.inlineQuoteColor),0,tableTotal.length(),0);
    tableTotal.setSpan(new AbsoluteSizeSpan(sp(12f)),0,tableTotal.length(),0);
    return tableTotal;
  }
case "String_Node_Str":
{
  Element strong=(Element)node;
  SpannableString red=new SpannableString(strong.text());
  red.setSpan(new ForegroundColorSpan(theme.quoteColor),0,red.length(),0);
  red.setSpan(new StyleSpan(Typeface.BOLD),0,red.length(),0);
  return red;
}
case "String_Node_Str":
{
CharSequence anchor=parseAnchor(theme,post,(Element)node);
if (anchor != null) {
  return anchor;
}
 else {
  return ((Element)node).text();
}
}
case "String_Node_Str":
{
Element spoiler=(Element)node;
SpannableString link=new SpannableString(spoiler.text());
PostLinkable pl=new PostLinkable(theme,post,spoiler.text(),spoiler.text(),PostLinkable.Type.SPOILER);
link.setSpan(pl,0,link.length(),0);
post.linkables.add(pl);
return link;
}
case "String_Node_Str":
{
Element pre=(Element)node;
Set<String> classes=pre.classNames();
if (classes.contains("String_Node_Str")) {
String text=getNodeText(pre);
SpannableString monospace=new SpannableString(text);
monospace.setSpan(new TypefaceSpan("String_Node_Str"),0,monospace.length(),0);
monospace.setSpan(new AbsoluteSizeSpan(sp(12f)),0,monospace.length(),0);
return monospace;
}
 else {
return pre.text();
}
}
default :
{
if (node instanceof Element) {
return ((Element)node).text();
}
 else {
return null;
}
}
}
}
}

Fixed version (ground truth):
private CharSequence parseNode(Theme theme,Post post,Node node){
  if (node instanceof TextNode) {
    String text=((TextNode)node).text();
    SpannableString spannable=new SpannableString(text);
    detectLinks(theme,post,text,spannable);
    return spannable;
  }
 else {
switch (node.nodeName()) {
case "String_Node_Str":
{
        return "String_Node_Str";
      }
case "String_Node_Str":
{
      Element span=(Element)node;
      SpannableString quote;
      Set<String> classes=span.classNames();
      if (classes.contains("String_Node_Str")) {
        quote=new SpannableString(span.text());
        quote.setSpan(new ForegroundColorSpanHashed(theme.quoteColor),0,quote.length(),0);
        quote.setSpan(new StrikethroughSpan(),0,quote.length(),0);
      }
 else       if (classes.contains("String_Node_Str")) {
        quote=new SpannableString("String_Node_Str" + span.text());
        String style=span.attr("String_Node_Str");
        if (!TextUtils.isEmpty(style)) {
          style=style.replace("String_Node_Str","String_Node_Str");
          Matcher matcher=colorPattern.matcher(style);
          int hexColor=0xff0000;
          if (matcher.find()) {
            String group=matcher.group(1);
            if (!TextUtils.isEmpty(group)) {
              try {
                hexColor=Integer.parseInt(group,16);
              }
 catch (              NumberFormatException ignored) {
              }
            }
          }
          if (hexColor >= 0 && hexColor <= 0xffffff) {
            quote.setSpan(new ForegroundColorSpanHashed(0xff000000 + hexColor),0,quote.length(),0);
            quote.setSpan(new StyleSpan(Typeface.BOLD),0,quote.length(),0);
          }
        }
      }
 else       if (classes.contains("String_Node_Str")) {
        return null;
      }
 else {
        quote=new SpannableString(span.text());
        quote.setSpan(new ForegroundColorSpanHashed(theme.inlineQuoteColor),0,quote.length(),0);
        detectLinks(theme,post,span.text(),quote);
      }
      return quote;
    }
case "String_Node_Str":
{
    Element table=(Element)node;
    List<CharSequence> parts=new ArrayList<>();
    Elements tableRows=table.getElementsByTag("String_Node_Str");
    for (int i=0; i < tableRows.size(); i++) {
      Element tableRow=tableRows.get(i);
      if (tableRow.text().length() > 0) {
        Elements tableDatas=tableRow.getElementsByTag("String_Node_Str");
        for (int j=0; j < tableDatas.size(); j++) {
          Element tableData=tableDatas.get(j);
          SpannableString tableDataPart=new SpannableString(tableData.text());
          if (tableData.getElementsByTag("String_Node_Str").size() > 0) {
            tableDataPart.setSpan(new StyleSpan(Typeface.BOLD),0,tableDataPart.length(),0);
            tableDataPart.setSpan(new UnderlineSpan(),0,tableDataPart.length(),0);
          }
          parts.add(tableDataPart);
          if (j < tableDatas.size() - 1) {
            parts.add("String_Node_Str");
          }
        }
        if (i < tableRows.size() - 1) {
          parts.add("String_Node_Str");
        }
      }
    }
    SpannableString tableTotal=new SpannableString(TextUtils.concat(parts.toArray(new CharSequence[parts.size()])));
    tableTotal.setSpan(new ForegroundColorSpanHashed(theme.inlineQuoteColor),0,tableTotal.length(),0);
    tableTotal.setSpan(new AbsoluteSizeSpanHashed(sp(12f)),0,tableTotal.length(),0);
    return tableTotal;
  }
case "String_Node_Str":
{
  Element strong=(Element)node;
  SpannableString red=new SpannableString(strong.text());
  red.setSpan(new ForegroundColorSpanHashed(theme.quoteColor),0,red.length(),0);
  red.setSpan(new StyleSpan(Typeface.BOLD),0,red.length(),0);
  return red;
}
case "String_Node_Str":
{
CharSequence anchor=parseAnchor(theme,post,(Element)node);
if (anchor != null) {
  return anchor;
}
 else {
  return ((Element)node).text();
}
}
case "String_Node_Str":
{
Element spoiler=(Element)node;
SpannableString link=new SpannableString(spoiler.text());
PostLinkable pl=new PostLinkable(theme,post,spoiler.text(),spoiler.text(),PostLinkable.Type.SPOILER);
link.setSpan(pl,0,link.length(),0);
post.linkables.add(pl);
return link;
}
case "String_Node_Str":
{
Element pre=(Element)node;
Set<String> classes=pre.classNames();
if (classes.contains("String_Node_Str")) {
String text=getNodeText(pre);
SpannableString monospace=new SpannableString(text);
monospace.setSpan(new TypefaceSpan("String_Node_Str"),0,monospace.length(),0);
monospace.setSpan(new AbsoluteSizeSpanHashed(sp(12f)),0,monospace.length(),0);
return monospace;
}
 else {
return pre.text();
}
}
default :
{
if (node instanceof Element) {
return ((Element)node).text();
}
 else {
return null;
}
}
}
}
}