Program: 185079
Project: 185079
Buggy source:
public Object fontSelector(PPr pPr,RPr rPr,String text){
  Style pStyle=null;
  if (pPr == null || pPr.getPStyle() == null) {
    pStyle=getDefaultPStyle();
  }
 else   if (wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false) != null) {
    pStyle=wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getStyleById(pPr.getPStyle().getVal());
  }
  PropertyResolver propertyResolver=wordMLPackage.getMainDocumentPart().getPropertyResolver();
  rPr=propertyResolver.getEffectiveRPrUsingPStyleRPr(rPr,pStyle.getRPr());
  Document document=getDocument();
  if (rPr == null) {
    log.warn("String_Node_Str");
    return nullRPr(document,text);
  }
  System.out.println(XmlUtils.marshaltoString(rPr,true,true));
  RFonts rFonts=rPr.getRFonts();
  if (rFonts == null) {
    return nullRPr(document,text);
  }
  if (rPr.getCs() != null || rPr.getRtl() != null) {
    if (rFonts.getCstheme() != null) {
      String fontName=null;
      if (getThemePart() != null) {
        fontName=getThemePart().getFont(rFonts.getCstheme(),themeFontLang);
      }
      if (fontName == null) {
        fontName=rFonts.getCs();
      }
      if (fontName == null) {
      }
      Element span=createElement(document);
      this.setAttribute(span,getCssProperty(fontName));
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(fontName);
      }
      return result(document);
    }
 else     if (rFonts.getCs() != null) {
      String fontName=rFonts.getCs();
      Element span=createElement(document);
      this.setAttribute(span,getCssProperty(fontName));
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(fontName);
      }
      return result(document);
    }
 else {
    }
  }
  String eastAsia=null;
  String ascii=null;
  String hAnsi=null;
  STHint hint=rFonts.getHint();
  if (rFonts.getEastAsiaTheme() != null && getThemePart() != null) {
    eastAsia=getThemePart().getFont(rFonts.getEastAsiaTheme(),themeFontLang);
  }
 else {
    eastAsia=rFonts.getEastAsia();
  }
  if (rFonts.getAsciiTheme() != null && getThemePart() != null) {
    ascii=getThemePart().getFont(rFonts.getAsciiTheme(),themeFontLang);
  }
 else {
    ascii=rFonts.getAscii();
  }
  if (rFonts.getHAnsiTheme() != null && getThemePart() != null) {
    hAnsi=getThemePart().getFont(rFonts.getHAnsiTheme(),themeFontLang);
  }
 else {
    hAnsi=rFonts.getHAnsi();
  }
  if (("String_Node_Str").equals(eastAsia)) {
    if (ascii != null && ascii.equals(hAnsi)) {
      Element span=createElement(document);
      this.setAttribute(span,getCssProperty(ascii));
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(ascii);
      }
      return result(document);
    }
  }
  String langEastAsia=null;
  if (rPr.getLang() != null) {
    langEastAsia=rPr.getLang().getEastAsia();
  }
  vis.setDocument(document);
  return unicodeRangeToFont(text,hint,langEastAsia,eastAsia,ascii,hAnsi);
}

Fixed version (ground truth):
public Object fontSelector(PPr pPr,RPr rPr,String text){
  Style pStyle=null;
  if (pPr == null || pPr.getPStyle() == null) {
    pStyle=getDefaultPStyle();
  }
 else   if (wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false) != null) {
    pStyle=wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getStyleById(pPr.getPStyle().getVal());
  }
  PropertyResolver propertyResolver=wordMLPackage.getMainDocumentPart().getPropertyResolver();
  rPr=propertyResolver.getEffectiveRPrUsingPStyleRPr(rPr,pStyle.getRPr());
  Document document=getDocument();
  if (rPr == null) {
    log.warn("String_Node_Str");
    return nullRPr(document,text);
  }
  RFonts rFonts=rPr.getRFonts();
  if (rFonts == null) {
    return nullRPr(document,text);
  }
  if (rPr.getCs() != null || rPr.getRtl() != null) {
    if (rFonts.getCstheme() != null) {
      String fontName=null;
      if (getThemePart() != null) {
        fontName=getThemePart().getFont(rFonts.getCstheme(),themeFontLang);
      }
      if (fontName == null) {
        fontName=rFonts.getCs();
      }
      if (fontName == null) {
      }
      Element span=createElement(document);
      this.setAttribute(span,fontName);
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(fontName);
      }
      return result(document);
    }
 else     if (rFonts.getCs() != null) {
      String fontName=rFonts.getCs();
      Element span=createElement(document);
      this.setAttribute(span,fontName);
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(fontName);
      }
      return result(document);
    }
 else {
    }
  }
  String eastAsia=null;
  String ascii=null;
  String hAnsi=null;
  STHint hint=rFonts.getHint();
  if (rFonts.getEastAsiaTheme() != null && getThemePart() != null) {
    eastAsia=getThemePart().getFont(rFonts.getEastAsiaTheme(),themeFontLang);
  }
 else {
    eastAsia=rFonts.getEastAsia();
  }
  if (rFonts.getAsciiTheme() != null && getThemePart() != null) {
    ascii=getThemePart().getFont(rFonts.getAsciiTheme(),themeFontLang);
  }
 else {
    ascii=rFonts.getAscii();
  }
  if (rFonts.getHAnsiTheme() != null && getThemePart() != null) {
    hAnsi=getThemePart().getFont(rFonts.getHAnsiTheme(),themeFontLang);
  }
 else {
    hAnsi=rFonts.getHAnsi();
  }
  if (("String_Node_Str").equals(eastAsia)) {
    if (ascii != null && ascii.equals(hAnsi)) {
      Element span=createElement(document);
      this.setAttribute(span,ascii);
      span.setTextContent(text);
      if (outputType == RunFontActionType.DISCOVERY) {
        vis.fontAction(ascii);
      }
      return result(document);
    }
  }
  if (ascii == null) {
    log.warn("String_Node_Str");
    ascii=this.getDefaultFont();
  }
  String langEastAsia=null;
  if (rPr.getLang() != null) {
    langEastAsia=rPr.getLang().getEastAsia();
  }
  vis.setDocument(document);
  return unicodeRangeToFont(text,hint,langEastAsia,eastAsia,ascii,hAnsi);
}