Program: 24503
Project: 24503
Buggy source:
public SentencesPanel(Dialog synonymDialog){
  this.listeners=new LinkedList<ISentenceSelectionChangeListener>();
  this.synonymDialog=synonymDialog;
  IRowDefn rowDefn=new SentenceRowDefinition();
  tableModel=new DataViewTableModel(rowDefn);
  tableColumnModel=new DefaultTableColumnModel();
  dataViewTable=new JTable(tableModel,tableColumnModel);
  dataViewTable.setAutoscrolls(true);
  dataViewTable.setShowHorizontalLines(true);
  dataViewTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  selectionModel=dataViewTable.getSelectionModel();
  selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  setColumnDefs();
  dataViewScrollPane.getViewport().add(dataViewTable);
  setupActionPanel();
  setUpFocusPanel();
  setUpIntNodePanel();
  JPanel sentenceSectionPanel=new JPanel();
  sentenceSectionPanel.setLayout(new BorderLayout());
  sentenceSectionPanel.add(this.focusDetailPanel,BorderLayout.PAGE_START);
  sentenceSectionPanel.add(dataViewScrollPane,BorderLayout.CENTER);
  this.previewPanel.setLayout(new BorderLayout());
  this.previewPanel.add(this.intNodeDetailPanel,BorderLayout.PAGE_START);
  this.previewPanel.add(this.sentencePreviewer,BorderLayout.CENTER);
  this.previewPanel.add(this.actionPanel,BorderLayout.PAGE_END);
  this.sentencePreviewer.setEditable(false);
  this.setBorder(BorderFactory.createLineBorder(Color.BLACK));
  this.setLayout(new GridLayout(1,2));
  this.add(sentenceSectionPanel);
  this.add(previewPanel);
  this.sentenceListener=new ISentenceStateChangeListener(){
    @Override public void stateChanged(    ISentenceStateChangeEvent e){
      dataViewTable.updateUI();
      updateButtons();
    }
  }
;
  this.nextActionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      int currSelectionIdx=getCurrentSelection() + 1;
      selectionModel.setSelectionInterval(currSelectionIdx,currSelectionIdx);
      int scrollOffset=dataViewTable.getRowHeight() * getCurrentSelection();
      dataViewScrollPane.getVerticalScrollBar().setValue(scrollOffset);
    }
  }
;
  this.prevActionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      int currSelectionIdx=getCurrentSelection() - 1;
      selectionModel.setSelectionInterval(currSelectionIdx,currSelectionIdx);
      int scrollOffset=dataViewTable.getRowHeight() * getCurrentSelection();
      dataViewScrollPane.getVerticalScrollBar().setValue(scrollOffset);
    }
  }
;
  this.interactingNodeCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setInteractingNodeValid(interactingNodeCheckBox.isSelected());
    }
  }
;
  this.focusCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setFocusNodeValid(focusCheckBox.isSelected());
    }
  }
;
  this.irrelevantCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setSentenceRelevant(!irrelevantCheckBox.isSelected());
    }
  }
;
  this.listSelectionListener=new ListSelectionListener(){
    @Override public void valueChanged(    ListSelectionEvent e){
      checkNavigatorButtonEnablement();
      currentSentence.removeSentenceStateChangeListener(sentenceListener);
      ISentence oldSentence=currentSentence;
      currentSentence=((SentenceRow)tableModel.getRow(getCurrentSelection())).getSentence();
      notifySentenceSelectionChanged(getCurrentSelection(),oldSentence,currentSentence);
      updateButtons();
      sentencePreviewer.setText(currentSentence.getMarkedUpSentence());
      intialiseIntNodeDetailPanel();
      if (intNodeSynonymJDialog.isVisible()) {
        intNodeSynonymJDialog.setSynonyms(currentSentence.getArc().getInteractingNode());
      }
      currentSentence.addSentenceStateChangeListener(sentenceListener);
    }
  }
;
}

Fixed version (ground truth):
public SentencesPanel(Dialog synonymDialog){
  this.listeners=new LinkedList<ISentenceSelectionChangeListener>();
  this.synonymDialog=synonymDialog;
  IRowDefn rowDefn=new SentenceRowDefinition();
  tableModel=new DataViewTableModel(rowDefn);
  tableColumnModel=new DefaultTableColumnModel();
  dataViewTable=new JTable(tableModel,tableColumnModel);
  dataViewTable.setAutoscrolls(true);
  dataViewTable.setShowHorizontalLines(true);
  dataViewTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  selectionModel=dataViewTable.getSelectionModel();
  selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  setColumnDefs();
  dataViewScrollPane.getViewport().add(dataViewTable);
  setupActionPanel();
  setUpFocusPanel();
  setUpIntNodePanel();
  JPanel sentenceSectionPanel=new JPanel();
  sentenceSectionPanel.setLayout(new BorderLayout());
  sentenceSectionPanel.add(this.focusDetailPanel,BorderLayout.PAGE_START);
  sentenceSectionPanel.add(dataViewScrollPane,BorderLayout.CENTER);
  this.previewPanel.setLayout(new BorderLayout());
  this.previewPanel.add(this.intNodeDetailPanel,BorderLayout.PAGE_START);
  this.previewPanel.add(this.sentencePreviewer,BorderLayout.CENTER);
  this.previewPanel.add(this.actionPanel,BorderLayout.PAGE_END);
  this.sentencePreviewer.setEditable(false);
  this.setBorder(BorderFactory.createLineBorder(Color.BLACK));
  this.setLayout(new GridLayout(1,2));
  this.add(sentenceSectionPanel);
  this.add(previewPanel);
  focusNodeSynonymJDialog=new SynonymDialog(this.synonymDialog);
  focusNodeSynonymJDialog.setPreferredSize(new Dimension(200,300));
  intNodeSynonymJDialog=new SynonymDialog(this.synonymDialog);
  intNodeSynonymJDialog.setPreferredSize(new Dimension(200,300));
  this.sentenceListener=new ISentenceStateChangeListener(){
    @Override public void stateChanged(    ISentenceStateChangeEvent e){
      dataViewTable.updateUI();
      updateButtons();
    }
  }
;
  this.nextActionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      int currSelectionIdx=getCurrentSelection() + 1;
      selectionModel.setSelectionInterval(currSelectionIdx,currSelectionIdx);
      int scrollOffset=dataViewTable.getRowHeight() * getCurrentSelection();
      dataViewScrollPane.getVerticalScrollBar().setValue(scrollOffset);
    }
  }
;
  this.prevActionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      int currSelectionIdx=getCurrentSelection() - 1;
      selectionModel.setSelectionInterval(currSelectionIdx,currSelectionIdx);
      int scrollOffset=dataViewTable.getRowHeight() * getCurrentSelection();
      dataViewScrollPane.getVerticalScrollBar().setValue(scrollOffset);
    }
  }
;
  this.interactingNodeCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setInteractingNodeValid(interactingNodeCheckBox.isSelected());
    }
  }
;
  this.focusCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setFocusNodeValid(focusCheckBox.isSelected());
    }
  }
;
  this.irrelevantCheckBoxListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      currentSentence.setSentenceRelevant(!irrelevantCheckBox.isSelected());
    }
  }
;
  this.listSelectionListener=new ListSelectionListener(){
    @Override public void valueChanged(    ListSelectionEvent e){
      checkNavigatorButtonEnablement();
      currentSentence.removeSentenceStateChangeListener(sentenceListener);
      ISentence oldSentence=currentSentence;
      currentSentence=((SentenceRow)tableModel.getRow(getCurrentSelection())).getSentence();
      notifySentenceSelectionChanged(getCurrentSelection(),oldSentence,currentSentence);
      updateButtons();
      sentencePreviewer.setText(currentSentence.getMarkedUpSentence());
      intialiseIntNodeDetailPanel();
      if (intNodeSynonymJDialog.isVisible()) {
        intNodeSynonymJDialog.setSynonyms(currentSentence.getArc().getInteractingNode());
      }
      currentSentence.addSentenceStateChangeListener(sentenceListener);
    }
  }
;
}