Program: 131146
Project: 131146
Buggy source:
private void buildUI(){
  this.setSize(640,480);
  JButton btnShowChart=new JButton();
  btnShowChart.setActionCommand("String_Node_Str");
  btnShowChart.setToolTipText("String_Node_Str");
  try {
    URL imageUrl=jCloudTrailViewer.class.getResource("String_Node_Str");
    btnShowChart.setIcon(new ImageIcon(imageUrl));
  }
 catch (  Exception e) {
    btnShowChart.setText("String_Node_Str");
  }
  btnShowChart.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      List<Event> events=null;
      int tabId=tabs.getSelectedIndex();
switch (tabId) {
case 0:
        events=errorTableModel.getEvents();
      break;
case 1:
    events=iamTableModel.getEvents();
  break;
case 2:
events=securityTableModel.getEvents();
break;
}
if (events != null) {
ChartData chartData=ChartDialog.showDialog(jCloudTrailViewer.DESKTOP);
if (chartData != null) {
List<Map.Entry<String,Integer>> chartMetrics=eventUtils.getRequiredEvents(events,chartData);
ChartWindow chart=new ChartWindow(chartData,chartMetrics);
chart.setVisible(true);
jCloudTrailViewer.DESKTOP.add(chart);
try {
chart.setSelected(true);
}
 catch (java.beans.PropertyVetoException pve) {
}
}
}
}
}
);
JToolBar toolbar=new JToolBar();
toolbar.setFloatable(false);
toolbar.add(btnShowChart);
final EventsTable errorTable=new EventsTable(errorTableModel);
errorTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=errorTableModel.getEventAt(errorTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
errorTable.setVisible(true);
JScrollPane errorScrollPane=new JScrollPane(errorTable);
final EventsTable iamTable=new EventsTable(iamTableModel);
iamTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=iamTableModel.getEventAt(iamTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
iamTable.setVisible(true);
JScrollPane iamScrollPane=new JScrollPane(iamTable);
final EventsTable securityTable=new EventsTable(securityTableModel);
securityTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=securityTableModel.getEventAt(securityTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
securityTable.setVisible(true);
JScrollPane securityScrollPane=new JScrollPane(securityTable);
tabs.add("String_Node_Str",errorScrollPane);
tabs.add("String_Node_Str",iamScrollPane);
tabs.add("String_Node_Str",securityScrollPane);
JSplitPane split=new JSplitPane();
split.add(tabs,JSplitPane.LEFT);
split.add(getEventDetailPanel(),JSplitPane.RIGHT);
split.setOneTouchExpandable(true);
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setDividerSize(2);
split.setAutoscrolls(false);
split.setDividerLocation(400);
addStatusBar();
add(toolbar,BorderLayout.NORTH);
add(split,BorderLayout.CENTER);
}

Fixed version (ground truth):
private void buildUI(){
  this.setSize(640,480);
  JButton btnShowChart=new JButton();
  btnShowChart.setActionCommand("String_Node_Str");
  btnShowChart.setToolTipText("String_Node_Str");
  try {
    URL imageUrl=jCloudTrailViewer.class.getResource("String_Node_Str");
    btnShowChart.setIcon(new ImageIcon(imageUrl));
  }
 catch (  Exception e) {
    btnShowChart.setText("String_Node_Str");
  }
  btnShowChart.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      List<Event> events=null;
      int tabId=tabs.getSelectedIndex();
switch (tabId) {
case 0:
        events=errorTableModel.getEvents();
      break;
case 1:
    events=iamTableModel.getEvents();
  break;
case 2:
events=securityTableModel.getEvents();
break;
}
if (events != null) {
ChartData chartData=ChartDialog.showDialog(jCloudTrailViewer.DESKTOP);
if (chartData != null) {
ChartWindow chart=new ChartWindow(chartData,events);
chart.setVisible(true);
jCloudTrailViewer.DESKTOP.add(chart);
try {
chart.setSelected(true);
}
 catch (java.beans.PropertyVetoException pve) {
}
}
}
}
}
);
JToolBar toolbar=new JToolBar();
toolbar.setFloatable(false);
toolbar.add(btnShowChart);
final EventsTable errorTable=new EventsTable(errorTableModel);
errorTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=errorTableModel.getEventAt(errorTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
errorTable.setVisible(true);
JScrollPane errorScrollPane=new JScrollPane(errorTable);
final EventsTable iamTable=new EventsTable(iamTableModel);
iamTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=iamTableModel.getEventAt(iamTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
iamTable.setVisible(true);
JScrollPane iamScrollPane=new JScrollPane(iamTable);
final EventsTable securityTable=new EventsTable(securityTableModel);
securityTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@Override public void valueChanged(ListSelectionEvent e){
if (e.getFirstIndex() >= 0) {
Event event=securityTableModel.getEventAt(securityTable.getSelectedRow());
showEventDetail(event);
}
}
}
);
securityTable.setVisible(true);
JScrollPane securityScrollPane=new JScrollPane(securityTable);
tabs.add("String_Node_Str",errorScrollPane);
tabs.add("String_Node_Str",iamScrollPane);
tabs.add("String_Node_Str",securityScrollPane);
JSplitPane split=new JSplitPane();
split.add(tabs,JSplitPane.LEFT);
split.add(getEventDetailPanel(),JSplitPane.RIGHT);
split.setOneTouchExpandable(true);
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setDividerSize(2);
split.setAutoscrolls(false);
split.setDividerLocation(400);
addStatusBar();
add(toolbar,BorderLayout.NORTH);
add(split,BorderLayout.CENTER);
}