Program: 4014
Project: 4014
Buggy source:
/** 
 * create a simplenlg WordElement from a Word node in a lexicon XML file
 * @param wordNode
 * @return
 * @throws XPathUtilException
 */
private WordElement convertNodeToWord(Node wordNode){
  if (!wordNode.getNodeName().equalsIgnoreCase(XML_WORD))   return null;
  WordElement word=new WordElement();
  List<Inflection> inflections=new ArrayList<Inflection>();
  NodeList nodes=wordNode.getChildNodes();
  for (int i=0; i < nodes.getLength(); i++) {
    Node featureNode=nodes.item(i);
    if (featureNode.getNodeType() == Node.ELEMENT_NODE) {
      String feature=featureNode.getNodeName().trim();
      String value=featureNode.getTextContent();
      if (value != null)       value=value.trim();
      if (feature == null) {
        System.out.println("String_Node_Str" + word.toString());
        break;
      }
      if (feature.equalsIgnoreCase(XML_BASE)) {
        word.setBaseForm(value);
      }
 else       if (feature.equalsIgnoreCase(XML_CATEGORY))       word.setCategory(LexicalCategory.valueOf(value.toUpperCase()));
 else       if (feature.equalsIgnoreCase(XML_ID))       word.setId(value);
 else       if (value == null || value.equals("String_Node_Str")) {
        Inflection infl=Inflection.getInflCode(feature);
        if (infl != null) {
          inflections.add(infl);
        }
 else {
          word.setFeature(feature,true);
        }
      }
 else       word.setFeature(feature,value);
    }
  }
  if (inflections.isEmpty()) {
    inflections.add(Inflection.REGULAR);
  }
  Inflection defaultInfl=inflections.contains(Inflection.REGULAR) ? Inflection.REGULAR : inflections.get(0);
  word.setFeature(LexicalFeature.DEFAULT_INFL,defaultInfl);
  word.setDefaultInflectionalVariant(defaultInfl);
  for (  Inflection infl : inflections) {
    word.addInflectionalVariant(infl);
  }
  return word;
}

Fixed version (ground truth):
/** 
 * create a simplenlg WordElement from a Word node in a lexicon XML file
 * @param wordNode
 * @return
 * @throws XPathUtilException
 */
private WordElement convertNodeToWord(Node wordNode){
  if (!wordNode.getNodeName().equalsIgnoreCase(XML_WORD))   return null;
  WordElement word=new WordElement();
  List<Inflection> inflections=new ArrayList<Inflection>();
  NodeList nodes=wordNode.getChildNodes();
  for (int i=0; i < nodes.getLength(); i++) {
    Node featureNode=nodes.item(i);
    if (featureNode.getNodeType() == Node.ELEMENT_NODE) {
      String feature=featureNode.getNodeName().trim();
      String value=featureNode.getTextContent();
      if (value != null)       value=value.trim();
      if (feature == null) {
        System.err.println("String_Node_Str" + word.toString());
        break;
      }
      if (feature.equalsIgnoreCase(XML_BASE)) {
        word.setBaseForm(value);
      }
 else       if (feature.equalsIgnoreCase(XML_CATEGORY))       word.setCategory(LexicalCategory.valueOf(value.toUpperCase()));
 else       if (feature.equalsIgnoreCase(XML_ID))       word.setId(value);
 else       if (value == null || value.equals("String_Node_Str")) {
        Inflection infl=Inflection.getInflCode(feature);
        if (infl != null) {
          inflections.add(infl);
        }
 else {
          word.setFeature(feature,true);
        }
      }
 else       word.setFeature(feature,value);
    }
  }
  if (inflections.isEmpty()) {
    inflections.add(Inflection.REGULAR);
  }
  Inflection defaultInfl=inflections.contains(Inflection.REGULAR) ? Inflection.REGULAR : inflections.get(0);
  word.setFeature(LexicalFeature.DEFAULT_INFL,defaultInfl);
  word.setDefaultInflectionalVariant(defaultInfl);
  for (  Inflection infl : inflections) {
    word.addInflectionalVariant(infl);
  }
  return word;
}