Program: 147363
Project: 147363
Buggy source:
@Override public Communication fromCharacterBasedFile(final Path path) throws IngestException {
  if (!Files.exists(path))   throw new IngestException("String_Node_Str" + path.toString());
  Communication c=CommunicationFactory.create();
  c.setType(this.getKind());
  c.setMetadata(TooledMetadataConverter.convert(this));
  try {
    ExistingNonDirectoryFile ef=new ExistingNonDirectoryFile(path);
    c.setId(ef.getName().split("String_Node_Str")[0]);
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException(path.toString() + "String_Node_Str");
  }
  String content;
  try (InputStream is=Files.newInputStream(path);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 8)){
    content=IOUtils.toString(bin,StandardCharsets.UTF_8);
    c.setText(content);
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
  try (InputStream is=Files.newInputStream(path);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 8);BufferedReader reader=new BufferedReader(new InputStreamReader(bin,StandardCharsets.UTF_8))){
    XMLEventReader rdr=null;
    try {
      rdr=inF.createXMLEventReader(reader);
      Section headline=this.handleHeadline(rdr,content);
      c.addToSectionList(headline);
      LOGGER.debug("String_Node_Str",new SuperTextSpan(headline.getTextSpan(),c).getText());
      int sectNumber=1;
      int subSect=0;
      this.iterateToPosts(rdr);
      int currOff=-1;
      while (rdr.hasNext()) {
        XMLEvent nextEvent=rdr.nextEvent();
        if (nextEvent.isEndDocument())         break;
        if (nextEvent.isStartElement()) {
          StartElement se=nextEvent.asStartElement();
          QName name=se.getName();
          final String localName=name.getLocalPart();
          if (localName.equals(QUOTE_LOCAL_NAME)) {
            currOff=this.handleQuote(rdr);
            continue;
          }
 else           if (localName.equals(IMG_LOCAL_NAME)) {
            currOff=this.handleImg(rdr);
            continue;
          }
 else           if (localName.equals(LINK_LOCAL_NAME)) {
            currOff=this.handleLink(rdr);
            continue;
          }
 else           if (localName.equals(POST_LOCAL_NAME)) {
            currOff=se.getLocation().getCharacterOffset();
          }
 else {
            throw new IllegalArgumentException("String_Node_Str" + localName);
          }
        }
 else         if (nextEvent.isCharacters()) {
          Characters chars=nextEvent.asCharacters();
          if (chars.isWhiteSpace()) {
            currOff=chars.getLocation().getCharacterOffset();
          }
 else {
            String fpContent=chars.getData();
            LOGGER.debug("String_Node_Str",fpContent);
            SimpleImmutableEntry<Integer,Integer> pads=this.trimSpacing(fpContent);
            final int tsb=currOff + pads.getKey();
            final int tse=currOff + fpContent.length() - pads.getValue();
            LOGGER.debug("String_Node_Str",content.substring(tsb,tse));
            TextSpan ts=new TextSpan(tsb,tse);
            Section s=SectionFactory.fromTextSpan(ts,"String_Node_Str");
            List<Integer> intList=new ArrayList<>();
            intList.add(sectNumber);
            intList.add(subSect);
            s.setNumberList(intList);
            c.addToSectionList(s);
            subSect++;
          }
        }
 else         if (nextEvent.isEndElement()) {
          EndElement ee=nextEvent.asEndElement();
          currOff=ee.getLocation().getCharacterOffset();
          QName name=ee.getName();
          String localName=name.getLocalPart();
          if (localName.equalsIgnoreCase(POST_LOCAL_NAME)) {
            sectNumber++;
            subSect=0;
          }
        }
      }
      return c;
    }
 catch (    XMLStreamException|ConcreteException x) {
      throw new IngestException(x);
    }
 finally {
      if (rdr != null)       try {
        rdr.close();
      }
 catch (      XMLStreamException e) {
        LOGGER.info("String_Node_Str",e);
      }
    }
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
}

Fixed version (ground truth):
@Override public Communication fromCharacterBasedFile(final Path path) throws IngestException {
  if (!Files.exists(path))   throw new IngestException("String_Node_Str" + path.toString());
  Communication c=CommunicationFactory.create();
  c.setType(this.getKind());
  c.setMetadata(TooledMetadataConverter.convert(this));
  try {
    ExistingNonDirectoryFile ef=new ExistingNonDirectoryFile(path);
    c.setId(ef.getName().split("String_Node_Str")[0]);
  }
 catch (  NoSuchFileException|NotFileException e) {
    throw new IngestException(path.toString() + "String_Node_Str");
  }
  String content;
  try (InputStream is=Files.newInputStream(path);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 8)){
    content=IOUtils.toString(bin,StandardCharsets.UTF_8);
    c.setText(content);
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
  try (InputStream is=Files.newInputStream(path);BufferedInputStream bin=new BufferedInputStream(is,1024 * 8 * 8);BufferedReader reader=new BufferedReader(new InputStreamReader(bin,StandardCharsets.UTF_8))){
    XMLEventReader rdr=null;
    try {
      rdr=inF.createXMLEventReader(reader);
      Section headline=this.handleHeadline(rdr,content);
      c.addToSectionList(headline);
      LOGGER.debug("String_Node_Str",new SuperTextSpan(headline.getTextSpan(),c).getText());
      int sectNumber=1;
      int subSect=0;
      this.iterateToPosts(rdr);
      int currOff=-1;
      while (rdr.hasNext()) {
        XMLEvent nextEvent=rdr.nextEvent();
        if (currOff > 0) {
          int currOffPlus=currOff + 20;
          int currOffLess=currOff - 20;
          LOGGER.debug("String_Node_Str",currOff);
          if (currOffPlus < content.length())           LOGGER.debug("String_Node_Str",content.substring(currOffLess,currOffPlus));
        }
        if (nextEvent.isEndDocument())         break;
        if (nextEvent.isStartElement()) {
          StartElement se=nextEvent.asStartElement();
          QName name=se.getName();
          final String localName=name.getLocalPart();
          if (localName.equals(QUOTE_LOCAL_NAME)) {
            currOff=this.handleQuote(rdr);
            continue;
          }
 else           if (localName.equals(IMG_LOCAL_NAME)) {
            currOff=this.handleImg(rdr);
            continue;
          }
 else           if (localName.equals(LINK_LOCAL_NAME)) {
            currOff=this.handleLink(rdr);
            continue;
          }
 else           if (localName.equals(POST_LOCAL_NAME)) {
            currOff=se.getLocation().getCharacterOffset();
          }
 else {
            throw new IllegalArgumentException("String_Node_Str" + localName);
          }
        }
 else         if (nextEvent.isCharacters()) {
          Characters chars=nextEvent.asCharacters();
          int coff=chars.getLocation().getCharacterOffset();
          if (chars.isWhiteSpace()) {
            currOff=coff;
          }
 else {
            String fpContent=chars.getData();
            LOGGER.debug("String_Node_Str",coff);
            LOGGER.debug("String_Node_Str",fpContent);
            SimpleImmutableEntry<Integer,Integer> pads=this.trimSpacing(fpContent);
            final int tsb=currOff + pads.getKey();
            final int tse=currOff + fpContent.length() - pads.getValue();
            LOGGER.debug("String_Node_Str",content.substring(tsb,tse));
            TextSpan ts=new TextSpan(tsb,tse);
            Section s=SectionFactory.fromTextSpan(ts,"String_Node_Str");
            List<Integer> intList=new ArrayList<>();
            intList.add(sectNumber);
            intList.add(subSect);
            s.setNumberList(intList);
            c.addToSectionList(s);
            subSect++;
          }
        }
 else         if (nextEvent.isEndElement()) {
          EndElement ee=nextEvent.asEndElement();
          currOff=ee.getLocation().getCharacterOffset();
          QName name=ee.getName();
          String localName=name.getLocalPart();
          if (localName.equalsIgnoreCase(POST_LOCAL_NAME)) {
            sectNumber++;
            subSect=0;
          }
        }
      }
      return c;
    }
 catch (    XMLStreamException|ConcreteException x) {
      throw new IngestException(x);
    }
 finally {
      if (rdr != null)       try {
        rdr.close();
      }
 catch (      XMLStreamException e) {
        LOGGER.info("String_Node_Str",e);
      }
    }
  }
 catch (  IOException e) {
    throw new IngestException(e);
  }
}