nus-yam/ex-repair huggingface dataset:
Program: 5635
Project: 5635
Buggy source:
protected PipelineSpec(Set<StageSpec> stages,Set<Connection> connections,Resources resources,boolean stageLoggingEnabled,int numOfRecordsPreview){
  this.stages=ImmutableSet.copyOf(stages);
  this.connections=ImmutableSet.copyOf(connections);
  this.resources=resources;
  this.stageLoggingEnabled=stageLoggingEnabled;
  this.numOfRecordsPreview=numOfRecordsPreview;
}

Fixed version (ground truth):
protected PipelineSpec(Set<StageSpec> stages,Set<Connection> connections,Resources resources,Resources driverResources,Resources clientResources,boolean stageLoggingEnabled,int numOfRecordsPreview){
  this.stages=ImmutableSet.copyOf(stages);
  this.connections=ImmutableSet.copyOf(connections);
  this.resources=resources;
  this.driverResources=driverResources;
  this.clientResources=clientResources;
  this.stageLoggingEnabled=stageLoggingEnabled;
  this.numOfRecordsPreview=numOfRecordsPreview;
}
Program: 5636
Project: 5636
Buggy source:
@Override public int hashCode(){
  return Objects.hash(stages,connections,resources,stageLoggingEnabled);
}

Fixed version (ground truth):
@Override public int hashCode(){
  return Objects.hash(stages,connections,resources,driverResources,clientResources,stageLoggingEnabled);
}
Program: 5637
Project: 5637
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PipelineSpec that=(PipelineSpec)o;
  return Objects.equals(stages,that.stages) && Objects.equals(connections,that.connections) && Objects.equals(resources,that.resources)&& Objects.equals(stageLoggingEnabled,that.stageLoggingEnabled);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PipelineSpec that=(PipelineSpec)o;
  return Objects.equals(stages,that.stages) && Objects.equals(connections,that.connections) && Objects.equals(resources,that.resources)&& Objects.equals(driverResources,that.driverResources)&& Objects.equals(clientResources,that.clientResources)&& Objects.equals(stageLoggingEnabled,that.stageLoggingEnabled);
}
Program: 5638
Project: 5638
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + stages + "String_Node_Str"+ connections+ "String_Node_Str"+ resources+ "String_Node_Str"+ stageLoggingEnabled+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + stages + "String_Node_Str"+ connections+ "String_Node_Str"+ resources+ "String_Node_Str"+ driverResources+ "String_Node_Str"+ clientResources+ "String_Node_Str"+ stageLoggingEnabled+ "String_Node_Str"+ numOfRecordsPreview+ '}';
}
Program: 5641
Project: 5641
Buggy source:
/** 
 * Collects the stats that are reported by this object.
 */
void collect() throws IOException ;

Fixed version (ground truth):
/** 
 * Collects the stats that are reported by this object.
 */
void collect() throws Exception ;
Program: 5642
Project: 5642
Buggy source:
@Inject OperationalStatsService(OperationalStatsLoader operationalStatsLoader,CConfiguration cConf){
  this.operationalStatsLoader=operationalStatsLoader;
  this.statsRefreshInterval=cConf.getInt(Constants.OperationalStats.REFRESH_INTERVAL_SECS);
}

Fixed version (ground truth):
@Inject OperationalStatsService(OperationalStatsLoader operationalStatsLoader,CConfiguration cConf,Injector injector){
  this.operationalStatsLoader=operationalStatsLoader;
  this.statsRefreshInterval=cConf.getInt(Constants.OperationalStats.REFRESH_INTERVAL_SECS);
  this.injector=injector;
}
Program: 5643
Project: 5643
Buggy source:
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",entry.getValue(),entry.getKey());
    mbs.registerMBean(entry.getValue(),objectName);
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    OperationalStats operationalStats=entry.getValue();
    ObjectName objectName=getObjectName(operationalStats);
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",operationalStats,entry.getKey());
    operationalStats.initialize(injector);
    mbs.registerMBean(operationalStats,objectName);
  }
  LOG.info("String_Node_Str");
}
Program: 5644
Project: 5644
Buggy source:
@Override protected void shutDown() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str" + "String_Node_Str",entry.getValue().getClass().getName());
      continue;
    }
    try {
      mbs.unregisterMBean(objectName);
    }
 catch (    InstanceNotFoundException e) {
      LOG.debug("String_Node_Str",objectName);
    }
catch (    MBeanRegistrationException e) {
      LOG.warn("String_Node_Str",e);
    }
  }
  if (executor != null) {
    executor.shutdownNow();
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void shutDown() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    OperationalStats operationalStats=entry.getValue();
    ObjectName objectName=getObjectName(operationalStats);
    if (objectName == null) {
      LOG.warn("String_Node_Str" + "String_Node_Str",operationalStats.getClass().getName());
      continue;
    }
    try {
      mbs.unregisterMBean(objectName);
    }
 catch (    InstanceNotFoundException e) {
      LOG.debug("String_Node_Str",objectName);
    }
catch (    MBeanRegistrationException e) {
      LOG.warn("String_Node_Str",e);
    }
    operationalStats.destroy();
  }
  if (executor != null) {
    executor.shutdownNow();
  }
  LOG.info("String_Node_Str");
}
Program: 5645
Project: 5645
Buggy source:
@Override public void initialize(WorkflowContext context) throws Exception {
  super.initialize(context);
  postActions=new LinkedHashMap<>();
  BatchPipelineSpec batchPipelineSpec=GSON.fromJson(context.getWorkflowSpecification().getProperty(Constants.PIPELINE_SPEC_KEY),BatchPipelineSpec.class);
  for (  ActionSpec actionSpec : batchPipelineSpec.getEndingActions()) {
    postActions.put(actionSpec.getName(),(PostAction)context.newPluginInstance(actionSpec.getName()));
  }
}

Fixed version (ground truth):
@Override public void initialize(WorkflowContext context) throws Exception {
  super.initialize(context);
  postActions=new LinkedHashMap<>();
  BatchPipelineSpec batchPipelineSpec=GSON.fromJson(context.getWorkflowSpecification().getProperty(Constants.PIPELINE_SPEC_KEY),BatchPipelineSpec.class);
  MacroEvaluator macroEvaluator=new DefaultMacroEvaluator(context.getToken(),context.getRuntimeArguments(),context.getLogicalStartTime(),context,context.getNamespace());
  for (  ActionSpec actionSpec : batchPipelineSpec.getEndingActions()) {
    postActions.put(actionSpec.getName(),(PostAction)context.newPluginInstance(actionSpec.getName(),macroEvaluator));
  }
}
Program: 5646
Project: 5646
Buggy source:
@Inject TokenSecureStoreUpdater(YarnConfiguration hConf,CConfiguration cConf,LocationFactory locationFactory,co.cask.cdap.api.security.store.SecureStore secureStore){
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.secureStore=secureStore;
  secureExplore=cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && UserGroupInformation.isSecurityEnabled();
  updateInterval=calculateUpdateInterval();
}

Fixed version (ground truth):
@Inject TokenSecureStoreUpdater(YarnConfiguration hConf,CConfiguration cConf,LocationFactory locationFactory,co.cask.cdap.api.security.store.SecureStore secureStore){
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.secureStore=secureStore;
  secureExplore=cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && UserGroupInformation.isSecurityEnabled();
}
Program: 5647
Project: 5647
Buggy source:
/** 
 * Returns the minimum update interval for the delegation tokens.
 * @return The update interval in milliseconds.
 */
public long getUpdateInterval(){
  return updateInterval;
}

Fixed version (ground truth):
/** 
 * Returns the minimum update interval for the delegation tokens.
 * @return The update interval in milliseconds.
 */
public long getUpdateInterval(){
  if (updateInterval == null) {
    updateInterval=calculateUpdateInterval();
  }
  return updateInterval;
}
Program: 5648
Project: 5648
Buggy source:
private long calculateUpdateInterval(){
  List<Long> renewalTimes=Lists.newArrayList();
  renewalTimes.add(hConf.getLong(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_KEY,DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
  renewalTimes.add(hConf.getLong(Constants.HBase.AUTH_KEY_UPDATE_INTERVAL,TimeUnit.MILLISECONDS.convert(1,TimeUnit.DAYS)));
  if (secureExplore) {
    renewalTimes.add(hConf.getLong(YarnConfiguration.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,YarnConfiguration.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
    Configuration hiveConf=getHiveConf();
    if (hiveConf != null) {
      renewalTimes.add(hiveConf.getLong(HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
    }
 else {
      renewalTimes.add(HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT);
    }
    renewalTimes.add(hConf.getLong(MRConfig.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,MRConfig.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
  }
  Long minimumInterval=Collections.min(renewalTimes);
  long delay=minimumInterval - TimeUnit.MINUTES.toMillis(5);
  if (delay <= 0) {
    delay=(minimumInterval <= 2) ? 1 : minimumInterval / 2;
  }
  LOG.info("String_Node_Str",delay);
  return delay;
}

Fixed version (ground truth):
private long calculateUpdateInterval(){
  List<Long> renewalTimes=Lists.newArrayList();
  renewalTimes.add(hConf.getLong(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_KEY,DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
  renewalTimes.add(hConf.getLong(Constants.HBase.AUTH_KEY_UPDATE_INTERVAL,TimeUnit.MILLISECONDS.convert(1,TimeUnit.DAYS)));
  if (secureExplore) {
    renewalTimes.add(hConf.getLong(YarnConfiguration.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,YarnConfiguration.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
    Configuration hiveConf=getHiveConf();
    if (hiveConf != null) {
      renewalTimes.add(hiveConf.getLong(HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
    }
 else {
      renewalTimes.add(HadoopThriftAuthBridge.Server.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT);
    }
    renewalTimes.add(hConf.getLong(MRConfig.DELEGATION_TOKEN_RENEW_INTERVAL_KEY,MRConfig.DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT));
  }
  Long minimumInterval=Collections.min(renewalTimes);
  long delay=minimumInterval - TimeUnit.HOURS.toMillis(1);
  if (delay <= 0) {
    delay=(minimumInterval <= 2) ? 1 : minimumInterval / 2;
  }
  LOG.info("String_Node_Str",delay);
  return delay;
}
Program: 5649
Project: 5649
Buggy source:
@Override public void initialize(WorkflowContext context) throws Exception {
  super.initialize(context);
  postActions=new LinkedHashMap<>();
  BatchPipelineSpec batchPipelineSpec=GSON.fromJson(context.getWorkflowSpecification().getProperty(Constants.PIPELINE_SPEC_KEY),BatchPipelineSpec.class);
  for (  ActionSpec actionSpec : batchPipelineSpec.getEndingActions()) {
    postActions.put(actionSpec.getName(),(PostAction)context.newPluginInstance(actionSpec.getName()));
  }
}

Fixed version (ground truth):
@Override public void initialize(WorkflowContext context) throws Exception {
  super.initialize(context);
  postActions=new LinkedHashMap<>();
  BatchPipelineSpec batchPipelineSpec=GSON.fromJson(context.getWorkflowSpecification().getProperty(Constants.PIPELINE_SPEC_KEY),BatchPipelineSpec.class);
  MacroEvaluator macroEvaluator=new DefaultMacroEvaluator(context.getToken(),context.getRuntimeArguments(),context.getLogicalStartTime(),context,context.getNamespace());
  for (  ActionSpec actionSpec : batchPipelineSpec.getEndingActions()) {
    postActions.put(actionSpec.getName(),(PostAction)context.newPluginInstance(actionSpec.getName(),macroEvaluator));
  }
}
Program: 5650
Project: 5650
Buggy source:
@Override protected <T extends Dataset>T getDataset(String namespace,String name,Map<String,String> arguments,AccessType accessType) throws DatasetInstantiationException {
  T dataset=super.getDataset(namespace,name,arguments,accessType);
  startDatasetTransaction(dataset);
  return dataset;
}

Fixed version (ground truth):
@Override protected <T extends Dataset>T getDataset(String namespace,String name,Map<String,String> arguments,AccessType accessType) throws DatasetInstantiationException {
  T dataset=super.getDataset(namespace,name,adjustRuntimeArguments(arguments),accessType);
  startDatasetTransaction(dataset);
  return dataset;
}
Program: 5651
Project: 5651
Buggy source:
@Override protected BufferingTable getTable(DatasetContext datasetContext,String name,DatasetProperties props) throws Exception {
  DatasetSpecification spec=TABLE_DEFINITION.configure(name,props);
  return new HBaseTable(datasetContext,spec,cConf,TEST_HBASE.getConfiguration(),hBaseTableUtil);
}

Fixed version (ground truth):
@Override protected BufferingTable getTable(DatasetContext datasetContext,String name,DatasetProperties props,Map<String,String> args) throws Exception {
  DatasetSpecification spec=TABLE_DEFINITION.configure(name,props);
  return new HBaseTable(datasetContext,spec,args,cConf,TEST_HBASE.getConfiguration(),hBaseTableUtil);
}
Program: 5653
Project: 5653
Buggy source:
public HBaseTable(DatasetContext datasetContext,DatasetSpecification spec,CConfiguration cConf,Configuration hConf,HBaseTableUtil tableUtil) throws IOException {
  super(PrefixedNamespaces.namespace(cConf,datasetContext.getNamespaceId(),spec.getName()),TableProperties.supportsReadlessIncrements(spec.getProperties()),spec.getProperties());
  TableId hBaseTableId=tableUtil.createHTableId(new NamespaceId(datasetContext.getNamespaceId()),spec.getName());
  HTable hTable=tableUtil.createHTable(hConf,hBaseTableId);
  hTable.setWriteBufferSize(HBaseTableUtil.DEFAULT_WRITE_BUFFER_SIZE);
  hTable.setAutoFlush(false);
  this.tableUtil=tableUtil;
  this.hTable=hTable;
  this.hTableName=Bytes.toStringBinary(hTable.getTableName());
  this.columnFamily=TableProperties.getColumnFamily(spec.getProperties());
  this.txCodec=new TransactionCodec();
  this.nameAsTxChangePrefix=Bytes.add(new byte[]{(byte)this.hTableName.length()},Bytes.toBytes(this.hTableName));
}

Fixed version (ground truth):
public HBaseTable(DatasetContext datasetContext,DatasetSpecification spec,Map<String,String> args,CConfiguration cConf,Configuration hConf,HBaseTableUtil tableUtil) throws IOException {
  super(PrefixedNamespaces.namespace(cConf,datasetContext.getNamespaceId(),spec.getName()),TableProperties.supportsReadlessIncrements(spec.getProperties()),spec.getProperties());
  TableId hBaseTableId=tableUtil.createHTableId(new NamespaceId(datasetContext.getNamespaceId()),spec.getName());
  HTable hTable=tableUtil.createHTable(hConf,hBaseTableId);
  hTable.setWriteBufferSize(HBaseTableUtil.DEFAULT_WRITE_BUFFER_SIZE);
  hTable.setAutoFlush(false);
  this.tableUtil=tableUtil;
  this.hTable=hTable;
  this.hTableName=Bytes.toStringBinary(hTable.getTableName());
  this.columnFamily=TableProperties.getColumnFamily(spec.getProperties());
  this.txCodec=new TransactionCodec();
  this.nameAsTxChangePrefix=Bytes.add(new byte[]{(byte)this.hTableName.length()},Bytes.toBytes(this.hTableName));
  this.safeReadlessIncrements=args.containsKey(SAFE_INCREMENTS) && Boolean.valueOf(args.get(SAFE_INCREMENTS));
}
Program: 5655
Project: 5655
Buggy source:
@Override public Table getDataset(DatasetContext datasetContext,DatasetSpecification spec,Map<String,String> arguments,ClassLoader classLoader) throws IOException {
  return new HBaseTable(datasetContext,spec,cConf,hConf,hBaseTableUtil);
}

Fixed version (ground truth):
@Override public Table getDataset(DatasetContext datasetContext,DatasetSpecification spec,Map<String,String> arguments,ClassLoader classLoader) throws IOException {
  return new HBaseTable(datasetContext,spec,arguments,cConf,hConf,hBaseTableUtil);
}
Program: 5656
Project: 5656
Buggy source:
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  try {
    return cliService.openSession(UserGroupInformation.getCurrentUser().getShortUserName(),"String_Node_Str",sessionConf);
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  return cliService.openSession("String_Node_Str","String_Node_Str",sessionConf);
}
Program: 5657
Project: 5657
Buggy source:
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",entry.getValue());
    mbs.registerMBean(entry.getValue(),objectName);
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",entry.getValue(),entry.getKey());
    mbs.registerMBean(entry.getValue(),objectName);
  }
  LOG.info("String_Node_Str");
}
Program: 5659
Project: 5659
Buggy source:
/** 
 * Private constructor, only to be used by static method setOriginalProperties.
 * @param name the name of the dataset
 * @param type the type of the dataset
 * @param description the description of dataset
 * @param properties the custom properties
 * @param datasetSpecs the specs of embedded datasets
 */
private DatasetSpecification(String name,String type,@Nullable String description,@Nullable Map<String,String> originalProperties,SortedMap<String,String> properties,SortedMap<String,DatasetSpecification> datasetSpecs){
  this.name=name;
  this.type=type;
  this.description=description;
  this.properties=Collections.unmodifiableSortedMap(new TreeMap<>(properties));
  this.originalProperties=originalProperties == null ? null : Collections.unmodifiableMap(new TreeMap<String,String>(originalProperties));
  this.datasetSpecs=Collections.unmodifiableSortedMap(new TreeMap<>(datasetSpecs));
}

Fixed version (ground truth):
/** 
 * Private constructor, only to be used by static method setOriginalProperties.
 * @param name the name of the dataset
 * @param type the type of the dataset
 * @param description the description of dataset
 * @param properties the custom properties
 * @param datasetSpecs the specs of embedded datasets
 */
private DatasetSpecification(String name,String type,@Nullable String description,@Nullable Map<String,String> originalProperties,SortedMap<String,String> properties,SortedMap<String,DatasetSpecification> datasetSpecs){
  this.name=name;
  this.type=type;
  this.description=description;
  this.properties=Collections.unmodifiableSortedMap(new TreeMap<>(properties));
  this.originalProperties=originalProperties == null ? null : Collections.unmodifiableMap(new TreeMap<>(originalProperties));
  this.datasetSpecs=Collections.unmodifiableSortedMap(new TreeMap<>(datasetSpecs));
}
Program: 5660
Project: 5660
Buggy source:
/** 
 * Lookup a custom property of the dataset.
 * @param key the name of the property
 * @param defaultValue the value to return if property does not exist
 * @return the value of the property or defaultValue if the property does not exist
 */
public long getLongProperty(String key,long defaultValue){
  return properties.containsKey(key) ? Long.parseLong(getProperty(key)) : defaultValue;
}

Fixed version (ground truth):
/** 
 * Lookup a custom property of the dataset.
 * @param key the name of the property
 * @param defaultValue the value to return if property does not exist
 * @return the value of the property or defaultValue if the property does not exist
 */
public long getLongProperty(String key,long defaultValue){
  return properties.containsKey(key) ? Long.parseLong(properties.get(key)) : defaultValue;
}
Program: 5661
Project: 5661
Buggy source:
/** 
 * Lookup a custom property of the dataset.
 * @param key the name of the property
 * @param defaultValue the value to return if property does not exist
 * @return the value of the property or defaultValue if the property does not exist
 */
public int getIntProperty(String key,int defaultValue){
  return properties.containsKey(key) ? Integer.parseInt(getProperty(key)) : defaultValue;
}

Fixed version (ground truth):
/** 
 * Lookup a custom property of the dataset.
 * @param key the name of the property
 * @param defaultValue the value to return if property does not exist
 * @return the value of the property or defaultValue if the property does not exist
 */
public int getIntProperty(String key,int defaultValue){
  return properties.containsKey(key) ? Integer.parseInt(properties.get(key)) : defaultValue;
}
Program: 5662
Project: 5662
Buggy source:
@Override public void process(ApplicationWithPrograms input) throws Exception {
  ApplicationId appId=input.getApplicationId();
  ApplicationSpecification appSpec=input.getSpecification();
  SystemMetadataWriter appSystemMetadataWriter=new AppSystemMetadataWriter(metadataStore,appId,appSpec);
  appSystemMetadataWriter.write();
  writeProgramSystemMetadata(appId,ProgramType.FLOW,appSpec.getFlows().values());
  writeProgramSystemMetadata(appId,ProgramType.MAPREDUCE,appSpec.getMapReduce().values());
  writeProgramSystemMetadata(appId,ProgramType.SERVICE,appSpec.getServices().values());
  writeProgramSystemMetadata(appId,ProgramType.SPARK,appSpec.getSpark().values());
  writeProgramSystemMetadata(appId,ProgramType.WORKER,appSpec.getWorkers().values());
  writeProgramSystemMetadata(appId,ProgramType.WORKFLOW,appSpec.getWorkflows().values());
  emit(input);
}

Fixed version (ground truth):
@Override public void process(ApplicationWithPrograms input) throws Exception {
  ApplicationId appId=input.getApplicationId();
  ApplicationSpecification appSpec=input.getSpecification();
  Map<String,String> properties=metadataStore.getProperties(MetadataScope.SYSTEM,appId);
  SystemMetadataWriter appSystemMetadataWriter=new AppSystemMetadataWriter(metadataStore,appId,appSpec,!properties.isEmpty());
  appSystemMetadataWriter.write();
  writeProgramSystemMetadata(appId,ProgramType.FLOW,appSpec.getFlows().values());
  writeProgramSystemMetadata(appId,ProgramType.MAPREDUCE,appSpec.getMapReduce().values());
  writeProgramSystemMetadata(appId,ProgramType.SERVICE,appSpec.getServices().values());
  writeProgramSystemMetadata(appId,ProgramType.SPARK,appSpec.getSpark().values());
  writeProgramSystemMetadata(appId,ProgramType.WORKER,appSpec.getWorkers().values());
  writeProgramSystemMetadata(appId,ProgramType.WORKFLOW,appSpec.getWorkflows().values());
  emit(input);
}
Program: 5663
Project: 5663
Buggy source:
private void writeProgramSystemMetadata(ApplicationId appId,ProgramType programType,Iterable<? extends ProgramSpecification> specs){
  for (  ProgramSpecification spec : specs) {
    ProgramId programId=appId.program(programType,spec.getName());
    ProgramSystemMetadataWriter writer=new ProgramSystemMetadataWriter(metadataStore,programId,spec);
    writer.write();
  }
}

Fixed version (ground truth):
private void writeProgramSystemMetadata(ApplicationId appId,ProgramType programType,Iterable<? extends ProgramSpecification> specs){
  for (  ProgramSpecification spec : specs) {
    ProgramId programId=appId.program(programType,spec.getName());
    Map<String,String> properties=metadataStore.getProperties(MetadataScope.SYSTEM,programId);
    ProgramSystemMetadataWriter writer=new ProgramSystemMetadataWriter(metadataStore,programId,spec,!properties.isEmpty());
    writer.write();
  }
}
Program: 5664
Project: 5664
Buggy source:
/** 
 * Filter a list of   {@link MetadataSearchResultRecord} that ensures the logged-in user has a privilege on
 * @param results the {@link Set<MetadataSearchResultRecord>} to filter with
 * @return filtered list of {@link MetadataSearchResultRecord}
 */
private Set<MetadataSearchResultRecord> filterAuthorizedSearchResult(Set<MetadataSearchResultRecord> results) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return ImmutableSet.copyOf(Iterables.filter(results,new com.google.common.base.Predicate<MetadataSearchResultRecord>(){
    @Override public boolean apply(    MetadataSearchResultRecord metadataSearchResultRecord){
      return filter.apply(metadataSearchResultRecord.getEntityId());
    }
  }
));
}

Fixed version (ground truth):
/** 
 * Filter a list of   {@link MetadataSearchResultRecord} that ensures the logged-in user has a privilege on
 * @param results the {@link MetadataSearchResponse} to filter
 * @return filtered {@link MetadataSearchResponse}
 */
private MetadataSearchResponse filterAuthorizedSearchResult(MetadataSearchResponse results) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return new MetadataSearchResponse(results.getSort(),results.getOffset(),results.getLimit(),results.getNumCursors(),results.getTotal(),ImmutableSet.copyOf(Iterables.filter(results.getResults(),new com.google.common.base.Predicate<MetadataSearchResultRecord>(){
    @Override public boolean apply(    MetadataSearchResultRecord metadataSearchResultRecord){
      return filter.apply(metadataSearchResultRecord.getEntityId());
    }
  }
)),results.getCursors());
}
Program: 5665
Project: 5665
Buggy source:
/** 
 * Filter a list of   {@link MetadataSearchResultRecord} that ensures the logged-in user has a privilege on
 * @param results the {@link MetadataSearchResponse} to filter
 * @return filtered {@link MetadataSearchResponse}
 */
private MetadataSearchResponse filterAuthorizedSearchResult(MetadataSearchResponse results) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return new MetadataSearchResponse(results.getSort(),results.getOffset(),results.getLimit(),results.getTotal(),ImmutableSet.copyOf(Iterables.filter(results.getResults(),new com.google.common.base.Predicate<MetadataSearchResultRecord>(){
    @Override public boolean apply(    MetadataSearchResultRecord metadataSearchResultRecord){
      return filter.apply(metadataSearchResultRecord.getEntityId());
    }
  }
)),results.getCursors());
}

Fixed version (ground truth):
/** 
 * Filter a list of   {@link MetadataSearchResultRecord} that ensures the logged-in user has a privilege on
 * @param results the {@link MetadataSearchResponse} to filter
 * @return filtered {@link MetadataSearchResponse}
 */
private MetadataSearchResponse filterAuthorizedSearchResult(MetadataSearchResponse results) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return new MetadataSearchResponse(results.getSort(),results.getOffset(),results.getLimit(),results.getNumCursors(),results.getTotal(),ImmutableSet.copyOf(Iterables.filter(results.getResults(),new com.google.common.base.Predicate<MetadataSearchResultRecord>(){
    @Override public boolean apply(    MetadataSearchResultRecord metadataSearchResultRecord){
      return filter.apply(metadataSearchResultRecord.getEntityId());
    }
  }
)),results.getCursors());
}
Program: 5667
Project: 5667
Buggy source:
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") List<String> targets,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String sort,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int offset,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int limit,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numCursors,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String cursor) throws Exception {
  Set<MetadataSearchTargetType> types=Collections.emptySet();
  if (targets != null) {
    types=ImmutableSet.copyOf(Iterables.transform(targets,STRING_TO_TARGET_TYPE));
  }
  SortInfo sortInfo=SortInfo.of(URLDecoder.decode(sort,"String_Node_Str"));
  if (SortInfo.DEFAULT.equals(sortInfo) && !(cursor.isEmpty())) {
    throw new BadRequestException("String_Node_Str");
  }
  MetadataSearchResponse response=metadataAdmin.search(namespaceId,URLDecoder.decode(searchQuery,"String_Node_Str"),types,sortInfo,offset,limit,numCursors,cursor);
  responder.sendJson(HttpResponseStatus.OK,response,MetadataSearchResponse.class,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") List<String> targets,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String sort,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int offset,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int limit,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numCursors,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String cursor) throws Exception {
  Set<MetadataSearchTargetType> types=Collections.emptySet();
  if (targets != null) {
    types=ImmutableSet.copyOf(Iterables.transform(targets,STRING_TO_TARGET_TYPE));
  }
  SortInfo sortInfo=SortInfo.of(URLDecoder.decode(sort,"String_Node_Str"));
  if (SortInfo.DEFAULT.equals(sortInfo)) {
    if (!(cursor.isEmpty()) || 0 != numCursors) {
      throw new BadRequestException("String_Node_Str");
    }
  }
  MetadataSearchResponse response=metadataAdmin.search(namespaceId,URLDecoder.decode(searchQuery,"String_Node_Str"),types,sortInfo,offset,limit,numCursors,cursor);
  responder.sendJson(HttpResponseStatus.OK,response,MetadataSearchResponse.class,GSON);
}
Program: 5668
Project: 5668
Buggy source:
@Test public void testSearch() throws Exception {
  SecurityRequestContext.setUserId(ALICE.getName());
  authorizer.grant(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.WRITE));
  AppFabricTestHelper.deployApplication(Id.Namespace.DEFAULT,AllProgramsApp.class,"String_Node_Str",cConf);
  EnumSet<MetadataSearchTargetType> types=EnumSet.allOf(MetadataSearchTargetType.class);
  Assert.assertFalse(metadataAdmin.search(NamespaceId.DEFAULT.getNamespace(),"String_Node_Str",types,SortInfo.DEFAULT,0,Integer.MAX_VALUE,1,null).getResults().isEmpty());
  SecurityRequestContext.setUserId("String_Node_Str");
  Assert.assertTrue(metadataAdmin.search(NamespaceId.DEFAULT.getNamespace(),"String_Node_Str",types,SortInfo.DEFAULT,0,Integer.MAX_VALUE,1,null).getResults().isEmpty());
}

Fixed version (ground truth):
@Test public void testSearch() throws Exception {
  SecurityRequestContext.setUserId(ALICE.getName());
  authorizer.grant(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.WRITE));
  AppFabricTestHelper.deployApplication(Id.Namespace.DEFAULT,AllProgramsApp.class,"String_Node_Str",cConf);
  EnumSet<MetadataSearchTargetType> types=EnumSet.allOf(MetadataSearchTargetType.class);
  Assert.assertFalse(metadataAdmin.search(NamespaceId.DEFAULT.getNamespace(),"String_Node_Str",types,SortInfo.DEFAULT,0,Integer.MAX_VALUE,0,null).getResults().isEmpty());
  SecurityRequestContext.setUserId("String_Node_Str");
  Assert.assertTrue(metadataAdmin.search(NamespaceId.DEFAULT.getNamespace(),"String_Node_Str",types,SortInfo.DEFAULT,0,Integer.MAX_VALUE,0,null).getResults().isEmpty());
}
Program: 5669
Project: 5669
Buggy source:
/** 
 * strips metadata from search results
 */
@Override protected Set<MetadataSearchResultRecord> searchMetadata(NamespaceId namespaceId,String query,Set<MetadataSearchTargetType> targets,@Nullable String sort) throws Exception {
  Set<MetadataSearchResultRecord> results=super.searchMetadata(namespaceId,query,targets,sort);
  Set<MetadataSearchResultRecord> transformed=new LinkedHashSet<>();
  for (  MetadataSearchResultRecord result : results) {
    transformed.add(new MetadataSearchResultRecord(result.getEntityId()));
  }
  return transformed;
}

Fixed version (ground truth):
/** 
 * strips metadata from search results
 */
@Override protected MetadataSearchResponse searchMetadata(NamespaceId namespaceId,String query,Set<MetadataSearchTargetType> targets,@Nullable String sort,int offset,int limit,int numCursors,@Nullable String cursor) throws Exception {
  MetadataSearchResponse searchResponse=super.searchMetadata(namespaceId,query,targets,sort,offset,limit,numCursors,cursor);
  Set<MetadataSearchResultRecord> transformed=new LinkedHashSet<>();
  for (  MetadataSearchResultRecord result : searchResponse.getResults()) {
    transformed.add(new MetadataSearchResultRecord(result.getEntityId()));
  }
  return new MetadataSearchResponse(searchResponse.getSort(),searchResponse.getOffset(),searchResponse.getLimit(),searchResponse.getNumCursors(),searchResponse.getTotal(),transformed,searchResponse.getCursors());
}
Program: 5671
Project: 5671
Buggy source:
protected Set<MetadataSearchResultRecord> searchMetadata(NamespaceId namespaceId,String query,Set<MetadataSearchTargetType> targets,@Nullable String sort,int numCursors,@Nullable String cursor) throws Exception {
  return metadataClient.searchMetadata(namespaceId.toId(),query,targets,sort,cursor).getResults();
}

Fixed version (ground truth):
protected MetadataSearchResponse searchMetadata(NamespaceId namespaceId,String query,Set<MetadataSearchTargetType> targets,@Nullable String sort,int offset,int limit,int numCursors,@Nullable String cursor) throws Exception {
  return metadataClient.searchMetadata(namespaceId.toId(),query,targets,sort,offset,limit,numCursors,cursor);
}
Program: 5673
Project: 5673
Buggy source:
/** 
 * Also schedules asynchronous stats collection for all   {@link MXBean MXBeans} by calling the{@link OperationalStats#collect()} method.
 */
@Override protected void runOneIteration() throws Exception {
  LOG.debug("String_Node_Str");
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    LOG.debug("String_Node_Str",entry.getValue().getStatType(),entry.getValue().getServiceName());
    try {
      entry.getValue().collect();
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str",entry.getValue().getServiceName(),entry.getValue().getStatType(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Also schedules asynchronous stats collection for all   {@link MXBean MXBeans} by calling the{@link OperationalStats#collect()} method.
 */
@Override protected void runOneIteration() throws Exception {
  LOG.debug("String_Node_Str");
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    LOG.debug("String_Node_Str",entry.getValue().getStatType(),entry.getValue().getServiceName());
    try {
      entry.getValue().collect();
    }
 catch (    Throwable t) {
      LOG.warn("String_Node_Str",entry.getValue().getServiceName(),entry.getValue().getStatType(),t);
    }
  }
}
Program: 5674
Project: 5674
Buggy source:
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",entry.getValue());
    mbs.registerMBean(entry.getValue(),objectName);
  }
}

Fixed version (ground truth):
/** 
 * Registers all JMX   {@link MXBean MXBeans} from {@link OperationalStats} extensions in the extensions directory.
 */
@Override protected void startUp() throws Exception {
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    ObjectName objectName=getObjectName(entry.getValue());
    if (objectName == null) {
      LOG.warn("String_Node_Str",OperationalStats.class.getName());
      continue;
    }
    LOG.debug("String_Node_Str",entry.getValue());
    mbs.registerMBean(entry.getValue(),objectName);
  }
  LOG.info("String_Node_Str");
}
Program: 5675
Project: 5675
Buggy source:
private URL getResourceManager() throws IOException {
  if (HAUtil.isHAEnabled(conf)) {
    return getHAWebURL();
  }
  return getNonHAWebURL();
}

Fixed version (ground truth):
private URL getResourceManager() throws IOException {
  if (conf.getBoolean(YarnConfiguration.RM_HA_ENABLED,YarnConfiguration.DEFAULT_RM_HA_ENABLED)) {
    return getHAWebURL();
  }
  return getNonHAWebURL();
}
Program: 5677
Project: 5677
Buggy source:
@Override public int complete(String buffer,int cursor,List<CharSequence> candidates){
  Map<String,String> arguments=ArgumentParser.getArguments(buffer,PATTERN);
  ProgramIdArgument programIdArgument=ArgumentParser.parseProgramId(arguments.get(PROGRAM_ID));
  if (programIdArgument != null) {
    ServiceId service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
    completer.setEndpoints(getEndpoints(service,arguments.get(METHOD)));
  }
 else {
    completer.setEndpoints(Collections.<String>emptyList());
  }
  return super.complete(buffer,cursor,candidates);
}

Fixed version (ground truth):
@Override public int complete(String buffer,int cursor,List<CharSequence> candidates){
  Map<String,String> arguments=ArgumentParser.getArguments(buffer,PATTERN);
  ProgramIdArgument programIdArgument=ArgumentParser.parseProgramId(arguments.get(SERVICE_ID));
  if (programIdArgument != null) {
    ServiceId service;
    if (arguments.get(APP_VERSION) == null) {
      service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
    }
 else {
      service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId(),arguments.get(APP_VERSION)).service(programIdArgument.getProgramId());
    }
    completer.setEndpoints(getEndpoints(service,arguments.get(METHOD)));
  }
 else {
    completer.setEndpoints(Collections.<String>emptyList());
  }
  return super.complete(buffer,cursor,candidates);
}
Program: 5678
Project: 5678
Buggy source:
@Override public int complete(String buffer,int cursor,List<CharSequence> candidates){
  Map<String,String> arguments=ArgumentParser.getArguments(buffer,PATTERN);
  ProgramIdArgument programIdArgument=ArgumentParser.parseProgramId(arguments.get(PROGRAM_ID));
  if (programIdArgument != null) {
    ServiceId service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
    completer.setEndpoints(getMethods(service));
  }
 else {
    completer.setEndpoints(Collections.<String>emptyList());
  }
  return super.complete(buffer,cursor,candidates);
}

Fixed version (ground truth):
@Override public int complete(String buffer,int cursor,List<CharSequence> candidates){
  Map<String,String> arguments=ArgumentParser.getArguments(buffer,PATTERN);
  ProgramIdArgument programIdArgument=ArgumentParser.parseProgramId(arguments.get(SERVICE_ID));
  if (programIdArgument != null) {
    ServiceId service;
    if (arguments.get(APP_VERSION) == null) {
      service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId()).service(programIdArgument.getProgramId());
    }
 else {
      service=cliConfig.getCurrentNamespace().app(programIdArgument.getAppId(),arguments.get(APP_VERSION)).service(programIdArgument.getProgramId());
    }
    completer.setEndpoints(getMethods(service));
  }
 else {
    completer.setEndpoints(Collections.<String>emptyList());
  }
  return super.complete(buffer,cursor,candidates);
}
Program: 5679
Project: 5679
Buggy source:
@Override public Completer getCompleter(String prefix,Completer completer){
  if (prefix != null && !prefix.isEmpty()) {
    String prefixMatch=prefix.replaceAll("String_Node_Str","String_Node_Str");
    if (METHOD_PREFIX.equals(prefixMatch)) {
      return new HttpMethodPrefixCompleter(serviceClient,cliConfig,prefix,(EndpointCompleter)completer);
    }
 else     if (ENDPOINT_PREFIX.equals(prefixMatch)) {
      return new HttpEndpointPrefixCompleter(serviceClient,cliConfig,prefix,(EndpointCompleter)completer);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Completer getCompleter(String prefix,Completer completer){
  if (prefix != null && !prefix.isEmpty()) {
    String prefixMatch=prefix.replaceAll("String_Node_Str","String_Node_Str");
    if ((METHOD_PREFIX.equals(prefixMatch) || METHOD_PREFIX_WITH_APP_VERSION.equals(prefixMatch)) && completer instanceof EndpointCompleter) {
      return new HttpMethodPrefixCompleter(serviceClient,cliConfig,prefix,(EndpointCompleter)completer);
    }
 else     if (ENDPOINT_PREFIX.equals(prefixMatch) || ENDPOINT_PREFIX_WITH_APP_VERSION.equals(prefixMatch)) {
      return new HttpEndpointPrefixCompleter(serviceClient,cliConfig,prefix,(EndpointCompleter)completer);
    }
  }
  return null;
}
Program: 5681
Project: 5681
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  try (final HConnection hbaseConnection=HConnectionManager.createConnection(hConf)){
    hbaseConnection.listTables();
    LOG.info("String_Node_Str");
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str");
  try {
    new HTableNameConverterFactory().get();
  }
 catch (  ProvisionException e) {
    throw new RuntimeException("String_Node_Str" + HBaseVersion.getVersionString());
  }
  LOG.info("String_Node_Str");
  LOG.info("String_Node_Str");
  try (final HConnection hbaseConnection=HConnectionManager.createConnection(hConf)){
    hbaseConnection.listTables();
    LOG.info("String_Node_Str");
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str",e);
  }
}
Program: 5683
Project: 5683
Buggy source:
@Override public void onReceived(Iterator<FetchedMessage> messages){
  final ByteBufferInputStream is=new ByteBufferInputStream(null);
  List<MetricValues> records=Lists.newArrayList();
  while (messages.hasNext()) {
    FetchedMessage input=messages.next();
    try {
      MetricValues metricValues=recordReader.read(new BinaryDecoder(is.reset(input.getPayload())),recordSchema);
      records.add(metricValues);
    }
 catch (    IOException e) {
      LOG.info("String_Node_Str",e.getMessage());
    }
  }
  if (records.isEmpty()) {
    LOG.info("String_Node_Str");
    return;
  }
  try {
    addProcessingStats(records);
    metricStore.add(records);
  }
 catch (  Exception e) {
    String msg="String_Node_Str";
    LOG.error(msg);
    throw new RuntimeException(msg,e);
  }
  recordProcessed+=records.size();
  if (recordProcessed % 1000 == 0) {
    LOG.info("String_Node_Str",recordProcessed);
    LOG.info("String_Node_Str",records.get(records.size() - 1).getTimestamp());
  }
}

Fixed version (ground truth):
@Override public void onReceived(Iterator<FetchedMessage> messages){
  ByteBufferInputStream is=new ByteBufferInputStream(null);
  List<MetricValues> records=Lists.newArrayList();
  while (messages.hasNext()) {
    FetchedMessage input=messages.next();
    try {
      MetricValues metricValues=recordReader.read(new BinaryDecoder(is.reset(input.getPayload())),recordSchema);
      records.add(metricValues);
    }
 catch (    IOException e) {
      LOG.info("String_Node_Str",e.getMessage());
    }
  }
  if (records.isEmpty()) {
    LOG.info("String_Node_Str");
    return;
  }
  try {
    addProcessingStats(records);
    metricStore.add(records);
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  recordsProcessed+=records.size();
  if (System.currentTimeMillis() > lastLoggedMillis + TimeUnit.MINUTES.toMillis(1)) {
    lastLoggedMillis=System.currentTimeMillis();
    LOG.info("String_Node_Str",recordsProcessed,records.get(records.size() - 1).getTimestamp());
  }
}
Program: 5684
Project: 5684
Buggy source:
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  return cliService.openSession("String_Node_Str","String_Node_Str",sessionConf);
}

Fixed version (ground truth):
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  try {
    return cliService.openSession(UserGroupInformation.getCurrentUser().getShortUserName(),"String_Node_Str",sessionConf);
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
}
Program: 5685
Project: 5685
Buggy source:
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  return cliService.openSession("String_Node_Str","String_Node_Str",sessionConf);
}

Fixed version (ground truth):
protected SessionHandle doOpenHiveSession(Map<String,String> sessionConf) throws HiveSQLException {
  try {
    return cliService.openSession(UserGroupInformation.getCurrentUser().getShortUserName(),"String_Node_Str",sessionConf);
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
}