nus-yam/ex-repair huggingface dataset:
Program: 131073
Project: 131073
Buggy source:
private static void getAccounts(){
  String query="String_Node_Str";
  List<ResultSetRow> rows=DbManager.getInstance().executeCursorStatement(query);
  for (  ResultSetRow row : rows) {
    String name=(String)row.get("String_Node_Str");
    AwsAccount account=new AwsAccount((Integer)row.get("String_Node_Str"),name,(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"));
    accountMap.put(name,account);
    accountList.addElement(name);
    currentAccount=account;
  }
  prefix=currentAccount.getPrefix();
}

Fixed version (ground truth):
private static void getAccounts(){
  String query="String_Node_Str";
  List<ResultSetRow> rows=DbManager.getInstance().executeCursorStatement(query);
  for (  ResultSetRow row : rows) {
    String name=(String)row.get("String_Node_Str");
    AwsAccount account=new AwsAccount((Integer)row.get("String_Node_Str"),name,(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"));
    accountMap.put(name,account);
    accountList.addElement(name);
    currentAccount=account;
    String setActive="String_Node_Str" + currentAccount.getId();
    DbManager.getInstance().doInsertUpdate(setActive);
  }
  prefix=currentAccount.getPrefix();
}
Program: 131074
Project: 131074
Buggy source:
protected void updateChart(List<Map.Entry<String,Integer>> chartData){
  chartCards.removeAll();
  String style=styleGroup.getSelection().getActionCommand();
  String orientationCommand=orientationGroup.getSelection().getActionCommand();
  PlotOrientation orientation=PlotOrientation.VERTICAL;
  if (orientationCommand.contains("String_Node_Str")) {
    orientation=PlotOrientation.HORIZONTAL;
  }
  ChartPanel cp=ChartFactory.createChart(style,chartData,320,240,orientation);
  chartCards.add(cp,"String_Node_Str");
  chartCards.revalidate();
  for (int i=defaultTableModel.getRowCount() - 1; i >= 0; i--) {
    defaultTableModel.removeRow(i);
  }
  LegendItemCollection legendItems=((ChartPanel)chartCards.getComponent(0)).getChart().getPlot().getLegendItems();
  for (  Map.Entry entry : chartData) {
    Color col=null;
    String key=(String)entry.getKey();
    for (int i=0; i < legendItems.getItemCount(); i++) {
      LegendItem item=legendItems.get(i);
      if (item.getLabel().equalsIgnoreCase(key)) {
        col=(Color)item.getFillPaint();
      }
    }
    defaultTableModel.addRow(new Object[]{col,key,entry.getValue()});
  }
}

Fixed version (ground truth):
protected void updateChart(List<Map.Entry<String,Integer>> chartData){
  chartCards.removeAll();
  for (int i=defaultTableModel.getRowCount() - 1; i >= 0; i--) {
    defaultTableModel.removeRow(i);
  }
  if (chartData != null && chartData.size() > 0) {
    String style=styleGroup.getSelection().getActionCommand();
    String orientationCommand=orientationGroup.getSelection().getActionCommand();
    PlotOrientation orientation=PlotOrientation.VERTICAL;
    if (orientationCommand.contains("String_Node_Str")) {
      orientation=PlotOrientation.HORIZONTAL;
    }
    ChartPanel cp=ChartFactory.createChart(style,chartData,320,240,orientation);
    chartCards.add(cp,"String_Node_Str");
    chartCards.revalidate();
    LegendItemCollection legendItems=((ChartPanel)chartCards.getComponent(0)).getChart().getPlot().getLegendItems();
    for (    Map.Entry entry : chartData) {
      Color col=null;
      String key=(String)entry.getKey();
      for (int i=0; i < legendItems.getItemCount(); i++) {
        LegendItem item=legendItems.get(i);
        if (item.getLabel().equalsIgnoreCase(key)) {
          col=(Color)item.getFillPaint();
        }
      }
      defaultTableModel.addRow(new Object[]{col,key,entry.getValue()});
    }
  }
}
Program: 131077
Project: 131077
Buggy source:
@Override public Object getValueAt(int rowIndex,int columnIndex){
  Event event=getEventAt(rowIndex);
  Object value=null;
switch (columnIndex) {
case 0:
    value=TableUtils.getFormatedDateTime(event.getTimestamp());
  ;
break;
case 1:
value=TableUtils.getInvokedBy(event);
break;
case 2:
value=TableUtils.getService(event);
break;
case 3:
value=event.getEventName();
break;
case 4:
value=ResourceLookup.getResourceInfo(event).getTypes();
break;
case 5:
value=ResourceLookup.getResourceInfo(event).getNames();
break;
case 6:
value=event.getEventVersion();
break;
case 7:
value=event.getAwsRegion();
break;
case 8:
value=event.getSourceIPAddress();
break;
case 9:
value=event.getUserAgent();
break;
case 10:
value=event.getErrorCode();
break;
case 11:
value=event.getErrorMessage();
break;
case 12:
value=event.getRequestId();
break;
case 13:
value=event.getEventId();
break;
case 14:
value=event.getEventType();
break;
case 15:
value=event.getApiVersion();
break;
}
return value;
}

Fixed version (ground truth):
@Override public Object getValueAt(int rowIndex,int columnIndex){
  Event event=getEventAt(rowIndex);
  Object value=null;
switch (columnIndex) {
case 0:
    value=TableUtils.getFormatedDateTime(event.getTimestamp());
  break;
case 1:
value=TableUtils.getInvokedBy(event);
break;
case 2:
value=TableUtils.getService(event);
break;
case 3:
value=event.getEventName();
break;
case 4:
value=ResourceLookup.getResourceInfo(event).getTypes();
break;
case 5:
value=ResourceLookup.getResourceInfo(event).getNames();
break;
case 6:
value=event.getEventVersion();
break;
case 7:
value=event.getAwsRegion();
break;
case 8:
value=event.getSourceIPAddress();
break;
case 9:
value=event.getEventSource();
break;
case 10:
value=event.getUserAgent();
break;
case 11:
value=event.getErrorCode();
break;
case 12:
value=event.getErrorMessage();
break;
case 13:
value=event.getRequestId();
break;
case 14:
value=event.getEventId();
break;
case 15:
value=event.getEventType();
break;
case 16:
value=event.getApiVersion();
break;
}
return value;
}
Program: 131078
Project: 131078
Buggy source:
@Override public Void doInBackground(){
  int count=0;
  String query="String_Node_Str";
  List<ResultSetRow> results=DbManager.getInstance().executeCursorStatement(query);
  if (results.size() != 1) {
    return null;
  }
  ResultSetRow row=results.get(0);
  AWSCredentials credentials=new BasicAWSCredentials((String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"));
  AmazonS3 s3Client=new AmazonS3Client(credentials);
  String bucketName=(String)row.get("String_Node_Str");
  if (request.getFilter() == null) {
    request.setFilter(new AllFilter());
  }
  List<String> filenames=request.getFilenames();
  int total=filenames.size();
  for (  String filename : filenames) {
    count++;
    for (    EventLoaderListener l : listeners) {
      l.processingFile(count,total);
    }
    try (InputStream stream=loadEventFromS3(s3Client,bucketName,filename)){
      processStream(stream,request.getFilter());
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
    }
catch (    Exception e) {
      e.printStackTrace();
    }
  }
  for (  EventLoaderListener l : listeners) {
    l.finishedLoading();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(){
  int count=0;
  String query="String_Node_Str";
  List<ResultSetRow> results=DbManager.getInstance().executeCursorStatement(query);
  if (results.size() != 1) {
    return null;
  }
  ResultSetRow row=results.get(0);
  String key=(String)row.get("String_Node_Str");
  String secret=(String)row.get("String_Node_Str");
  AWSCredentials credentials=new BasicAWSCredentials(key,secret);
  AmazonS3 s3Client=new AmazonS3Client(credentials);
  String bucketName=(String)row.get("String_Node_Str");
  if (request.getFilter() == null) {
    request.setFilter(new AllFilter());
  }
  List<String> filenames=request.getFilenames();
  int total=filenames.size();
  for (  String filename : filenames) {
    count++;
    for (    EventLoaderListener l : listeners) {
      l.processingFile(count,total);
    }
    try (InputStream stream=loadEventFromS3(s3Client,bucketName,filename)){
      processStream(stream,request.getFilter());
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
    }
catch (    Exception e) {
      e.printStackTrace();
    }
  }
  for (  EventLoaderListener l : listeners) {
    l.finishedLoading();
  }
  return null;
}
Program: 131079
Project: 131079
Buggy source:
/** 
 * Loads events from S3
 * @param request 
 */
public void loadEventsFromS3(final LoadFileRequest request){
  SwingWorker worker=new SwingWorker<Void,Void>(){
    @Override public Void doInBackground(){
      int count=0;
      String query="String_Node_Str";
      List<ResultSetRow> results=DbManager.getInstance().executeCursorStatement(query);
      if (results.size() != 1) {
        return null;
      }
      ResultSetRow row=results.get(0);
      AWSCredentials credentials=new BasicAWSCredentials((String)row.get("String_Node_Str"),(String)row.get("String_Node_Str"));
      AmazonS3 s3Client=new AmazonS3Client(credentials);
      String bucketName=(String)row.get("String_Node_Str");
      if (request.getFilter() == null) {
        request.setFilter(new AllFilter());
      }
      List<String> filenames=request.getFilenames();
      int total=filenames.size();
      for (      String filename : filenames) {
        count++;
        for (        EventLoaderListener l : listeners) {
          l.processingFile(count,total);
        }
        try (InputStream stream=loadEventFromS3(s3Client,bucketName,filename)){
          processStream(stream,request.getFilter());
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
        }
catch (        Exception e) {
          e.printStackTrace();
        }
      }
      for (      EventLoaderListener l : listeners) {
        l.finishedLoading();
      }
      return null;
    }
  }
;
  worker.execute();
}

Fixed version (ground truth):
/** 
 * Loads events from S3
 * @param request 
 */
public void loadEventsFromS3(final LoadFileRequest request){
  SwingWorker worker=new SwingWorker<Void,Void>(){
    @Override public Void doInBackground(){
      int count=0;
      String query="String_Node_Str";
      List<ResultSetRow> results=DbManager.getInstance().executeCursorStatement(query);
      if (results.size() != 1) {
        return null;
      }
      ResultSetRow row=results.get(0);
      String key=(String)row.get("String_Node_Str");
      String secret=(String)row.get("String_Node_Str");
      AWSCredentials credentials=new BasicAWSCredentials(key,secret);
      AmazonS3 s3Client=new AmazonS3Client(credentials);
      String bucketName=(String)row.get("String_Node_Str");
      if (request.getFilter() == null) {
        request.setFilter(new AllFilter());
      }
      List<String> filenames=request.getFilenames();
      int total=filenames.size();
      for (      String filename : filenames) {
        count++;
        for (        EventLoaderListener l : listeners) {
          l.processingFile(count,total);
        }
        try (InputStream stream=loadEventFromS3(s3Client,bucketName,filename)){
          processStream(stream,request.getFilter());
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
        }
catch (        Exception e) {
          e.printStackTrace();
        }
      }
      for (      EventLoaderListener l : listeners) {
        l.finishedLoading();
      }
      return null;
    }
  }
;
  worker.execute();
}
Program: 131080
Project: 131080
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  JComboBox cb=(JComboBox)e.getSource();
  String newSelection=(String)cb.getSelectedItem();
  currentAccount=accountMap.get(newSelection);
  String update="String_Node_Str";
  DbManager.getInstance().doInsertUpdate(update);
  String setActive="String_Node_Str" + currentAccount.getId();
  DbManager.getInstance().doInsertUpdate(setActive);
  prefix=currentAccount.getPrefix();
  reloadContents();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  JComboBox cb=(JComboBox)e.getSource();
  String newSelection=(String)cb.getSelectedItem();
  if (newSelection != null) {
    currentAccount=accountMap.get(newSelection);
    String update="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(update);
    String setActive="String_Node_Str" + currentAccount.getId();
    DbManager.getInstance().doInsertUpdate(setActive);
    prefix=currentAccount.getPrefix();
    reloadContents();
  }
}
Program: 131082
Project: 131082
Buggy source:
private JToolBar getToolbar(){
  JToolBar toolbar=new JToolBar();
  toolbar.setFloatable(false);
  JButton btnHome=new JButton();
  ToolBarUtils.addImageToButton(btnHome,"String_Node_Str","String_Node_Str","String_Node_Str");
  btnHome.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent mouseEvent){
      prefix="String_Node_Str";
      reloadContents();
    }
  }
);
  toolbar.add(btnHome);
  JComboBox accountCombo=new JComboBox(accountList);
  accountCombo.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      JComboBox cb=(JComboBox)e.getSource();
      String newSelection=(String)cb.getSelectedItem();
      currentAccount=accountMap.get(newSelection);
      String update="String_Node_Str";
      DbManager.getInstance().doInsertUpdate(update);
      String setActive="String_Node_Str" + currentAccount.getId();
      DbManager.getInstance().doInsertUpdate(setActive);
      prefix=currentAccount.getPrefix();
      reloadContents();
    }
  }
);
  toolbar.add(accountCombo);
  return toolbar;
}

Fixed version (ground truth):
private JToolBar getToolbar(){
  JToolBar toolbar=new JToolBar();
  toolbar.setFloatable(false);
  JButton btnHome=new JButton();
  ToolBarUtils.addImageToButton(btnHome,"String_Node_Str","String_Node_Str","String_Node_Str");
  btnHome.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent mouseEvent){
      prefix="String_Node_Str";
      reloadContents();
    }
  }
);
  toolbar.add(btnHome);
  JComboBox accountCombo=new JComboBox(accountList);
  accountCombo.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      JComboBox cb=(JComboBox)e.getSource();
      String newSelection=(String)cb.getSelectedItem();
      if (newSelection != null) {
        currentAccount=accountMap.get(newSelection);
        String update="String_Node_Str";
        DbManager.getInstance().doInsertUpdate(update);
        String setActive="String_Node_Str" + currentAccount.getId();
        DbManager.getInstance().doInsertUpdate(setActive);
        prefix=currentAccount.getPrefix();
        reloadContents();
      }
    }
  }
);
  toolbar.add(accountCombo);
  return toolbar;
}
Program: 131083
Project: 131083
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if ("String_Node_Str".equals(e.getActionCommand())) {
    if (!isBucketValid() || !isKeyValid() || !isSecretValid()) {
      return;
    }
    account=new AwsAccount(0,name.getText(),bucket.getText(),key.getText(),String.valueOf(secret.getPassword()),"String_Node_Str");
  }
  AwsAccountDialog.dialog.setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if ("String_Node_Str".equals(e.getActionCommand())) {
    account=new AwsAccount(0,name.getText(),bucket.getText(),key.getText(),String.valueOf(secret.getPassword()),"String_Node_Str");
  }
  AwsAccountDialog.dialog.setVisible(false);
}
Program: 131084
Project: 131084
Buggy source:
/** 
 * Checks if there any any updates to the database required and applies them.
 */
public void sync(){
  Integer currentVersion=0;
  Connection dbTest=getDbConnection();
  if (dbTest == null) {
    System.out.println("String_Node_Str");
    String url=getDbUrl();
    Properties properties=new Properties();
    properties.put("String_Node_Str","String_Node_Str");
    try {
      DriverManager.getConnection(url,properties);
    }
 catch (    SQLException ex1) {
      Logger.getLogger(PreferencesController.class.getName()).log(Level.SEVERE,null,ex1);
    }
  }
 else {
    currentVersion=getCurrentDbVersion();
  }
  Connection conn=getDbConnection();
  if (conn != null) {
    Migrations.createVersion1(conn,currentVersion);
    Migrations.createVersion2(conn,currentVersion);
    Migrations.createVersion3(conn,currentVersion);
    Migrations.createVersion4(conn,currentVersion);
  }
}

Fixed version (ground truth):
/** 
 * Checks if there any any updates to the database required and applies them.
 */
public void sync(){
  CurrentDbVersion currentVersion=new CurrentDbVersion();
  Connection dbTest=getDbConnection();
  if (dbTest == null) {
    System.out.println("String_Node_Str");
    String url=getDbUrl();
    Properties properties=new Properties();
    properties.put("String_Node_Str","String_Node_Str");
    try {
      DriverManager.getConnection(url,properties);
    }
 catch (    SQLException ex1) {
      Logger.getLogger(PreferencesController.class.getName()).log(Level.SEVERE,null,ex1);
    }
  }
 else {
    currentVersion.setDbVersion(getCurrentDbVersion());
  }
  Connection conn=getDbConnection();
  if (conn != null) {
    Migrations.createVersion1(conn,currentVersion);
    Migrations.createVersion2(conn,currentVersion);
    Migrations.createVersion3(conn,currentVersion);
    Migrations.createVersion4(conn,currentVersion);
  }
}
Program: 131085
Project: 131085
Buggy source:
public static void createVersion4(Connection conn,Integer currentVersion){
  if (currentVersion < 4) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion=4;
  }
}

Fixed version (ground truth):
public static void createVersion4(Connection conn,CurrentDbVersion currentVersion){
  if (currentVersion.getDbVersion() < 4) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    StringBuilder query=new StringBuilder();
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    DbManager.getInstance().doInsertUpdate(query.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion.setDbVersion(4);
  }
}
Program: 131086
Project: 131086
Buggy source:
public static void createVersion3(Connection conn,Integer currentVersion){
  if (currentVersion < 3) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion=3;
  }
}

Fixed version (ground truth):
public static void createVersion3(Connection conn,CurrentDbVersion currentVersion){
  if (currentVersion.getDbVersion() < 3) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion.setDbVersion(3);
  }
}
Program: 131087
Project: 131087
Buggy source:
public static void createVersion2(Connection conn,Integer currentVersion){
  if (currentVersion < 2) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion=2;
  }
}

Fixed version (ground truth):
public static void createVersion2(Connection conn,CurrentDbVersion currentVersion){
  if (currentVersion.getDbVersion() < 2) {
    StringBuilder createVersionTable=new StringBuilder();
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    createVersionTable.append("String_Node_Str");
    DbManager.getInstance().doExecute(createVersionTable.toString());
    StringBuilder query=new StringBuilder();
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    query.append("String_Node_Str");
    DbManager.getInstance().doInsertUpdate(query.toString());
    String insertQuery="String_Node_Str";
    DbManager.getInstance().doInsertUpdate(insertQuery);
    currentVersion.setDbVersion(2);
  }
}
Program: 131089
Project: 131089
Buggy source:
public void eventLoadingComplete(){
  tableModel.orderTimeStamps();
  sideBar.eventLoadingComplete();
}

Fixed version (ground truth):
public void eventLoadingComplete(){
  sideBar.eventLoadingComplete();
}
Program: 131090
Project: 131090
Buggy source:
/** 
 * Adds a new Event to the database
 * @param event object to be added
 */
public void addEvent(Event event){
  events.add(event);
  if (this.statusBar != null) {
    this.statusBar.setLoadedEvents(this.events.size());
  }
  fireUpdate(event);
}

Fixed version (ground truth):
/** 
 * Adds a new Event to the database
 * @param event object to be added
 */
public void addEvent(Event event){
  events.add(event);
  Collections.sort(events,new TimeStampComparator());
  if (this.statusBar != null) {
    this.statusBar.setLoadedEvents(this.events.size());
  }
  fireUpdate(event);
}
Program: 131091
Project: 131091
Buggy source:
private void addInternal(Event event){
  if (filter.passesFilter(event)) {
    filteredEvents.add(event);
  }
}

Fixed version (ground truth):
private void addInternal(Event event){
  if (filter.passesFilter(event)) {
    filteredEvents.add(event);
    Collections.sort(filteredEvents,new TimeStampComparator());
  }
}
Program: 131092
Project: 131092
Buggy source:
/** 
 * Default Constructor
 */
public CloudTrailViewerApplication(){
  super("String_Node_Str");
  database=new FilteredEventDatabase(filter);
  eventLoader=new EventLoader(database);
  eventLoader.addEventLoaderListener(this);
  sidePanelToolBar=new SidePanelToolBar(this);
  featureToolBar=new FeatureToolBar(this);
  defineFeatures();
  buildUI();
}

Fixed version (ground truth):
/** 
 * Default Constructor
 */
public CloudTrailViewerApplication(){
  super("String_Node_Str");
  database=new FilteredEventDatabase(filter,statusBar);
  eventLoader=new EventLoader(database);
  eventLoader.addEventLoaderListener(this);
  sidePanelToolBar=new SidePanelToolBar(this);
  featureToolBar=new FeatureToolBar(this);
  defineFeatures();
  buildUI();
}
Program: 131093
Project: 131093
Buggy source:
private void buildStatusBar(){
  this.setBackground(Color.WHITE);
  JPanel leftSection=new JPanel();
  leftSection.add(loadedEvents);
  JPanel middleSection=new JPanel();
  middleSection.add(statusMessage);
  JPanel rightSection=new JPanel();
  rightSection.add(loadedEvents);
  this.setLayout(new GridLayout(0,3));
  this.add(leftSection);
  this.add(middleSection);
  this.add(rightSection);
  this.setVisible(true);
}

Fixed version (ground truth):
private void buildStatusBar(){
  JPanel leftSection=new JPanel();
  leftSection.add(loadedEvents);
  JPanel middleSection=new JPanel();
  middleSection.add(statusMessage);
  JPanel rightSection=new JPanel();
  rightSection.add(loadedEvents);
  this.setLayout(new GridLayout(0,3));
  this.add(leftSection);
  this.add(middleSection);
  this.add(rightSection);
  this.setVisible(true);
}
Program: 131094
Project: 131094
Buggy source:
/** 
 * Adds a new Event to the database
 * @param event object to be added
 */
public void addEvent(Event event){
  events.add(event);
  fireUpdate(event);
}

Fixed version (ground truth):
/** 
 * Adds a new Event to the database
 * @param event object to be added
 */
public void addEvent(Event event){
  events.add(event);
  if (this.statusBar != null) {
    this.statusBar.setLoadedEvents(this.events.size());
  }
  fireUpdate(event);
}
Program: 131095
Project: 131095
Buggy source:
/** 
 * Default Constructor
 * @param filter Filter to be use for filtering
 */
public FilteredEventDatabase(Filter filter){
  this.filter=filter;
  this.filter.addListener(this);
}

Fixed version (ground truth):
public FilteredEventDatabase(Filter filter,StatusBar sbar){
  super(sbar);
  this.filter=filter;
  this.filter.addListener(this);
}
Program: 131096
Project: 131096
Buggy source:
private ChartDialog(Frame frame){
  super(frame,"String_Node_Str",true);
  final JButton btnLoad=new JButton("String_Node_Str");
  btnLoad.setActionCommand("String_Node_Str");
  btnLoad.addActionListener(this);
  getRootPane().setDefaultButton(btnLoad);
  JButton btnCancel=new JButton("String_Node_Str");
  btnCancel.addActionListener(this);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.LINE_AXIS));
  buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  buttonPanel.add(Box.createHorizontalGlue());
  buttonPanel.add(btnCancel);
  buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
  buttonPanel.add(btnLoad);
  JPanel optionsPanel=new JPanel();
  optionsPanel.setLayout(new GridLayout(4,2));
  chartStyleCombo=new JComboBox(styles);
  chartSourceCombo=new JComboBox(sources);
  chartTypeCombo=new JComboBox(type);
  ignoreRootCheckBox=new JCheckBox();
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartStyleCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartSourceCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartTypeCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(ignoreRootCheckBox);
  Container contentPane=getContentPane();
  contentPane.add(optionsPanel,BorderLayout.CENTER);
  contentPane.add(buttonPanel,BorderLayout.PAGE_END);
  pack();
  setLocationRelativeTo(frame);
}

Fixed version (ground truth):
private ChartDialog(Frame frame){
  super(frame,"String_Node_Str",true);
  final JButton btnLoad=new JButton("String_Node_Str");
  btnLoad.setActionCommand("String_Node_Str");
  btnLoad.addActionListener(this);
  getRootPane().setDefaultButton(btnLoad);
  JButton btnCancel=new JButton("String_Node_Str");
  btnCancel.setActionCommand("String_Node_Str");
  btnCancel.addActionListener(this);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.LINE_AXIS));
  buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  buttonPanel.add(Box.createHorizontalGlue());
  buttonPanel.add(btnCancel);
  buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
  buttonPanel.add(btnLoad);
  JPanel optionsPanel=new JPanel();
  optionsPanel.setLayout(new GridLayout(4,2));
  chartStyleCombo=new JComboBox(styles);
  chartSourceCombo=new JComboBox(sources);
  chartTypeCombo=new JComboBox(type);
  chartTypeCombo.setActionCommand("String_Node_Str");
  chartTypeCombo.addActionListener(this);
  ignoreRootCheckBox=new JCheckBox();
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartStyleCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartSourceCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(chartTypeCombo);
  optionsPanel.add(new JLabel("String_Node_Str"));
  optionsPanel.add(ignoreRootCheckBox);
  Container contentPane=getContentPane();
  contentPane.add(optionsPanel,BorderLayout.CENTER);
  contentPane.add(buttonPanel,BorderLayout.PAGE_END);
  pack();
  setLocationRelativeTo(frame);
}
Program: 131097
Project: 131097
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if ("String_Node_Str".equals(e.getActionCommand())) {
    chartData=new ChartData();
    chartData.setChartSource(chartSourceCombo.getSelectedItem().toString());
    chartData.setChartStyle(chartStyleCombo.getSelectedItem().toString());
    chartData.setChartType(chartTypeCombo.getSelectedItem().toString());
    chartData.setIgnoreRoot(ignoreRootCheckBox.isSelected());
  }
  ChartDialog.dialog.setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  String actionCommand=e.getActionCommand();
switch (actionCommand) {
case "String_Node_Str":
    ChartDialog.dialog.setVisible(false);
  break;
case "String_Node_Str":
chartData=new ChartData();
chartData.setChartSource(chartSourceCombo.getSelectedItem().toString());
chartData.setChartStyle(chartStyleCombo.getSelectedItem().toString());
chartData.setChartType(chartTypeCombo.getSelectedItem().toString());
chartData.setIgnoreRoot(ignoreRootCheckBox.isSelected());
ChartDialog.dialog.setVisible(false);
break;
case "String_Node_Str":
System.out.println("String_Node_Str" + chartTypeCombo.getSelectedItem().toString());
break;
}
}
Program: 131098
Project: 131098
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  String actionCommand=e.getActionCommand();
switch (actionCommand) {
case "String_Node_Str":
    createChart();
  break;
case "String_Node_Str":
createAllEventsTable();
break;
case "String_Node_Str":
securityScan();
break;
}
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  String actionCommand=e.getActionCommand();
switch (actionCommand) {
case "String_Node_Str":
    showChart();
  break;
case "String_Node_Str":
showTable(false);
break;
case "String_Node_Str":
showTable(true);
break;
case "String_Node_Str":
securityScan();
break;
}
}
Program: 131100
Project: 131100
Buggy source:
@Override public void finishedLoading(){
  lblFirstEvent.setText(sdf.format(firstEvent));
  lblLastEvent.setText(sdf.format(lastEvent));
  newMessage("String_Node_Str");
}

Fixed version (ground truth):
@Override public void finishedLoading(){
  lblFirstEvent.setText(EventUtils.getFormatedDateTime(firstEvent));
  lblLastEvent.setText(EventUtils.getFormatedDateTime(lastEvent));
  newMessage("String_Node_Str");
}
Program: 131101
Project: 131101
Buggy source:
private void updateTextArea(){
  if (chartEvents != null) {
    int count=0;
    StringBuilder dataString=new StringBuilder();
    for (    Map.Entry entry : chartEvents) {
      if (count >= chartData.getTop()) {
        break;
      }
      dataString.append(entry.getKey()).append("String_Node_Str").append(entry.getValue()).append(AbstractInternalFrame.NEWLINE);
      count++;
    }
    tabbedTextArea.setText(dataString.toString());
  }
}

Fixed version (ground truth):
private void updateTextArea(){
  if (chartEvents != null && chartEvents.size() > 0) {
    int count=0;
    StringBuilder dataString=new StringBuilder();
    for (    Map.Entry entry : chartEvents) {
      if (count >= chartData.getTop()) {
        break;
      }
      dataString.append(entry.getKey()).append("String_Node_Str").append(entry.getValue()).append(AbstractInternalFrame.NEWLINE);
      count++;
    }
    tabbedTextArea.setText(dataString.toString());
  }
}
Program: 131102
Project: 131102
Buggy source:
private void createChart(){
  int count=chartData.getTop();
  if (chartEvents.size() < chartData.getTop()) {
    count=chartEvents.size();
  }
  List<Map.Entry<String,Integer>> topEvents=new ArrayList<>();
  for (int i=0; i < count; i++) {
    topEvents.add(chartEvents.get(i));
  }
  chartPanel=ChartCreator.createChart(topEvents,chartData);
  if (chartPanel != null) {
    chartPanel.addChartMouseListener(this);
  }
}

Fixed version (ground truth):
private void createChart(){
  if (chartEvents != null && chartEvents.size() > 0) {
    int count=chartData.getTop();
    if (chartEvents.size() < chartData.getTop()) {
      count=chartEvents.size();
    }
    List<Map.Entry<String,Integer>> topEvents=new ArrayList<>();
    for (int i=0; i < count; i++) {
      topEvents.add(chartEvents.get(i));
    }
    chartPanel=ChartCreator.createChart(topEvents,chartData);
    if (chartPanel != null) {
      chartPanel.addChartMouseListener(this);
    }
  }
}
Program: 131103
Project: 131103
Buggy source:
private void reloadTable(){
  for (int i=defaultTableModel.getRowCount() - 1; i >= 0; i--) {
    defaultTableModel.removeRow(i);
  }
  if (chartEvents != null && chartEvents.size() > 0) {
    int count=0;
    for (    Map.Entry entry : chartEvents) {
      defaultTableModel.addRow(new Object[]{entry.getKey(),entry.getValue()});
      count++;
      if (count >= chartData.getTop()) {
        break;
      }
    }
  }
}

Fixed version (ground truth):
private void reloadTable(){
  if (chartEvents != null && chartEvents.size() > 0) {
    for (int i=defaultTableModel.getRowCount() - 1; i >= 0; i--) {
      defaultTableModel.removeRow(i);
    }
    int count=0;
    for (    Map.Entry entry : chartEvents) {
      defaultTableModel.addRow(new Object[]{entry.getKey(),entry.getValue()});
      count++;
      if (count >= chartData.getTop()) {
        break;
      }
    }
  }
}
Program: 131104
Project: 131104
Buggy source:
@Override public void finishedLoading(){
  generateData(events);
  this.revalidate();
}

Fixed version (ground truth):
@Override public void finishedLoading(){
  generateData(events);
  createTpsChart();
  this.revalidate();
}
Program: 131105
Project: 131105
Buggy source:
@Override public void newEvents(List<Event> eventLoaderEvent){
  for (  Event event : eventLoaderEvent) {
    if (scanActions != null && scanActions.size() > 0 && scanActions.contains(event.getEventName())) {
      events.add(event);
    }
 else {
      filters.setFilterCriteria(scanNeedle);
      if (filters.passesFilter(event)) {
        events.add(event);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void newEvents(List<Event> eventLoaderEvent){
  for (  Event event : eventLoaderEvent) {
    if (scanActions != null && scanActions.size() > 0 && scanActions.contains(event.getEventName())) {
      events.add(event);
      eventsTableModel.addEvent(event);
    }
 else {
      filters.setFilterCriteria(scanNeedle);
      if (filters.passesFilter(event)) {
        events.add(event);
        eventsTableModel.addEvent(event);
      }
    }
  }
}
Program: 131106
Project: 131106
Buggy source:
private void buildUI(){
  this.setSize(640,480);
  final EventsTable table=new EventsTable(eventsTableModel);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    @Override public void valueChanged(    ListSelectionEvent e){
      if (e.getFirstIndex() >= 0) {
        Event event=eventsTableModel.getEventAt(table.getSelectedRow());
        showEventDetail(event);
      }
    }
  }
);
  table.setVisible(true);
  JButton btnShowChart=new JButton();
  btnShowChart.setActionCommand("String_Node_Str");
  btnShowChart.setToolTipText("String_Node_Str");
  try {
    ClassLoader cl=this.getClass().getClassLoader();
    btnShowChart.setIcon(new ImageIcon(cl.getResource("String_Node_Str")));
  }
 catch (  Exception e) {
    btnShowChart.setText("String_Node_Str");
  }
  btnShowChart.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      createAndShowChart();
    }
  }
);
  JToolBar toolbar=new JToolBar();
  toolbar.setFloatable(false);
  toolbar.add(btnShowChart);
  JScrollPane eventsScrollPane=new JScrollPane(table);
  JSplitPane split=new JSplitPane();
  split.add(eventsScrollPane,JSplitPane.LEFT);
  split.add(getEventDetailPanel(),JSplitPane.RIGHT);
  split.setOneTouchExpandable(true);
  split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  split.setDividerSize(2);
  split.setAutoscrolls(false);
  split.setDividerLocation(400);
  add(toolbar,BorderLayout.NORTH);
  add(split,BorderLayout.CENTER);
}

Fixed version (ground truth):
private void buildUI(){
  this.setSize(640,480);
  final EventsTable table=new EventsTable(eventsTableModel);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    @Override public void valueChanged(    ListSelectionEvent e){
      if (e.getFirstIndex() >= 0) {
        Event event=eventsTableModel.getEventAt(table.getSelectedRow());
        showEventDetail(event);
      }
    }
  }
);
  table.setVisible(true);
  JButton btnShowChart=new JButton();
  btnShowChart.setActionCommand("String_Node_Str");
  btnShowChart.setToolTipText("String_Node_Str");
  try {
    ClassLoader cl=this.getClass().getClassLoader();
    btnShowChart.setIcon(new ImageIcon(cl.getResource("String_Node_Str")));
  }
 catch (  Exception e) {
    btnShowChart.setText("String_Node_Str");
  }
  btnShowChart.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      createAndShowChart();
    }
  }
);
  JToolBar toolbar=new JToolBar();
  toolbar.setFloatable(false);
  toolbar.add(btnShowChart);
  JScrollPane eventsScrollPane=new JScrollPane(table);
  JSplitPane split=new JSplitPane();
  split.add(eventsScrollPane,JSplitPane.LEFT);
  split.add(getEventDetailPanel(),JSplitPane.RIGHT);
  split.setOneTouchExpandable(true);
  split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  split.setDividerSize(10);
  split.setAutoscrolls(false);
  split.setDividerLocation(this.getWidth() - 300);
  split.setResizeWeight(1.0);
  add(toolbar,BorderLayout.NORTH);
  add(split,BorderLayout.CENTER);
}
Program: 131107
Project: 131107
Buggy source:
@Override public void sourceUpdated(String newSource){
  chartData.setChartSource(newSource);
  updateChart();
}

Fixed version (ground truth):
@Override public void sourceUpdated(String newSource){
  chartData.setChartSource(newSource);
  updatePanel(chartData.getTop());
}
Program: 131108
Project: 131108
Buggy source:
@Override public void styleUpdated(String newStyle){
  chartData.setChartStyle(newStyle);
  updateChart();
}

Fixed version (ground truth):
@Override public void styleUpdated(String newStyle){
  chartData.setChartStyle(newStyle);
  updatePanel(chartData.getTop());
}
Program: 131109
Project: 131109
Buggy source:
@Override public void orientationUpdated(PlotOrientation newOrientation){
  chartData.setOrientation(newOrientation);
  updateChart();
}

Fixed version (ground truth):
@Override public void orientationUpdated(PlotOrientation newOrientation){
  chartData.setOrientation(newOrientation);
  updatePanel(chartData.getTop());
}
Program: 131110
Project: 131110
Buggy source:
/** 
 * Default contructor.
 */
public TriDataPanelMenu(){
  this.add(getTopMenu());
  this.add(getStyleMenu());
  this.add(getOrientationMenu());
  this.add(getSourceMenu());
}

Fixed version (ground truth):
/** 
 * Default constructor.
 */
public TriDataPanelMenu(){
  this.add(getTopMenu());
  this.add(getStyleMenu());
  this.add(getOrientationMenu());
  this.add(getSourceMenu());
}
Program: 131111
Project: 131111
Buggy source:
private void handleSourceActions(String actionCommand){
switch (actionCommand) {
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    fireSourceUpdated(actionCommand);
  break;
}
}

Fixed version (ground truth):
private void handleSourceActions(String actionCommand){
  fireSourceUpdated(actionCommand);
}
Program: 131112
Project: 131112
Buggy source:
/** 
 * Register a listener to the class.
 * @param l A class that implments TriDataPanelMenuListener
 */
public void addListener(TriDataPanelMenuListener l){
  listeners.add(l);
}

Fixed version (ground truth):
/** 
 * Register a listener to the class.
 * @param l A class that implements TriDataPanelMenuListener
 */
public void addListener(TriDataPanelMenuListener l){
  listeners.add(l);
}
Program: 131114
Project: 131114
Buggy source:
private String stripPrefix(String key){
  String stripped=key;
  if (this.prefix.trim().length() > 0) {
    int prefixLength=this.prefix.length() - 1;
    stripped=key.substring(prefixLength,key.length());
    int firstSlash=stripped.indexOf("String_Node_Str");
    if (firstSlash == 0) {
      stripped=stripped.substring(1,stripped.length());
    }
  }
  return stripped;
}

Fixed version (ground truth):
private String stripPrefix(String key){
  String stripped=key;
  if (S3FileChooserDialog.prefix.trim().length() > 0) {
    int prefixLength=S3FileChooserDialog.prefix.length() - 1;
    stripped=key.substring(prefixLength,key.length());
    int firstSlash=stripped.indexOf("String_Node_Str");
    if (firstSlash == 0) {
      stripped=stripped.substring(1,stripped.length());
    }
  }
  return stripped;
}
Program: 131115
Project: 131115
Buggy source:
public static List<String> showDialog(Component parent){
  String s3_location=PropertiesSingleton.getInstance().getProperty("String_Node_Str");
  if (s3_location != null) {
    prefix=s3_location;
  }
  Frame frame=JOptionPane.getFrameForComponent(parent);
  dialog=new S3FileChooserDialog(frame);
  dialog.setVisible(true);
  return selectedKeys;
}

Fixed version (ground truth):
public static List<String> showDialog(Component parent){
  selectedKeys.clear();
  String s3_location=PropertiesSingleton.getInstance().getProperty("String_Node_Str");
  if (s3_location != null) {
    prefix=s3_location;
  }
  Frame frame=JOptionPane.getFrameForComponent(parent);
  dialog=new S3FileChooserDialog(frame);
  dialog.setVisible(true);
  return selectedKeys;
}
Program: 131116
Project: 131116
Buggy source:
private void addSelectedKeys(){
  List<String> selectedItems=s3List.getSelectedValuesList();
  for (  String key : selectedItems) {
    selectedKeys.add(this.prefix + key);
  }
}

Fixed version (ground truth):
private void addSelectedKeys(){
  List<String> selectedItems=s3List.getSelectedValuesList();
  for (  String key : selectedItems) {
    selectedKeys.add(S3FileChooserDialog.prefix + key);
  }
}
Program: 131117
Project: 131117
Buggy source:
private void showEventsByServiceChart(){
  if (eventsDatabase.getEventsPerService().size() > 0) {
    ChartData chartData=new ChartData();
    chartData.setChartStyle("String_Node_Str");
    chartData.setChartSource("String_Node_Str");
    List<Map.Entry<String,Integer>> events=EventUtils.entriesSortedByValues(eventsDatabase.getEventsPerService());
    ChartWindow chart=new ChartWindow(chartData,events);
    chart.setVisible(true);
    jCloudTrailViewer.DESKTOP.add(chart);
    try {
      chart.setSelected(true);
    }
 catch (    java.beans.PropertyVetoException pve) {
    }
  }
 else {
    JOptionPane.showMessageDialog(jCloudTrailViewer.DESKTOP,"String_Node_Str","String_Node_Str",JOptionPane.WARNING_MESSAGE);
  }
}

Fixed version (ground truth):
private void showEventsByServiceChart(){
  if (eventsDatabase.getEventsPerService().size() > 0) {
    ChartData chartData=new ChartData();
    chartData.setChartStyle("String_Node_Str");
    chartData.setChartSource("String_Node_Str");
    chartData.setTop(5);
    ChartWindow chart=new ChartWindow(chartData,eventsDatabase.getEvents());
    chart.setVisible(true);
    jCloudTrailViewer.DESKTOP.add(chart);
    try {
      chart.setSelected(true);
    }
 catch (    java.beans.PropertyVetoException pve) {
    }
  }
 else {
    JOptionPane.showMessageDialog(jCloudTrailViewer.DESKTOP,"String_Node_Str","String_Node_Str",JOptionPane.WARNING_MESSAGE);
  }
}
Program: 131119
Project: 131119
Buggy source:
private void updateChartEvents(boolean chart3d){
  generateInitialChartData();
  updateChart(chart3d);
}

Fixed version (ground truth):
private void updateChartEvents(String style,boolean chart3d){
  chartData.setChartStyle(style);
  generateInitialChartData();
  updateChart(chart3d);
}
Program: 131120
Project: 131120
Buggy source:
private void createChart(boolean chart3d){
  if (mnuPie.getState() || mnuPie3d.getState()) {
    chartPanel=ChartCreator.createTopPieChart(chartData.getTop(),chartEvents,chart3d);
  }
 else   if (mnuBar.getState() || mnuBar3d.getState()) {
    chartPanel=ChartCreator.createBarChart(chartData.getTop(),chartEvents,chartData.getChartSource(),"String_Node_Str",PlotOrientation.VERTICAL,chart3d);
  }
  if (chartPanel != null) {
    chartPanel.addChartMouseListener(this);
  }
}

Fixed version (ground truth):
private void createChart(boolean chart3d){
  if (mnuPie.isSelected() || mnuPie3d.isSelected()) {
    chartPanel=ChartCreator.createTopPieChart(chartData.getTop(),chartEvents,chart3d);
  }
 else   if (mnuBar.isSelected() || mnuBar3d.isSelected()) {
    chartPanel=ChartCreator.createBarChart(chartData.getTop(),chartEvents,chartData.getChartSource(),"String_Node_Str",PlotOrientation.VERTICAL,chart3d);
  }
  if (chartPanel != null) {
    chartPanel.addChartMouseListener(this);
  }
}
Program: 131121
Project: 131121
Buggy source:
private void buildDisplay(boolean showMenu){
  this.setLayout(new BorderLayout());
  if (chartData.getTop() == 5) {
    mnuTop5.setState(true);
  }
 else   if (chartData.getTop() == 10) {
    mnuTop10.setState(true);
  }
  if (chartData.getChartStyle().equalsIgnoreCase("String_Node_Str")) {
    mnuPie.setState(true);
  }
 else   if (chartData.getChartStyle().equalsIgnoreCase("String_Node_Str")) {
    mnuBar.setState(true);
  }
  createChart(false);
  if (chartPanel != null) {
    tabs.addTab("String_Node_Str",chartPanel);
  }
  defaultTableModel.addColumn("String_Node_Str");
  defaultTableModel.addColumn("String_Node_Str");
  JTable table=new JTable(defaultTableModel);
  JScrollPane tablecrollPane=new JScrollPane(table);
  reloadTable();
  tabs.addTab("String_Node_Str",tablecrollPane);
  updateTextArea();
  JScrollPane tabbedDataScrollPane=new JScrollPane(tabbedTextArea);
  tabs.addTab("String_Node_Str",tabbedDataScrollPane);
  if (showMenu) {
    this.add(getChartMenu(),BorderLayout.NORTH);
  }
  this.add(tabs,BorderLayout.CENTER);
}

Fixed version (ground truth):
private void buildDisplay(boolean showMenu){
  this.setLayout(new BorderLayout());
  selectInitialMenus();
  createChart(false);
  if (chartPanel != null) {
    tabs.addTab("String_Node_Str",chartPanel);
  }
  defaultTableModel.addColumn("String_Node_Str");
  defaultTableModel.addColumn("String_Node_Str");
  JTable table=new JTable(defaultTableModel);
  JScrollPane tablecrollPane=new JScrollPane(table);
  reloadTable();
  tabs.addTab("String_Node_Str",tablecrollPane);
  updateTextArea();
  JScrollPane tabbedDataScrollPane=new JScrollPane(tabbedTextArea);
  tabs.addTab("String_Node_Str",tabbedDataScrollPane);
  if (showMenu) {
    this.add(getChartMenu(),BorderLayout.NORTH);
  }
  this.add(tabs,BorderLayout.CENTER);
}