Program: 66531
Project: 66531
Buggy source:
private TextArea getNextTextArea(int maxLineWidth){
  if (null != wordVestige) {
    if (isEmptyWordVestige(wordVestige)) {
      offset+=wordVestige.getLength();
      wordVestige=null;
      return null;
    }
 else {
      lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
      TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
      textArea.setMaxWidth(maxLineWidth);
      textArea.setWidth(0);
      addWordIntoTextArea(textArea,wordVestige);
      return textArea;
    }
  }
  if (null != remainWord) {
    lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
    TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,remainWord);
    remainWord=null;
    return textArea;
  }
  if (null == remainWords || !remainWords.hasWord()) {
    Chunk chunk=remainChunks.getNext();
    if (chunk == Chunk.HARD_LINE_BREAK) {
      FontHandler handler=new FontHandler(fontManager,textContent,false);
      TextArea textArea=createTextArea(textContent,handler.getFontInfo(),true);
      textArea.setTextLength(chunk.getLength());
      hasLineBreak=true;
      if (lineBreakCollapse == LINE_BREAK_COLLAPSE_STANDING_BY) {
        lineBreakCollapse=LINE_BREAK_COLLAPSE_OCCUPIED;
      }
      return textArea;
    }
    lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
    fontInfo=chunk.getFontInfo();
    runLevel=chunk.getRunLevel();
    remainWords=new WordRecognizerWrapper(chunk.getText(),context.getLocale());
  }
  TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
  textArea.setMaxWidth(maxLineWidth);
  textArea.setWidth(0);
  addWordsIntoTextArea(textArea,remainWords);
  return textArea;
}

Fixed version (ground truth):
private TextArea getNextTextArea(int maxLineWidth){
  if (null != wordVestige) {
    if (isEmptyWordVestige(wordVestige)) {
      offset+=wordVestige.getLength();
      wordVestige=null;
      return null;
    }
 else {
      lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
      TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
      textArea.setMaxWidth(maxLineWidth);
      textArea.setWidth(0);
      addWordIntoTextArea(textArea,wordVestige);
      return textArea;
    }
  }
  if (null != remainWord) {
    lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
    TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
    textArea.setMaxWidth(maxLineWidth);
    textArea.setWidth(0);
    addWordIntoTextArea(textArea,remainWord);
    remainWord=null;
    return textArea;
  }
  if (null == remainWords || !remainWords.hasWord()) {
    Chunk chunk=remainChunks.getNext();
    if (chunk instanceof LineBreakChunk) {
      FontHandler handler=new FontHandler(fontManager,textContent,false);
      TextArea textArea=createTextArea(textContent,handler.getFontInfo(),true);
      textArea.setTextLength(chunk.getLength());
      hasLineBreak=true;
      if (lineBreakCollapse == LINE_BREAK_COLLAPSE_STANDING_BY) {
        lineBreakCollapse=LINE_BREAK_COLLAPSE_OCCUPIED;
      }
      return textArea;
    }
    lineBreakCollapse=LINE_BREAK_COLLAPSE_FREE;
    fontInfo=chunk.getFontInfo();
    runLevel=chunk.getRunLevel();
    remainWords=new WordRecognizerWrapper(chunk.getText(),context.getLocale());
  }
  TextArea textArea=createTextArea(textContent,offset,runLevel,fontInfo);
  textArea.setMaxWidth(maxLineWidth);
  textArea.setWidth(0);
  addWordsIntoTextArea(textArea,remainWords);
  return textArea;
}