nus-yam/ex-repair huggingface dataset:
Program: 131024
Project: 131024
Buggy source:
/** 
 * Gets the TileEntity for a given block in this chunk
 */
@Override public TileEntity getTileEntity(int x,int y,int z){
  ChunkPosition chunkposition=new ChunkPosition(x,y,z);
  TileEntity tileentity=chunkTileEntityMap.get(chunkposition);
  if (tileentity != null && tileentity.isInvalid()) {
    chunkTileEntityMap.remove(chunkposition);
    tileentity=null;
  }
  if (tileentity == null) {
    Block block=getBlock(x,y,z);
    int meta=getBlockMetadata(x,y,z);
    if (block == null || !block.hasTileEntity(meta)) {
      return null;
    }
    tileentity=block.createTileEntity(worldObj,meta);
    setTileEntity(x,y,z,tileentity);
    tileentity=chunkTileEntityMap.get(chunkposition);
  }
  return tileentity;
}

Fixed version (ground truth):
/** 
 * Gets the TileEntity for a given block in this chunk
 */
@Override public TileEntity getTileEntity(int x,int y,int z){
  ChunkPosition chunkposition=new ChunkPosition(x,y,z);
  TileEntity tileentity=chunkTileEntityMap.get(chunkposition);
  if (tileentity == null) {
    Block block=getBlock(x,y,z);
    int meta=getBlockMetadata(x,y,z);
    if (block == null || !block.hasTileEntity(meta)) {
      return null;
    }
    tileentity=block.createTileEntity(worldObj,meta);
    setTileEntity(x,y,z,tileentity);
    tileentity=chunkTileEntityMap.get(chunkposition);
  }
  return tileentity;
}
Program: 131025
Project: 131025
Buggy source:
public void setTileEntity(int x,int y,int z,TileEntity tileentity){
  if (tileentity == null || tileentity.isInvalid()) {
    return;
  }
  setChunkBlockTileEntity(x,y,z,tileentity);
}

Fixed version (ground truth):
public void setTileEntity(int x,int y,int z,TileEntity tileentity){
  if (tileentity == null) {
    return;
  }
  setChunkBlockTileEntity(x,y,z,tileentity);
}
Program: 131026
Project: 131026
Buggy source:
/** 
 * Sets the TileEntity for a given block in this chunk
 */
private void setChunkBlockTileEntity(int x,int y,int z,TileEntity tileentity){
  ChunkPosition chunkposition=new ChunkPosition(x,y,z);
  tileentity.setWorldObj(worldObj);
  int ox=tileentity.xCoord;
  int oy=tileentity.yCoord;
  int oz=tileentity.zCoord;
  tileentity.xCoord=x;
  tileentity.yCoord=y;
  tileentity.zCoord=z;
  Block block=getBlock(x,y,z);
  if (block != null && block.hasTileEntity(getBlockMetadata(x,y,z))) {
    if (chunkTileEntityMap.containsKey(chunkposition)) {
      chunkTileEntityMap.get(chunkposition).invalidate();
    }
    tileentity.blockMetadata=getBlockMetadata(x,y,z);
    tileentity.validate();
    chunkTileEntityMap.put(chunkposition,tileentity);
    if (tileentity instanceof IShipTileEntity) {
      ((IShipTileEntity)tileentity).setParentShip(entityShip,ox,oy,oz);
    }
    if (isChunkLoaded) {
      worldObj.addTileEntity(tileentity);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the TileEntity for a given block in this chunk
 */
private void setChunkBlockTileEntity(int x,int y,int z,TileEntity tileentity){
  ChunkPosition chunkposition=new ChunkPosition(x,y,z);
  tileentity.setWorldObj(worldObj);
  int ox=tileentity.xCoord;
  int oy=tileentity.yCoord;
  int oz=tileentity.zCoord;
  tileentity.xCoord=x;
  tileentity.yCoord=y;
  tileentity.zCoord=z;
  Block block=getBlock(x,y,z);
  if (block != null && block.hasTileEntity(getBlockMetadata(x,y,z))) {
    tileentity.blockMetadata=getBlockMetadata(x,y,z);
    tileentity.invalidate();
    chunkTileEntityMap.put(chunkposition,tileentity);
    if (tileentity instanceof IShipTileEntity) {
      ((IShipTileEntity)tileentity).setParentShip(entityShip,ox,oy,oz);
    }
  }
}
Program: 131027
Project: 131027
Buggy source:
public void finishedLoading(boolean reload){
  StringBuilder output=new StringBuilder();
  int highestCount=0;
  String centerPoint="String_Node_Str";
  for (  Map.Entry<String,String> entry : latlngs.entrySet()) {
    List<AwsData> events=keyValueMap.get(entry.getValue());
    output.append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append(events.size()).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
    output.append("String_Node_Str");
    String cityName=entry.getValue();
    if (cityName != null && cityName.trim().length() > 0) {
      int totalEvents=events.size();
      if (totalEvents > highestCount) {
        centerPoint=entry.getKey();
        highestCount=totalEvents;
      }
    }
  }
  String html=getHTML();
  html=html.replaceAll("String_Node_Str",output.toString());
  html=html.replaceAll("String_Node_Str",centerPoint);
  writeGeoDataHtml(html);
  String htmlFileUri=new File(FileUtils.getFullPathToFile(HTML_FILENAME)).toURI().toString();
  webEngine.load(htmlFileUri);
}

Fixed version (ground truth):
public void finishedLoading(boolean reload){
  StringBuilder output=new StringBuilder();
  int highestCount=0;
  String centerPoint="String_Node_Str";
  for (  Map.Entry<String,String> entry : latlngs.entrySet()) {
    List<AwsData> events=keyValueMap.get(entry.getValue());
    if (!entry.getValue().contains("String_Node_Str")) {
      output.append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append(events.size()).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
      output.append("String_Node_Str");
      String cityName=entry.getValue();
      if (cityName != null && cityName.trim().length() > 0) {
        int totalEvents=events.size();
        if (totalEvents > highestCount) {
          centerPoint=entry.getKey();
          highestCount=totalEvents;
        }
      }
    }
  }
  String html=getHTML();
  html=html.replaceAll("String_Node_Str",output.toString());
  html=html.replaceAll("String_Node_Str",centerPoint);
  writeGeoDataHtml(html);
  String htmlFileUri=new File(FileUtils.getFullPathToFile(HTML_FILENAME)).toURI().toString();
  webEngine.load(htmlFileUri);
}
Program: 131028
Project: 131028
Buggy source:
private void addToKeyValueMap(Event event){
  try {
    String propertyValue=EventUtils.getEventProperty(this.widget.getSeriesField(),event);
    if (propertyValue != null) {
      List<Event> events;
      if (!keyValueMap.containsKey(propertyValue)) {
        events=new ArrayList<>();
      }
 else {
        events=keyValueMap.get(propertyValue);
      }
      events.add(event);
      keyValueMap.put(propertyValue,events);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void addToKeyValueMap(Event event){
  try {
    String propertyValue=EventUtils.getEventProperty(this.widget.getSeriesField(),event);
    if (propertyValue != null) {
      List<Event> events=keyValueMap.get(propertyValue);
      if (events == null) {
        events=new ArrayList<>();
      }
      events.add(event);
      keyValueMap.put(propertyValue,events);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str");
  }
}
Program: 131029
Project: 131029
Buggy source:
public void newEvent(Event event){
  allEvents.add(event);
  try {
    String latLng=event.getLatLng();
    if (latLng != null && !latlngs.containsKey(latLng)) {
      String propertyValue=EventUtils.getEventProperty(this.widget.getSeriesField(),event);
      latlngs.put(latLng,propertyValue);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str");
  }
  addToKeyValueMap(event);
}

Fixed version (ground truth):
public void newEvent(Event event){
  allEvents.add(event);
  try {
    String latLng=event.getLatLng();
    if (latLng != null && latLng.length() > 0 && !latlngs.containsKey(latLng)) {
      String propertyValue=EventUtils.getEventProperty(this.widget.getSeriesField(),event);
      latlngs.put(latLng,propertyValue);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str");
  }
  addToKeyValueMap(event);
}
Program: 131030
Project: 131030
Buggy source:
public void finishedLoading(boolean reload){
  StringBuilder output=new StringBuilder();
  int highestCount=0;
  String centerPoint="String_Node_Str";
  for (  Map.Entry<String,String> entry : latlngs.entrySet()) {
    List<Event> events=keyValueMap.get(entry.getValue());
    output.append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append(events.size()).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
    output.append("String_Node_Str");
    String cityName=entry.getValue();
    if (cityName != null && cityName.trim().length() > 0) {
      int totalEvents=events.size();
      if (totalEvents > highestCount) {
        centerPoint=entry.getKey();
        highestCount=totalEvents;
      }
    }
  }
  String html=getHTML();
  html=html.replaceAll("String_Node_Str",output.toString());
  html=html.replaceAll("String_Node_Str",centerPoint);
  writeGeoDataHtml(html);
  webEngine.load("String_Node_Str" + FileUtils.getFullPathToFile(HTML_FILENAME));
}

Fixed version (ground truth):
public void finishedLoading(boolean reload){
  StringBuilder output=new StringBuilder();
  int highestCount=0;
  String centerPoint="String_Node_Str";
  for (  Map.Entry<String,String> entry : latlngs.entrySet()) {
    List<Event> events=keyValueMap.get(entry.getValue());
    output.append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append(events.size()).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str");
    output.append("String_Node_Str");
    String cityName=entry.getValue();
    if (cityName != null && cityName.trim().length() > 0) {
      int totalEvents=events.size();
      if (totalEvents > highestCount) {
        centerPoint=entry.getKey();
        highestCount=totalEvents;
      }
    }
  }
  String html=getHTML();
  html=html.replaceAll("String_Node_Str",output.toString());
  html=html.replaceAll("String_Node_Str",centerPoint);
  writeGeoDataHtml(html);
  String htmlFileUri=new File(FileUtils.getFullPathToFile(HTML_FILENAME)).toURI().toString();
  webEngine.load(htmlFileUri);
}
Program: 131032
Project: 131032
Buggy source:
private void processStream(InputStream stream,CompositeFilter filter){
  List<Event> events=createEvents(uncompress(stream));
  for (  Event event : events) {
    geoService.populateGeoData(event);
    EventUtils.addTimestamp(event);
    if (filter.passes(event)) {
      eventDb.add(event);
      for (      EventServiceListener l : listeners) {
        l.newEvent(event);
      }
    }
  }
}

Fixed version (ground truth):
private void processStream(InputStream stream,CompositeFilter filter){
  List<Event> events=createEvents(uncompress(stream));
  for (  Event event : events) {
    EventUtils.addTimestamp(event);
    if (filter.passes(event)) {
      try {
        geoService.populateGeoData(event);
      }
 catch (      Exception e) {
        LOGGER.log(Level.WARNING,"String_Node_Str");
      }
      eventDb.add(event);
      for (      EventServiceListener l : listeners) {
        l.newEvent(event);
      }
    }
  }
}
Program: 131033
Project: 131033
Buggy source:
CityResponse getCityResponse(InetAddress ipAddress) throws GeoIp2Exception, IOException {
  return reader.city(ipAddress);
}

Fixed version (ground truth):
CityResponse getCityResponse(InetAddress ipAddress) throws GeoIp2Exception, IOException, AddressNotFoundException {
  return reader.city(ipAddress);
}
Program: 131034
Project: 131034
Buggy source:
/** 
 * Returns the full path to the CloudTrail Viewer directory within the System defined user.home.
 * @return Full path to cloudtrailviewer directory ending in a forward slash '/'
 */
public static String getApplicationDirectory(){
  return System.getProperty("String_Node_Str","String_Node_Str") + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the full path to the CloudTrail Viewer directory within the System defined user.home.
 * @return Full path to cloudtrailviewer directory ending in a forward slash '/'
 */
public static String getApplicationDirectory(){
  StringBuilder appDir=new StringBuilder().append(System.getProperty("String_Node_Str","String_Node_Str")).append(File.separator).append("String_Node_Str").append(File.separator);
  return appDir.toString();
}
Program: 131035
Project: 131035
Buggy source:
@FXML private void doSecurity(){
  dashboardService.addWidgetToDashboard(new DashboardWidget("String_Node_Str"));
}

Fixed version (ground truth):
@FXML private void doSecurity(){
  DashboardWidget newWidget=new DashboardWidget("String_Node_Str");
  configureFixedWidgets(newWidget);
  newWidget.setTitle("String_Node_Str");
  newWidget.setSeriesField("String_Node_Str");
  dashboardService.addWidgetToDashboard(newWidget);
}
Program: 131036
Project: 131036
Buggy source:
@FXML private void doError(){
  dashboardService.addWidgetToDashboard(new DashboardWidget("String_Node_Str"));
}

Fixed version (ground truth):
@FXML private void doError(){
  DashboardWidget newWidget=new DashboardWidget("String_Node_Str");
  configureFixedWidgets(newWidget);
  newWidget.setTitle("String_Node_Str");
  newWidget.setSeriesField("String_Node_Str");
  dashboardService.addWidgetToDashboard(newWidget);
}
Program: 131037
Project: 131037
Buggy source:
@FXML private void doResource(){
  dashboardService.addWidgetToDashboard(new DashboardWidget("String_Node_Str"));
}

Fixed version (ground truth):
@FXML private void doResource(){
  DashboardWidget newWidget=new DashboardWidget("String_Node_Str");
  configureFixedWidgets(newWidget);
  newWidget.setTitle("String_Node_Str");
  newWidget.setSeriesField("String_Node_Str");
  dashboardService.addWidgetToDashboard(newWidget);
}
Program: 131038
Project: 131038
Buggy source:
@Override public void updateItem(S3ListModel model,boolean empty){
  super.updateItem(model,empty);
  if (model != null) {
    if (model.getFileType() == S3ListModel.FILE_DIR) {
      icon.setGraphic(folder);
    }
 else     if (model.getFileType() == S3ListModel.FILE_DOC) {
      icon.setGraphic(file);
    }
 else {
      icon.setGraphic(parent);
    }
    name.setText(model.getName());
    setText(null);
    setGraphic(layout);
  }
}

Fixed version (ground truth):
@Override public void updateItem(S3ListModel model,boolean empty){
  super.updateItem(model,empty);
  if (model != null) {
    if (model.getFileType() == S3ListModel.FILE_DIR) {
      icon.setGraphic(folder);
    }
 else     if (model.getFileType() == S3ListModel.FILE_DOC) {
      icon.setGraphic(file);
    }
 else {
      icon.setGraphic(parent);
    }
    name.setText(model.getName());
    setText(null);
    setGraphic(layout);
  }
 else {
    setText(null);
    setGraphic(null);
  }
}
Program: 131039
Project: 131039
Buggy source:
public void setWidget(DashboardWidget widget){
  this.widget=widget;
  if (widget.getTitle() != null) {
    title.setText(widget.getTitle());
  }
 else {
    updateButton.setText("String_Node_Str");
  }
  if (widget.getType() != null && type != null) {
    type.setValue(widget.getType());
  }
  if (widget.getSeriesField() != null) {
    series.setValue(new KeyStringValue(widget.getSeriesField(),"String_Node_Str"));
  }
}

Fixed version (ground truth):
public void setWidget(DashboardWidget widget){
  this.widget=widget;
  if (widget.getTitle() != null) {
    title.setText(widget.getTitle());
  }
 else {
    updateButton.setText("String_Node_Str");
  }
  if (widget.getType() != null && type != null) {
    type.setValue(widget.getType());
  }
  ObservableList<KeyStringValue> items=series.getItems();
  for (  KeyStringValue val : items) {
    String itemValue=val.getValue();
    if (itemValue.equalsIgnoreCase(widget.getSeriesField())) {
      series.setValue(val);
      break;
    }
  }
}
Program: 131040
Project: 131040
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (e.getActionCommand().equalsIgnoreCase(ACTION_LOAD)) {
    CompositeFilter filters=FILTER_PANEL.getFilters();
    if (current_mode == EnhancedS3FileChooser.MODE_SCAN && !filters.allFiltersConfigured()) {
      JOptionPane.showMessageDialog(CloudTrailViewer.frame,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      btnLoad.setEnabled(false);
      return;
    }
    loadClicked=true;
    btnLoad.setEnabled(false);
    btnLoad.setText("String_Node_Str");
    StringBuilder query=new StringBuilder();
    query.append("String_Node_Str");
    query.append("String_Node_Str").append(fileList.getPrefix()).append("String_Node_Str");
    query.append("String_Node_Str").append(currentAccount.getId());
    DbManager.getInstance().doInsertUpdate(query.toString());
  }
  fileList.dialogClosing();
  dialog.setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  String newAccount=(String)accountCombo.getSelectedItem();
  currentAccount=ACCOUNT_MAP.get(newAccount);
  setCurrentAccount(currentAccount);
  fileList.init();
}
Program: 131042
Project: 131042
Buggy source:
private static void getAccounts(){
  List<AwsAccount> accounts=AccountDao.getAllAccountsWithBucket();
  for (  AwsAccount account : accounts) {
    String name=account.getName();
    ACCOUNT_MAP.put(name,account);
    ACCOUNT_LIST.addElement(name);
    currentAccount=account;
    String setActive="String_Node_Str" + currentAccount.getId();
    DbManager.getInstance().doInsertUpdate(setActive);
  }
}

Fixed version (ground truth):
private static void getAccounts(){
  List<AwsAccount> accounts=AccountDao.getAllAccountsWithBucket();
  for (  AwsAccount account : accounts) {
    String name=account.getName();
    if (!ACCOUNT_MAP.containsKey(name)) {
      ACCOUNT_MAP.put(name,account);
      ACCOUNT_LIST.addElement(name);
      if (ACCOUNT_MAP.size() == 1) {
        setCurrentAccount(account);
      }
    }
  }
}
Program: 131043
Project: 131043
Buggy source:
/** 
 * Sets the needle that should be used to filter the contents of the table.
 * @param needle 
 */
public void setFilterString(String needle){
  filterTextField.setText(needle);
  filterUpdate();
  tableModel.reloadTableModel();
}

Fixed version (ground truth):
/** 
 * Sets the needle that should be used to filter the contents of the table.
 * @param needle 
 */
public void setFilterString(String needle){
  filterTextField.setText(needle);
  filterUpdate();
}
Program: 131044
Project: 131044
Buggy source:
private void filterUpdate(){
  String text=filterTextField.getText();
  this.eventDb.getFilter().setNeedle(text);
}

Fixed version (ground truth):
private void filterUpdate(){
  String text=filterTextField.getText();
  this.eventDb.getFilter().setNeedle(text);
  tableModel.reloadTableModel();
}
Program: 131045
Project: 131045
Buggy source:
private void loadS3files(boolean is_scan){
  List<AwsAccount> accounts=AccountDao.getAllAccounts(false);
  if (!accounts.isEmpty()) {
    int mode=EnhancedS3FileChooser.MODE_OPEN;
    if (is_scan) {
      mode=EnhancedS3FileChooser.MODE_SCAN;
    }
    application.newS3Files(EnhancedS3FileChooser.showDialog(CloudTrailViewer.frame,mode));
  }
 else {
    JOptionPane.showMessageDialog(CloudTrailViewer.frame,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void loadS3files(boolean is_scan){
  List<AwsAccount> accounts=AccountDao.getAllAccounts(false);
  if (!accounts.isEmpty()) {
    int mode=EnhancedS3FileChooser.MODE_OPEN;
    if (is_scan) {
      mode=EnhancedS3FileChooser.MODE_SCAN;
    }
    LoadFileRequest request=EnhancedS3FileChooser.showDialog(CloudTrailViewer.frame,mode);
    if (request != null) {
      application.newS3Files(request);
    }
  }
 else {
    JOptionPane.showMessageDialog(CloudTrailViewer.frame,"String_Node_Str");
  }
}
Program: 131046
Project: 131046
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (e.getActionCommand().equalsIgnoreCase(ACTION_LOAD)) {
    CompositeFilter filters=FILTER_PANEL.getFilters();
    if (current_mode == EnhancedS3FileChooser.MODE_SCAN && !filters.allFiltersConfigured()) {
      JOptionPane.showMessageDialog(CloudTrailViewer.frame,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      btnLoad.setEnabled(false);
      return;
    }
    btnLoad.setEnabled(false);
    btnLoad.setText("String_Node_Str");
    StringBuilder query=new StringBuilder();
    query.append("String_Node_Str");
    query.append("String_Node_Str").append(fileList.getPrefix()).append("String_Node_Str");
    query.append("String_Node_Str").append(currentAccount.getId());
    DbManager.getInstance().doInsertUpdate(query.toString());
  }
  fileList.dialogClosing();
  dialog.setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (e.getActionCommand().equalsIgnoreCase(ACTION_LOAD)) {
    CompositeFilter filters=FILTER_PANEL.getFilters();
    if (current_mode == EnhancedS3FileChooser.MODE_SCAN && !filters.allFiltersConfigured()) {
      JOptionPane.showMessageDialog(CloudTrailViewer.frame,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      btnLoad.setEnabled(false);
      return;
    }
    loadClicked=true;
    btnLoad.setEnabled(false);
    btnLoad.setText("String_Node_Str");
    StringBuilder query=new StringBuilder();
    query.append("String_Node_Str");
    query.append("String_Node_Str").append(fileList.getPrefix()).append("String_Node_Str");
    query.append("String_Node_Str").append(currentAccount.getId());
    DbManager.getInstance().doInsertUpdate(query.toString());
  }
  fileList.dialogClosing();
  dialog.setVisible(false);
}
Program: 131047
Project: 131047
Buggy source:
/** 
 * Shows the Dialog.
 * @param parent The Frame to which the dialog will be associated
 * @param mode Mode dialog should operate
 * @return a List of String that are S3 bucket keys.
 */
public static LoadFileRequest showDialog(Component parent,int mode){
  current_mode=mode;
  getAccounts();
  fileList=new S3FileList(current_mode,currentAccount);
  Frame frame=JOptionPane.getFrameForComponent(parent);
  dialog=new EnhancedS3FileChooser(frame);
  if (fileList.init()) {
    dialog.setVisible(true);
  }
  return new LoadFileRequest(fileList.getSelectedFiles(),FILTER_PANEL.getFilters());
}

Fixed version (ground truth):
/** 
 * Shows the Dialog.
 * @param parent The Frame to which the dialog will be associated
 * @param mode Mode dialog should operate
 * @return a List of String that are S3 bucket keys.
 */
public static LoadFileRequest showDialog(Component parent,int mode){
  current_mode=mode;
  getAccounts();
  fileList=new S3FileList(current_mode,currentAccount);
  Frame frame=JOptionPane.getFrameForComponent(parent);
  dialog=new EnhancedS3FileChooser(frame);
  if (fileList.init()) {
    dialog.setVisible(true);
  }
  if (loadClicked) {
    return new LoadFileRequest(fileList.getSelectedFiles(),FILTER_PANEL.getFilters());
  }
 else {
    return null;
  }
}
Program: 131048
Project: 131048
Buggy source:
/** 
 * @return the responseElements
 */
private Map getResponseElements(){
  return responseElements;
}

Fixed version (ground truth):
/** 
 * @return the responseElements
 */
public Map getResponseElements(){
  return responseElements;
}
Program: 131049
Project: 131049
Buggy source:
private void updateChart(String eventName){
  try {
    String fqcp=PACKAGE + resourceTypes.get(eventName);
    Class c=Class.forName(fqcp);
    String source=customGroup.getSelection().getActionCommand();
    Map<String,Integer> metadataByOccurance=new HashMap<>();
    for (    Event event : eventDb.getEvents()) {
      ResourceMetaData md=(ResourceMetaData)c.newInstance();
      md.populate(event);
      String meta=md.getValueForMenuItem(source);
      int count=0;
      if (metadataByOccurance.containsKey(meta)) {
        count=metadataByOccurance.get(meta);
      }
      count++;
      metadataByOccurance.put(meta,count);
    }
    List<Map.Entry<String,Integer>> sorted=entriesSortedByValues(metadataByOccurance);
    int top=getTopXValue();
    List<Map.Entry<String,Integer>> topX=chartUtils.getTopX(sorted,top);
    updateChart(topX);
  }
 catch (  ClassNotFoundException|InstantiationException|IllegalAccessException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private void updateChart(String eventName){
  try {
    String fqcp=PACKAGE + resourceTypes.get(eventName);
    Class c=Class.forName(fqcp);
    String source=customGroup.getSelection().getActionCommand();
    Map<String,Integer> metadataByOccurance=new HashMap<>();
    for (    Event event : eventDb.getEvents()) {
      ResourceMetaData md=(ResourceMetaData)c.newInstance();
      md.populate(event);
      int count=0;
      List<String> values=md.getValuesForMenuItem(source);
      if (values != null) {
        for (        String value : values) {
          if (metadataByOccurance.containsKey(value)) {
            count=metadataByOccurance.get(value);
          }
          count++;
          metadataByOccurance.put(value,count);
        }
      }
    }
    List<Map.Entry<String,Integer>> sorted=entriesSortedByValues(metadataByOccurance);
    int top=getTopXValue();
    List<Map.Entry<String,Integer>> topX=chartUtils.getTopX(sorted,top);
    updateChart(topX);
  }
 catch (  ClassNotFoundException|InstantiationException|IllegalAccessException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
}
Program: 131050
Project: 131050
Buggy source:
@Override public void populate(Event event){
  Map requestParams=event.getRequestParameters();
  engine=(String)requestParams.get("String_Node_Str");
  cacheNodeType=(String)requestParams.get("String_Node_Str");
}

Fixed version (ground truth):
@Override public void populate(Event event){
  Map requestParams=event.getRequestParameters();
  engine.add((String)requestParams.get("String_Node_Str"));
  cacheNodeType.add((String)requestParams.get("String_Node_Str"));
}
Program: 131051
Project: 131051
Buggy source:
@Override public void populate(Event event){
  Map requestParams=event.getRequestParameters();
  dBInstanceClass=(String)requestParams.get("String_Node_Str");
  engine=(String)requestParams.get("String_Node_Str");
  allocatedStorage=(String)requestParams.get("String_Node_Str");
}

Fixed version (ground truth):
@Override public void populate(Event event){
  Map requestParams=event.getRequestParameters();
  dBInstanceClass.add((String)requestParams.get("String_Node_Str"));
  engine.add((String)requestParams.get("String_Node_Str"));
  allocatedStorage.add((String)requestParams.get("String_Node_Str"));
}
Program: 131052
Project: 131052
Buggy source:
@Override public void populate(Event event){
  eventSource=event.getEventSource();
  userAgent=event.getUserAgent();
  if (event.getUserIdentity() != null) {
    userIdentityPrincipalId=event.getUserIdentity().getPrincipalId();
    userIdentityArn=event.getUserIdentity().getArn();
    userIdentityUsername=event.getUserIdentity().getUserName();
    userIdentityInvokedBy=event.getUserIdentity().getInvokedBy();
    if (event.getUserIdentity().getSessionContext() != null && event.getUserIdentity().getSessionContext().getSessionIssuer() != null) {
      sessionContextPrincipalId=event.getUserIdentity().getSessionContext().getSessionIssuer().getPrincipalId();
      sessionContextArn=event.getUserIdentity().getSessionContext().getSessionIssuer().getArn();
      sessionContextUsername=event.getUserIdentity().getSessionContext().getSessionIssuer().getUserName();
    }
  }
}

Fixed version (ground truth):
@Override public void populate(Event event){
  eventSource.add(event.getEventSource());
  userAgent.add(event.getUserAgent());
  if (event.getUserIdentity() != null) {
    userIdentityPrincipalId.add(event.getUserIdentity().getPrincipalId());
    userIdentityArn.add(event.getUserIdentity().getArn());
    userIdentityUsername.add(event.getUserIdentity().getUserName());
    userIdentityInvokedBy.add(event.getUserIdentity().getInvokedBy());
    if (event.getUserIdentity().getSessionContext() != null && event.getUserIdentity().getSessionContext().getSessionIssuer() != null) {
      sessionContextPrincipalId.add(event.getUserIdentity().getSessionContext().getSessionIssuer().getPrincipalId());
      sessionContextArn.add(event.getUserIdentity().getSessionContext().getSessionIssuer().getArn());
      sessionContextUsername.add(event.getUserIdentity().getSessionContext().getSessionIssuer().getUserName());
    }
  }
}
Program: 131053
Project: 131053
Buggy source:
@Override public void populate(Event event){
  Map requestParams=event.getRequestParameters();
  Map instancesSet=(Map)requestParams.get("String_Node_Str");
  List<Map> items=(List)instancesSet.get("String_Node_Str");
  Map item=items.get(0);
  imageId=(String)item.get("String_Node_Str");
  instanceType=(String)requestParams.get("String_Node_Str");
  az=(String)requestParams.get("String_Node_Str");
}

Fixed version (ground truth):
@Override public void populate(Event event){
  Map responseParams=event.getResponseElements();
  if (responseParams != null && responseParams.containsKey("String_Node_Str")) {
    Map instancesSet=(Map)responseParams.get("String_Node_Str");
    List<Map> items=(List)instancesSet.get("String_Node_Str");
    for (    Map item : items) {
      imageId.add((String)item.get("String_Node_Str"));
      instanceType.add((String)item.get("String_Node_Str"));
      Map placement=(Map)item.get("String_Node_Str");
      az.add((String)placement.get("String_Node_Str"));
    }
  }
}
Program: 131054
Project: 131054
Buggy source:
private void addSelectedKeys(){
  if (s3List.getSelectedValue() != null) {
    String selected=prefix + ((S3ListModel)s3List.getSelectedValue()).getPath();
    if (scanning && selected.endsWith("String_Node_Str")) {
      addFolderFiles(selected);
    }
 else {
      List<S3ListModel> selectedItems=s3List.getSelectedValuesList();
      for (      S3ListModel key : selectedItems) {
        selected_keys.add(prefix + key.getPath());
      }
    }
  }
}

Fixed version (ground truth):
private void addSelectedKeys(){
  if (s3List.getSelectedValue() != null) {
    String selected=prefix + s3List.getSelectedValue().getPath();
    if (scanning && selected.endsWith("String_Node_Str")) {
      addFolderFiles(selected);
    }
 else {
      List<S3ListModel> selectedItems=s3List.getSelectedValuesList();
      for (      S3ListModel key : selectedItems) {
        selected_keys.add(prefix + key.getPath());
      }
    }
  }
}
Program: 131055
Project: 131055
Buggy source:
@Override public boolean elementsSelected(ListSelectionType type,Object... elements){
  if (type == NavigationListener.ListSelectionType.SINGLE_CLICK) {
    StringBuilder path=new StringBuilder();
    String selected=(String)elements[0];
    String[] path_elements=navigationPanel.getBreadCrumbPath();
    for (    String element : path_elements) {
      if (!element.equalsIgnoreCase(selected)) {
        path.append(element).append("String_Node_Str");
      }
 else {
        path.append(element).append("String_Node_Str");
        break;
      }
    }
    prefix=path.toString();
    reloadContents();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean elementsSelected(ListSelectionType type,Object... elements){
  if (type == NavigationListener.ListSelectionType.SINGLE_CLICK) {
    StringBuilder path=new StringBuilder();
    String selected=(String)elements[0];
    String[] path_elements=navigationPanel.getBreadCrumbPath();
    for (    String element : path_elements) {
      if (!element.equalsIgnoreCase(selected)) {
        path.append(element).append("String_Node_Str");
      }
 else {
        path.append(element).append("String_Node_Str");
        break;
      }
    }
    updateAccountPrefix(path.toString());
    reloadContents();
  }
  return true;
}
Program: 131056
Project: 131056
Buggy source:
/** 
 * returns the current S3 Prefix
 * @return 
 */
String getPrefix(){
  return this.prefix;
}

Fixed version (ground truth):
/** 
 * returns the current S3 Prefix
 * @return current S3 Prefix
 */
String getPrefix(){
  return this.prefix;
}
Program: 131057
Project: 131057
Buggy source:
private void handleDoubleClickEvent(){
  String selected=((S3ListModel)s3List.getSelectedValue()).getPath();
  if (selected.equalsIgnoreCase(MOVE_BACK)) {
    int lastSlash=prefix.lastIndexOf('/');
    String tmpPrefix=prefix.substring(0,lastSlash);
    if (tmpPrefix.contains("String_Node_Str")) {
      lastSlash=tmpPrefix.lastIndexOf('/') + 1;
      prefix=tmpPrefix.substring(0,lastSlash);
    }
 else {
      prefix="String_Node_Str";
    }
    reloadContents();
  }
 else {
    int firstSlash=selected.indexOf('/');
    if (firstSlash == 0) {
      selected=selected.substring(1,selected.length());
    }
    int lastSlash=selected.lastIndexOf('/') + 1;
    if (lastSlash == selected.length()) {
      prefix=prefix + selected;
      reloadContents();
    }
 else {
      addSelectedKeys();
      currentAccount.setPrefix(prefix);
      for (      S3FileListListener l : listeners) {
        l.selectionComplete();
      }
    }
  }
}

Fixed version (ground truth):
private void handleDoubleClickEvent(){
  String selected=s3List.getSelectedValue().getPath();
  if (selected.equalsIgnoreCase(MOVE_BACK)) {
    int lastSlash=prefix.lastIndexOf('/');
    String tmpPrefix=prefix.substring(0,lastSlash);
    prefix="String_Node_Str";
    if (tmpPrefix.contains("String_Node_Str")) {
      lastSlash=tmpPrefix.lastIndexOf('/') + 1;
      prefix=tmpPrefix.substring(0,lastSlash);
    }
    updateAccountPrefix(prefix);
    reloadContents();
  }
 else {
    int firstSlash=selected.indexOf('/');
    if (firstSlash == 0) {
      selected=selected.substring(1,selected.length());
    }
    int lastSlash=selected.lastIndexOf('/') + 1;
    if (lastSlash == selected.length()) {
      prefix=prefix + selected;
      updateAccountPrefix(prefix);
      reloadContents();
    }
 else {
      addSelectedKeys();
      updateAccountPrefix(prefix);
      for (      S3FileListListener l : listeners) {
        l.selectionComplete();
      }
    }
  }
}
Program: 131058
Project: 131058
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    handleDoubleClickEvent();
  }
 else   if (e.getClickCount() == 1) {
    String selected=((S3ListModel)s3List.getSelectedValue()).getPath();
    if (!scanning && selected.contains("String_Node_Str")) {
      notifyListenersOfSelection(false);
    }
 else {
      notifyListenersOfSelection(true);
    }
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    handleDoubleClickEvent();
  }
 else   if (e.getClickCount() == 1) {
    String selected=s3List.getSelectedValue().getPath();
    if (!scanning && selected.contains("String_Node_Str")) {
      notifyListenersOfSelection(false);
    }
 else {
      notifyListenersOfSelection(true);
    }
  }
}
Program: 131059
Project: 131059
Buggy source:
/** 
 * Sets the AWS Account that the class will use to read files from
 * @param newAccount new Account
 */
private void setAccount(AwsAccount newAccount){
  this.currentAccount=newAccount;
  this.prefix=newAccount.getPrefix();
}

Fixed version (ground truth):
/** 
 * Sets the AWS Account that the class will use to read files from
 * @param newAccount new Account
 */
public void setAccount(AwsAccount newAccount){
  this.currentAccount=newAccount;
  this.prefix=newAccount.getPrefix();
}
Program: 131060
Project: 131060
Buggy source:
private String getHTML(){
  StringBuilder result=new StringBuilder();
  ClassLoader classLoader=getClass().getClassLoader();
  File file=new File(classLoader.getResource("String_Node_Str").getFile());
  try (Scanner scanner=new Scanner(file)){
    while (scanner.hasNextLine()) {
      String line=scanner.nextLine();
      result.append(line).append("String_Node_Str");
    }
    scanner.close();
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
  return result.toString();
}

Fixed version (ground truth):
private String getHTML(){
  StringBuilder result=new StringBuilder();
  ClassLoader classLoader=this.getClass().getClassLoader();
  InputStreamReader io=new InputStreamReader(classLoader.getResourceAsStream("String_Node_Str"));
  try (BufferedReader br=new BufferedReader(io)){
    String line;
    while ((line=br.readLine()) != null) {
      result.append(line).append("String_Node_Str");
    }
  }
 catch (  IOException ioe) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ioe);
  }
  return result.toString();
}
Program: 131061
Project: 131061
Buggy source:
private GeoIpUtils(){
  try {
    ClassLoader classLoader=GeoIpUtils.class.getClassLoader();
    File database=new File(classLoader.getResource(GEO_FILE).getFile());
    reader=new DatabaseReader.Builder(database).build();
  }
 catch (  IOException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
catch (  Exception ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private GeoIpUtils(){
  try {
    ClassLoader classLoader=this.getClass().getClassLoader();
    reader=new DatabaseReader.Builder(classLoader.getResourceAsStream(GEO_FILE)).build();
  }
 catch (  IOException ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
catch (  Exception ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
}
Program: 131062
Project: 131062
Buggy source:
private void terminateInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,LinkedHashMap> resourceSet=(LinkedHashMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void terminateInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,ArrayList> resourceSet=(LinkedTreeMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}
Program: 131063
Project: 131063
Buggy source:
private void createTags(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,LinkedHashMap> resourceSet=(LinkedHashMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void createTags(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,ArrayList> resourceSet=(LinkedTreeMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}
Program: 131064
Project: 131064
Buggy source:
private void stopInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,LinkedHashMap> resourceSet=(LinkedHashMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void stopInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,ArrayList> resourceSet=(LinkedTreeMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}
Program: 131065
Project: 131065
Buggy source:
private void describeInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,LinkedHashMap> resourceSet=(LinkedHashMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void describeInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,ArrayList> resourceSet=(LinkedTreeMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}
Program: 131066
Project: 131066
Buggy source:
private void rebootInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,LinkedHashMap> resourceSet=(LinkedHashMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void rebootInstances(Event event,RequestInfo resources){
  Map requestParameters=event.getRequestParameters();
  if (requestParameters != null && requestParameters.containsKey("String_Node_Str")) {
    Map<String,ArrayList> resourceSet=(LinkedTreeMap)requestParameters.get("String_Node_Str");
    if (resourceSet != null) {
      List<Map> items=(List)resourceSet.get("String_Node_Str");
      if (items != null) {
        for (        Map instance : items) {
          resources.addResource(EC2_INSTANCE,(String)instance.get("String_Node_Str"));
        }
      }
    }
  }
}
Program: 131068
Project: 131068
Buggy source:
private void writeGeoDataHtml(String htmtContent){
  try {
    File f=new File(getFileName());
    f.delete();
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
  try (BufferedWriter out=new BufferedWriter(new FileWriter(getFileName()))){
    out.write(htmtContent);
    out.close();
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void writeGeoDataHtml(String htmtContent){
  try {
    File f=new File(getFileName());
    if (!f.delete()) {
      LOGGER.log(Level.WARNING,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
  try (BufferedWriter out=new BufferedWriter(new FileWriter(getFileName()))){
    out.write(htmtContent);
    out.close();
  }
 catch (  IOException e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 131069
Project: 131069
Buggy source:
/** 
 * Added a new event to the count.
 * @param event 
 */
public void newEvent(Event event){
  this.events.add(event);
  eventCount.setText(String.valueOf(this.events.size()));
  Font labelFont=eventCount.getFont();
  if (eventCount.getText().length() >= 5) {
    eventCount.setFont(new Font(labelFont.getName(),labelFont.getStyle(),14));
  }
  this.revalidate();
}

Fixed version (ground truth):
/** 
 * Added a new event to the count.
 * @param event 
 */
public void newEvent(Event event){
  this.events.add(event);
  eventCount.setText(String.valueOf(this.events.size()));
  Font labelFont=eventCount.getFont();
  if (eventCount.getText().length() >= 5) {
    eventCount.setFont(new Font(labelFont.getName(),labelFont.getStyle(),18));
  }
  this.revalidate();
}
Program: 131071
Project: 131071
Buggy source:
private void addValueToRequestInfo(RequestInfo requestInfo,String resourceName,Object paramValue,boolean resource){
  if (resourceMap.containsKey(resourceName)) {
    resourceName=resourceMap.get(resourceName);
  }
  try {
    if (paramValue instanceof String) {
      if (resource) {
        requestInfo.addResource(resourceName,(String)paramValue);
      }
 else {
        requestInfo.addParameter(resourceName,(String)paramValue);
      }
    }
 else     if (paramValue instanceof Integer || paramValue instanceof Boolean) {
      if (resource) {
        requestInfo.addResource(resourceName,String.valueOf(paramValue));
      }
 else {
        requestInfo.addParameter(resourceName,String.valueOf(paramValue));
      }
    }
 else     if (paramValue instanceof ArrayList) {
      List<Object> values=(ArrayList)paramValue;
      for (      Object value : values) {
        addValueToRequestInfo(requestInfo,resourceName,value,resource);
      }
    }
 else     if (paramValue instanceof LinkedHashMap) {
      Map values=(LinkedHashMap)paramValue;
      Set<String> keys=values.keySet();
      Iterator<String> it=keys.iterator();
      while (it.hasNext()) {
        String key=it.next();
        Object value=values.get(key);
        addValueToRequestInfo(requestInfo,key,value,resource);
      }
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void addValueToRequestInfo(RequestInfo requestInfo,String resourceName,Object paramValue,boolean resource){
  if (resourceMap != null && resourceMap.containsKey(resourceName)) {
    resourceName=resourceMap.get(resourceName);
  }
  try {
    if (paramValue instanceof String) {
      if (resource) {
        requestInfo.addResource(resourceName,(String)paramValue);
      }
 else {
        requestInfo.addParameter(resourceName,(String)paramValue);
      }
    }
 else     if (paramValue instanceof Integer || paramValue instanceof Boolean) {
      if (resource) {
        requestInfo.addResource(resourceName,String.valueOf(paramValue));
      }
 else {
        requestInfo.addParameter(resourceName,String.valueOf(paramValue));
      }
    }
 else     if (paramValue instanceof ArrayList) {
      List<Object> values=(ArrayList)paramValue;
      for (      Object value : values) {
        addValueToRequestInfo(requestInfo,resourceName,value,resource);
      }
    }
 else     if (paramValue instanceof LinkedHashMap) {
      Map values=(LinkedHashMap)paramValue;
      Set<String> keys=values.keySet();
      Iterator<String> it=keys.iterator();
      while (it.hasNext()) {
        String key=it.next();
        Object value=values.get(key);
        addValueToRequestInfo(requestInfo,key,value,resource);
      }
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 131072
Project: 131072
Buggy source:
private void processStream(InputStream stream,CompositeFilter filter){
  List<Event> events=createEvents(uncompress(stream));
  for (  Event event : events) {
    GeoIpUtils.getInstance().populateGeoData(event);
    if (filter.passes(event)) {
      event.getResourceInfo();
      EventUtils.addTimestamp(event);
      eventDb.addEvent(event);
    }
  }
}

Fixed version (ground truth):
private void processStream(InputStream stream,CompositeFilter filter){
  List<Event> events=createEvents(uncompress(stream));
  for (  Event event : events) {
    GeoIpUtils.getInstance().populateGeoData(event);
    EventUtils.addTimestamp(event);
    if (filter.passes(event)) {
      event.getResourceInfo();
      eventDb.addEvent(event);
    }
  }
}