nus-yam/ex-repair huggingface dataset:
Program: 4669
Project: 4669
Buggy source:
@Test public void testArtifact(){
  Authorizable authorizable;
  ArtifactId artifactId=new ArtifactId("String_Node_Str","String_Node_Str","String_Node_Str");
  authorizable=Authorizable.fromEntityId(artifactId);
  String artifactIdNoVer=artifactId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(artifactIdNoVer,authorizable.toString());
  String widcardId=artifactIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}

Fixed version (ground truth):
@Test public void testArtifact(){
  Authorizable authorizable;
  ArtifactId artifactId=new ArtifactId("String_Node_Str","String_Node_Str","String_Node_Str");
  authorizable=Authorizable.fromEntityId(artifactId);
  String artifactIdNoVer=artifactId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(artifactIdNoVer,authorizable.toString());
  String widcardId=artifactIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  verifyInvalidString("String_Node_Str");
  verifyInvalidString("String_Node_Str");
}
Program: 4670
Project: 4670
Buggy source:
@Test public void testNamespace(){
  Authorizable authorizable;
  NamespaceId namespaceId=new NamespaceId("String_Node_Str");
  authorizable=Authorizable.fromEntityId(namespaceId);
  Assert.assertEquals(namespaceId.toString(),authorizable.toString());
  String wildcardNs=namespaceId.toString() + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  wildcardNs=namespaceId.toString() + "String_Node_Str" + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  String widcardId=namespaceId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}

Fixed version (ground truth):
@Test public void testNamespace(){
  Authorizable authorizable;
  NamespaceId namespaceId=new NamespaceId("String_Node_Str");
  authorizable=Authorizable.fromEntityId(namespaceId);
  Assert.assertEquals(namespaceId.toString(),authorizable.toString());
  String wildcardNs=namespaceId.toString() + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  wildcardNs=namespaceId.toString() + "String_Node_Str" + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  String widcardId=namespaceId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  verifyInvalidString("String_Node_Str");
}
Program: 4671
Project: 4671
Buggy source:
@Test public void testStream(){
  StreamId streamId=new StreamId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(streamId);
  Assert.assertEquals(streamId.toString(),authorizable.toString());
  String widcardId=streamId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}

Fixed version (ground truth):
@Test public void testStream(){
  StreamId streamId=new StreamId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(streamId);
  Assert.assertEquals(streamId.toString(),authorizable.toString());
  String widcardId=streamId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  verifyInvalidString("String_Node_Str");
  verifyInvalidString("String_Node_Str");
  verifyInvalidString("String_Node_Str");
}
Program: 4672
Project: 4672
Buggy source:
@Test public void testDataset(){
  DatasetId datasetId=new DatasetId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetId);
  Assert.assertEquals(datasetId.toString(),authorizable.toString());
  String widcardId=datasetId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}

Fixed version (ground truth):
@Test public void testDataset(){
  DatasetId datasetId=new DatasetId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetId);
  Assert.assertEquals(datasetId.toString(),authorizable.toString());
  String widcardId=datasetId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  verifyInvalidString("String_Node_Str");
  verifyInvalidString("String_Node_Str");
}
Program: 4673
Project: 4673
Buggy source:
@Test public void testProgram(){
  ProgramId programId=new ProgramId("String_Node_Str","String_Node_Str",ProgramType.MAPREDUCE,"String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(programId);
  Assert.assertEquals(programId.toString().replace(ApplicationId.DEFAULT_VERSION + "String_Node_Str","String_Node_Str"),authorizable.toString());
  String wildCardProgramId=programId.toString() + "String_Node_Str";
  try {
    Authorizable.fromString(wildCardProgramId);
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  programId=appId.program(ProgramType.MAPREDUCE,"String_Node_Str");
  authorizable=Authorizable.fromEntityId(programId);
  String programIdNoVer=programId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(programIdNoVer,authorizable.toString());
  String widcardId=programIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  String allProgs="String_Node_Str";
  Assert.assertEquals(allProgs,Authorizable.fromString(allProgs).toString());
}

Fixed version (ground truth):
@Test public void testProgram(){
  ProgramId programId=new ProgramId("String_Node_Str","String_Node_Str",ProgramType.MAPREDUCE,"String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(programId);
  Assert.assertEquals(programId.toString().replace(ApplicationId.DEFAULT_VERSION + "String_Node_Str","String_Node_Str"),authorizable.toString());
  String wildCardProgramId=programId.toString() + "String_Node_Str";
  verifyInvalidString(wildCardProgramId);
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  programId=appId.program(ProgramType.MAPREDUCE,"String_Node_Str");
  authorizable=Authorizable.fromEntityId(programId);
  String programIdNoVer=programId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(programIdNoVer,authorizable.toString());
  String widcardId=programIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  String allProgs="String_Node_Str";
  Assert.assertEquals(allProgs,Authorizable.fromString(allProgs).toString());
  verifyInvalidString("String_Node_Str");
  verifyInvalidString("String_Node_Str");
}
Program: 4674
Project: 4674
Buggy source:
@Test public void testApplication(){
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(appId);
  String appIdNoVer=appId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(appIdNoVer,authorizable.toString());
  try {
    Authorizable.fromString(appId.toString());
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
  String widcardId=appIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}

Fixed version (ground truth):
@Test public void testApplication(){
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(appId);
  String appIdNoVer=appId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(appIdNoVer,authorizable.toString());
  verifyInvalidString(appId.toString());
  String widcardId=appIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  verifyInvalidString("String_Node_Str");
}
Program: 4675
Project: 4675
Buggy source:
/** 
 * Returns the transction timeout based on the given arguments or, as fallback, the CConfiguration.
 * @returns the integer value of the argument system.data.tx.timeout, or if that is not given in the arguments,the value for data.tx.timeout from the CConfiguration.
 * @throws IllegalArgumentException if the transaction timeout exceeds the transaction timeout limit given in theCConfiguratuion.
 */
public static int getTransactionTimeout(Map<String,String> args,CConfiguration cConf){
  Integer timeout=getPositiveInt(args,TRANSACTION_TIMEOUT,"String_Node_Str");
  if (timeout == null) {
    return cConf.getInt(TxConstants.Manager.CFG_TX_TIMEOUT);
  }
  int maxTimeout=cConf.getInt(TxConstants.Manager.CFG_TX_MAX_TIMEOUT);
  if (timeout > maxTimeout) {
    throw new IllegalArgumentException(String.format("String_Node_Str",TRANSACTION_TIMEOUT,timeout,TxConstants.Manager.CFG_TX_MAX_TIMEOUT,maxTimeout));
  }
  return timeout;
}

Fixed version (ground truth):
/** 
 * Returns the transaction timeout based on the given arguments or, as fallback, the CConfiguration.
 * @return the integer value of the argument system.data.tx.timeout, or if that is not given in the arguments,the value for data.tx.timeout from the CConfiguration.
 * @throws IllegalArgumentException if the transaction timeout exceeds the transaction timeout limit given in the{@link CConfiguration}.
 */
public static int getTransactionTimeout(Map<String,String> args,CConfiguration cConf){
  Integer timeout=getPositiveInt(args,TRANSACTION_TIMEOUT,"String_Node_Str");
  if (timeout == null) {
    return cConf.getInt(TxConstants.Manager.CFG_TX_TIMEOUT);
  }
  int maxTimeout=cConf.getInt(TxConstants.Manager.CFG_TX_MAX_TIMEOUT);
  if (timeout > maxTimeout) {
    throw new IllegalArgumentException(String.format("String_Node_Str",TRANSACTION_TIMEOUT,timeout,TxConstants.Manager.CFG_TX_MAX_TIMEOUT,maxTimeout));
  }
  return timeout;
}
Program: 4676
Project: 4676
Buggy source:
/** 
 * Set the log level for the   {@link LogAppenderInitializer}.
 * @param args the arguments to use for looking up resources configurations
 * @param initializer the LogAppenderInitializer which will be used to set up the log level
 */
public static void setLogLevel(Map<String,String> args,LogAppenderInitializer initializer){
  initializer.setLogLevels(getLogLevels(args));
}

Fixed version (ground truth):
/** 
 * Set the log level for the   {@link LogAppenderInitializer}.
 * @param args the arguments to use for looking up resources configurations
 * @param initializer the LogAppenderInitializer which will be used to set up the log level
 */
public static void setLogLevel(Arguments args,LogAppenderInitializer initializer){
  initializer.setLogLevels(getLogLevels(args.asMap()));
}
Program: 4677
Project: 4677
Buggy source:
public static Map<String,String> getLogLevels(Map<String,String> args){
  Map<String,String> logLevels=new HashMap<>();
  for (  Map.Entry<String,String> entry : args.entrySet()) {
    String loggerName=entry.getKey();
    if (loggerName.length() > LOG_LEVEL.length() && loggerName.startsWith(LOG_LEVEL)) {
      logLevels.put(loggerName.substring(LOG_LEVEL.length() + 1),entry.getValue());
    }
  }
  String logLevel=args.get(LOG_LEVEL);
  if (logLevel != null) {
    logLevels.put(Logger.ROOT_LOGGER_NAME,logLevel);
  }
  return logLevels;
}

Fixed version (ground truth):
/** 
 * Extracts log level settings from the given arguments. It extracts arguments prefixed with key  {@link #LOG_LEVEL} + {@code .}, with the remaining part of the key as the logger name, with the argument value as the log level. Also, the key   {@link #LOG_LEVEL} will be used to setup the log level of the root logger.
 */
public static Map<String,Level> getLogLevels(Map<String,String> args){
  String logLevelPrefix=LOG_LEVEL + "String_Node_Str";
  Map<String,Level> logLevels=new HashMap<>();
  for (  Map.Entry<String,String> entry : args.entrySet()) {
    String key=entry.getKey();
    if (key.startsWith(logLevelPrefix)) {
      logLevels.put(key.substring(logLevelPrefix.length()),Level.toLevel(entry.getValue()));
    }
  }
  String logLevel=args.get(LOG_LEVEL);
  if (logLevel != null) {
    logLevels.put(Logger.ROOT_LOGGER_NAME,Level.toLevel(logLevel));
  }
  return logLevels;
}
Program: 4678
Project: 4678
Buggy source:
@Override protected TwillPreparer setLogLevels(TwillPreparer twillPreparer,Program program,ProgramOptions options){
  FlowSpecification spec=program.getApplicationSpecification().getFlows().get(program.getName());
  for (  String flowlet : spec.getFlowlets().keySet()) {
    Map<String,String> logLevels=SystemArguments.getLogLevels(RuntimeArguments.extractScope(FlowUtils.FLOWLET_SCOPE,flowlet,options.getUserArguments().asMap()));
    if (!logLevels.isEmpty()) {
      twillPreparer.setLogLevels(flowlet,transformLogLevels(logLevels));
    }
  }
  return twillPreparer;
}

Fixed version (ground truth):
@Override protected TwillPreparer setLogLevels(TwillPreparer twillPreparer,Program program,ProgramOptions options){
  Map<String,String> arguments=options.getUserArguments().asMap();
  FlowSpecification spec=program.getApplicationSpecification().getFlows().get(program.getName());
  for (  String flowlet : spec.getFlowlets().keySet()) {
    Map<String,Level> logLevels=SystemArguments.getLogLevels(RuntimeArguments.extractScope(FlowUtils.FLOWLET_SCOPE,flowlet,arguments));
    if (!logLevels.isEmpty()) {
      twillPreparer.setLogLevels(flowlet,transformLogLevels(logLevels));
    }
  }
  return twillPreparer;
}
Program: 4679
Project: 4679
Buggy source:
protected TwillPreparer setLogLevels(TwillPreparer twillPreparer,Program program,ProgramOptions options){
  Map<String,String> logLevels=SystemArguments.getLogLevels(options.getUserArguments().asMap());
  if (logLevels.isEmpty()) {
    return twillPreparer;
  }
  return twillPreparer.setLogLevels(transformLogLevels(logLevels));
}

Fixed version (ground truth):
protected TwillPreparer setLogLevels(TwillPreparer twillPreparer,Program program,ProgramOptions options){
  Map<String,Level> logLevels=SystemArguments.getLogLevels(options.getUserArguments().asMap());
  if (logLevels.isEmpty()) {
    return twillPreparer;
  }
  return twillPreparer.setLogLevels(transformLogLevels(logLevels));
}
Program: 4680
Project: 4680
Buggy source:
protected Map<String,LogEntry.Level> transformLogLevels(Map<String,String> logLevels){
  return Maps.transformValues(logLevels,new Function<String,LogEntry.Level>(){
    @Override public LogEntry.Level apply(    String input){
      return LogEntry.Level.valueOf(input.toUpperCase());
    }
  }
);
}

Fixed version (ground truth):
protected Map<String,LogEntry.Level> transformLogLevels(Map<String,Level> logLevels){
  return Maps.transformValues(logLevels,new Function<Level,LogEntry.Level>(){
    @Override public LogEntry.Level apply(    Level level){
      if (level.equals(Level.ALL)) {
        return LogEntry.Level.TRACE;
      }
      if (level.equals(Level.OFF)) {
        return LogEntry.Level.FATAL;
      }
      return LogEntry.Level.valueOf(level.toString());
    }
  }
);
}
Program: 4681
Project: 4681
Buggy source:
@Override public LogEntry.Level apply(String input){
  return LogEntry.Level.valueOf(input.toUpperCase());
}

Fixed version (ground truth):
@Override public LogEntry.Level apply(Level level){
  if (level.equals(Level.ALL)) {
    return LogEntry.Level.TRACE;
  }
  if (level.equals(Level.OFF)) {
    return LogEntry.Level.FATAL;
  }
  return LogEntry.Level.valueOf(level.toString());
}
Program: 4682
Project: 4682
Buggy source:
public void setLogLevels(Map<String,String> logPairs){
  LoggerContext loggerContext=getLoggerContext();
  if (loggerContext != null) {
    for (    Map.Entry<String,String> entry : logPairs.entrySet()) {
      String loggerName=entry.getKey();
      String logLevel=entry.getValue();
      Logger logger=loggerContext.getLogger(loggerName);
      LOG.info("String_Node_Str",loggerName,logger.getLevel(),logLevel);
      logger.setLevel(Level.toLevel(logLevel));
    }
  }
}

Fixed version (ground truth):
public void setLogLevels(Map<String,Level> logPairs){
  LoggerContext loggerContext=getLoggerContext();
  if (loggerContext != null) {
    for (    Map.Entry<String,Level> entry : logPairs.entrySet()) {
      String loggerName=entry.getKey();
      Level logLevel=entry.getValue();
      Logger logger=loggerContext.getLogger(loggerName);
      LOG.info("String_Node_Str",loggerName,logger.getLevel(),logLevel);
      logger.setLevel(logLevel);
    }
  }
}
Program: 4683
Project: 4683
Buggy source:
@BeforeClass public static void beforeClass() throws Exception {
  cConf=CConfiguration.create();
  hBaseTableUtil=new HBaseTableUtilFactory(cConf,new SimpleNamespaceQueryAdmin()).get();
  ddlExecutor=new HBaseDDLExecutorFactory(cConf,TEST_HBASE.getConfiguration()).get();
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE1));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE2));
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws Exception {
  cConf=CConfiguration.create();
  hBaseTableUtil=new HBaseTableUtilFactory(cConf,new SimpleNamespaceQueryAdmin()).get();
  ddlExecutor=new HBaseDDLExecutorFactory(cConf,TEST_HBASE.getConfiguration()).get();
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NamespaceId.SYSTEM));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE1));
  ddlExecutor.createNamespaceIfNotExists(hBaseTableUtil.getHBaseNamespace(NAMESPACE2));
  ConfigurationWriter writer=new ConfigurationWriter(TEST_HBASE.getConfiguration(),cConf);
  writer.write(ConfigurationReader.Type.DEFAULT,cConf);
}
Program: 4684
Project: 4684
Buggy source:
@Override protected Configuration getSnapshotConfiguration() throws IOException {
  CConfiguration cConf=configReader.read();
  Configuration txConf=HBaseConfiguration.create(getConf());
  CConfigurationUtil.copyTxProperties(cConf,txConf);
  return txConf;
}

Fixed version (ground truth):
@Override protected Configuration getSnapshotConfiguration() throws IOException {
  CConfiguration cConf=configReader.read();
  Configuration txConf=HBaseConfiguration.create(getConf());
  CConfigurationUtil.copyTxProperties(cConf,txConf);
  setId(cConf.get(Constants.INSTANCE_NAME));
  return txConf;
}
Program: 4685
Project: 4685
Buggy source:
@Override public int getTotalMemory(){
  return totalMemory;
}

Fixed version (ground truth):
@Override public long getTotalMemory(){
  return totalMemory;
}
Program: 4686
Project: 4686
Buggy source:
@Override public int getFreeMemory(){
  return totalMemory - usedMemory;
}

Fixed version (ground truth):
@Override public long getFreeMemory(){
  return totalMemory - usedMemory;
}
Program: 4687
Project: 4687
Buggy source:
@Override public int getUsedMemory(){
  return usedMemory;
}

Fixed version (ground truth):
@Override public long getUsedMemory(){
  return usedMemory;
}
Program: 4688
Project: 4688
Buggy source:
@Override public synchronized void collect() throws Exception {
  reset();
  List<NodeReport> nodeReports;
  YarnClient yarnClient=createYARNClient();
  try {
    nodeReports=yarnClient.getNodeReports();
  }
  finally {
    yarnClient.stop();
  }
  for (  NodeReport nodeReport : nodeReports) {
    NodeId nodeId=nodeReport.getNodeId();
    LOG.debug("String_Node_Str",nodeId);
    if (!nodeReport.getNodeState().isUnusable()) {
      Resource nodeCapability=nodeReport.getCapability();
      Resource nodeUsed=nodeReport.getUsed();
      if (nodeCapability != null) {
        LOG.debug("String_Node_Str",nodeId,nodeCapability.getMemory(),nodeCapability.getVirtualCores());
        totalMemory+=nodeCapability.getMemory();
        totalVCores+=nodeCapability.getVirtualCores();
      }
      if (nodeUsed != null) {
        LOG.debug("String_Node_Str",nodeId,nodeUsed.getMemory(),nodeUsed.getVirtualCores());
        usedMemory+=nodeUsed.getMemory();
        usedVCores+=nodeUsed.getVirtualCores();
      }
    }
  }
}

Fixed version (ground truth):
@Override public synchronized void collect() throws Exception {
  reset();
  List<NodeReport> nodeReports;
  YarnClient yarnClient=createYARNClient();
  try {
    nodeReports=yarnClient.getNodeReports();
  }
  finally {
    yarnClient.stop();
  }
  for (  NodeReport nodeReport : nodeReports) {
    NodeId nodeId=nodeReport.getNodeId();
    LOG.debug("String_Node_Str",nodeId);
    if (!nodeReport.getNodeState().isUnusable()) {
      Resource nodeCapability=nodeReport.getCapability();
      Resource nodeUsed=nodeReport.getUsed();
      if (nodeCapability != null) {
        LOG.debug("String_Node_Str",nodeId,nodeCapability.getMemory(),nodeCapability.getVirtualCores());
        totalMemory+=nodeCapability.getMemory();
        totalVCores+=nodeCapability.getVirtualCores();
      }
      if (nodeUsed != null) {
        LOG.debug("String_Node_Str",nodeId,nodeUsed.getMemory(),nodeUsed.getVirtualCores());
        usedMemory+=nodeUsed.getMemory();
        usedVCores+=nodeUsed.getVirtualCores();
      }
    }
  }
  usedMemory*=BYTES_PER_MB;
  totalMemory*=BYTES_PER_MB;
}
Program: 4689
Project: 4689
Buggy source:
/** 
 * Returns the total memory in YARN.
 */
int getTotalMemory();

Fixed version (ground truth):
/** 
 * Returns the total memory in YARN.
 */
long getTotalMemory();
Program: 4690
Project: 4690
Buggy source:
/** 
 * Returns the free memory in YARN.
 */
int getFreeMemory();

Fixed version (ground truth):
/** 
 * Returns the free memory in YARN.
 */
long getFreeMemory();
Program: 4691
Project: 4691
Buggy source:
/** 
 * Returns the used memory in YARN.
 */
int getUsedMemory();

Fixed version (ground truth):
/** 
 * Returns the used memory in YARN.
 */
long getUsedMemory();
Program: 4693
Project: 4693
Buggy source:
@Override public final UGIWithPrincipal getConfiguredUGI(ImpersonationRequest impersonationRequest) throws IOException {
  try {
    UGIWithPrincipal ugi=impersonationRequest.getImpersonatedOpType().equals(ImpersonatedOpType.EXPLORE) || impersonationRequest.getPrincipal() == null ? null : ugiCache.getIfPresent(new UGICacheKey(impersonationRequest));
    if (ugi != null) {
      return ugi;
    }
    boolean isCache=checkExploreAndDetermineCache(impersonationRequest);
    ImpersonationInfo info=getPrincipalForEntity(impersonationRequest);
    ImpersonationRequest newRequest=new ImpersonationRequest(impersonationRequest.getEntityId(),impersonationRequest.getImpersonatedOpType(),info.getPrincipal(),info.getKeytabURI());
    return isCache ? ugiCache.get(new UGICacheKey(newRequest)) : createUGI(newRequest);
  }
 catch (  ExecutionException e) {
    Throwable cause=Throwables.getRootCause(e);
    Throwables.propagateIfPossible(cause,IOException.class);
    throw new IOException(cause);
  }
}

Fixed version (ground truth):
@Override public final UGIWithPrincipal getConfiguredUGI(ImpersonationRequest impersonationRequest) throws IOException {
  try {
    UGIWithPrincipal ugi=impersonationRequest.getImpersonatedOpType().equals(ImpersonatedOpType.EXPLORE) || impersonationRequest.getPrincipal() == null ? null : ugiCache.getIfPresent(new UGICacheKey(impersonationRequest));
    if (ugi != null) {
      return ugi;
    }
    boolean isCache=checkExploreAndDetermineCache(impersonationRequest);
    ImpersonationInfo info=getPrincipalForEntity(impersonationRequest);
    ImpersonationRequest newRequest=new ImpersonationRequest(impersonationRequest.getEntityId(),impersonationRequest.getImpersonatedOpType(),info.getPrincipal(),info.getKeytabURI());
    return isCache ? ugiCache.get(new UGICacheKey(newRequest)) : createUGI(newRequest);
  }
 catch (  ExecutionException e) {
    Throwable cause=e.getCause();
    Throwables.propagateIfPossible(cause,IOException.class);
    throw new IOException(cause);
  }
}
Program: 4695
Project: 4695
Buggy source:
@Override public void readFields(DataInput in) throws IOException {
  int schemaLen=in.readInt();
  byte[] schemaBytes=new byte[schemaLen];
  in.readFully(schemaBytes,0,schemaLen);
  String schemaStr=Bytes.toString(schemaBytes);
  Schema schema=Schema.parseJson(schemaStr);
  int recordLen=in.readInt();
  byte[] recordBytes=new byte[recordLen];
  in.readFully(recordBytes,0,recordLen);
  String recordStr=Bytes.toString(recordBytes);
  this.record=StructuredRecordStringConverter.fromJsonString(recordStr,schema);
}

Fixed version (ground truth):
@Override public void readFields(DataInput in) throws IOException {
  int schemaLen=in.readInt();
  byte[] schemaBytes=new byte[schemaLen];
  in.readFully(schemaBytes,0,schemaLen);
  Schema schema;
  if (schemaCache.containsKey(schemaBytes)) {
    schema=schemaCache.get(schemaBytes);
  }
 else {
    String schemaStr=Bytes.toString(schemaBytes);
    schema=Schema.parseJson(schemaStr);
    schemaCache.put(schemaBytes,schema);
  }
  int recordLen=in.readInt();
  byte[] recordBytes=new byte[recordLen];
  in.readFully(recordBytes,0,recordLen);
  String recordStr=Bytes.toString(recordBytes);
  this.record=StructuredRecordStringConverter.fromJsonString(recordStr,schema);
}
Program: 4696
Project: 4696
Buggy source:
@Override public void start() throws Exception {
  if (authServer != null) {
    try {
      LOG.info("String_Node_Str");
      SecurityUtil.enableKerberosLogin(configuration);
      co.cask.cdap.common.service.Services.startAndWait(zkClientService,configuration.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS),TimeUnit.MILLISECONDS,String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",configuration.get(Constants.Zookeeper.QUORUM)));
      authServer.startAndWait();
    }
 catch (    Exception e) {
      Throwable rootCause=Throwables.getRootCause(e);
      if (rootCause instanceof ServiceBindException) {
        LOG.error("String_Node_Str",rootCause.getMessage());
      }
 else {
        LOG.error("String_Node_Str");
      }
    }
  }
 else {
    String warning="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    LOG.warn(warning);
  }
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  if (authServer != null) {
    try {
      LOG.info("String_Node_Str");
      SecurityUtil.enableKerberosLogin(configuration);
      co.cask.cdap.common.service.Services.startAndWait(zkClientService,configuration.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS),TimeUnit.MILLISECONDS,String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",configuration.get(Constants.Zookeeper.QUORUM)));
      authServer.startAndWait();
    }
 catch (    Exception e) {
      Throwable rootCause=Throwables.getRootCause(e);
      if (rootCause instanceof ServiceBindException) {
        LOG.error("String_Node_Str",rootCause.getMessage());
      }
 else {
        LOG.error("String_Node_Str",e);
      }
    }
  }
 else {
    String warning="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    LOG.warn(warning);
  }
}
Program: 4698
Project: 4698
Buggy source:
@Inject AbstractRunRecordCorrectorService(Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  this.store=store;
  this.programStateWriter=programStateWriter;
  this.programLifecycleService=programLifecycleService;
  this.runtimeService=runtimeService;
}

Fixed version (ground truth):
@Inject AbstractRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  this.store=store;
  this.programStateWriter=programStateWriter;
  this.programLifecycleService=programLifecycleService;
  this.runtimeService=runtimeService;
  this.startTimeoutSecs=2L * cConf.getLong(Constants.AppFabric.PROGRAM_MAX_START_SECONDS);
}
Program: 4700
Project: 4700
Buggy source:
@Inject public DistributedRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(store,programStateWriter,programLifecycleService,runtimeService);
  this.cConf=cConf;
}

Fixed version (ground truth):
@Inject public DistributedRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(cConf,store,programStateWriter,programLifecycleService,runtimeService);
  this.cConf=cConf;
}
Program: 4701
Project: 4701
Buggy source:
@Inject public LocalRunRecordCorrectorService(Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(store,programStateWriter,programLifecycleService,runtimeService);
}

Fixed version (ground truth):
@Inject public LocalRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(cConf,store,programStateWriter,programLifecycleService,runtimeService);
}
Program: 4705
Project: 4705
Buggy source:
@Inject AbstractRunRecordCorrectorService(Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  this.store=store;
  this.programStateWriter=programStateWriter;
  this.programLifecycleService=programLifecycleService;
  this.runtimeService=runtimeService;
}

Fixed version (ground truth):
@Inject AbstractRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  this.store=store;
  this.programStateWriter=programStateWriter;
  this.programLifecycleService=programLifecycleService;
  this.runtimeService=runtimeService;
  this.startTimeoutSecs=2L * cConf.getLong(Constants.AppFabric.PROGRAM_MAX_START_SECONDS);
}
Program: 4707
Project: 4707
Buggy source:
@Inject public DistributedRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(store,programStateWriter,programLifecycleService,runtimeService);
  this.cConf=cConf;
}

Fixed version (ground truth):
@Inject public DistributedRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(cConf,store,programStateWriter,programLifecycleService,runtimeService);
  this.cConf=cConf;
}
Program: 4708
Project: 4708
Buggy source:
@Inject public LocalRunRecordCorrectorService(Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(store,programStateWriter,programLifecycleService,runtimeService);
}

Fixed version (ground truth):
@Inject public LocalRunRecordCorrectorService(CConfiguration cConf,Store store,ProgramStateWriter programStateWriter,ProgramLifecycleService programLifecycleService,ProgramRuntimeService runtimeService){
  super(cConf,store,programStateWriter,programLifecycleService,runtimeService);
}
Program: 4710
Project: 4710
Buggy source:
private static void checkParts(EntityType entityType,List<String> parts,int index,Map<EntityType,String> entityParts){
switch (entityType) {
case INSTANCE:
case NAMESPACE:
    entityParts.put(entityType,parts.get(index));
  break;
case KERBEROSPRINCIPAL:
entityParts.put(entityType,parts.get(index));
break;
case ARTIFACT:
case APPLICATION:
if (parts.size() > 2 && index == (parts.size() - 1)) {
throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + parts);
}
checkParts(EntityType.NAMESPACE,parts,index - 1,entityParts);
entityParts.put(entityType,parts.get(index));
break;
case DATASET:
case DATASET_MODULE:
case DATASET_TYPE:
case STREAM:
case SECUREKEY:
checkParts(EntityType.NAMESPACE,parts,index - 1,entityParts);
entityParts.put(entityType,parts.get(index));
break;
case PROGRAM:
if (parts.size() > 4 && index == (parts.size() - 1)) {
throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + parts);
}
checkParts(EntityType.APPLICATION,parts,index - 2,entityParts);
entityParts.put(entityType,parts.get(index - 1) + "String_Node_Str" + parts.get(index));
break;
default :
throw new IllegalArgumentException(String.format("String_Node_Str",entityType));
}
}

Fixed version (ground truth):
private static void checkParts(EntityType entityType,List<String> parts,int index,Map<EntityType,String> entityParts){
switch (entityType) {
case INSTANCE:
case NAMESPACE:
    entityParts.put(entityType,parts.get(index));
  break;
case KERBEROSPRINCIPAL:
entityParts.put(entityType,parts.get(index));
break;
case ARTIFACT:
case APPLICATION:
if (parts.size() > 2 && index == (parts.size() - 1)) {
throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + parts);
}
checkParts(EntityType.NAMESPACE,parts,index - 1,entityParts);
entityParts.put(entityType,parts.get(index));
break;
case DATASET:
case DATASET_MODULE:
case DATASET_TYPE:
case STREAM:
case SECUREKEY:
checkParts(EntityType.NAMESPACE,parts,index - 1,entityParts);
entityParts.put(entityType,parts.get(index));
break;
case PROGRAM:
if (parts.size() > 4 && index == (parts.size() - 1)) {
throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str" + parts);
}
if (parts.size() == 3 && index == (parts.size() - 1)) {
String program=parts.get(index);
if (!"String_Node_Str".equals(program)) {
throw new UnsupportedOperationException("String_Node_Str" + "String_Node_Str");
}
checkParts(EntityType.APPLICATION,parts,index - 1,entityParts);
entityParts.put(entityType,parts.get(index));
}
 else {
checkParts(EntityType.APPLICATION,parts,index - 2,entityParts);
entityParts.put(entityType,parts.get(index - 1) + "String_Node_Str" + parts.get(index));
}
break;
default :
throw new IllegalArgumentException(String.format("String_Node_Str",entityType));
}
}
Program: 4712
Project: 4712
Buggy source:
@Test public void testArtifact(){
  Authorizable authorizable;
  ArtifactId artifactId=new ArtifactId("String_Node_Str","String_Node_Str","String_Node_Str");
  authorizable=Authorizable.fromEntityId(artifactId);
  Assert.assertEquals(artifactId.toString().replace("String_Node_Str","String_Node_Str"),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testArtifact(){
  Authorizable authorizable;
  ArtifactId artifactId=new ArtifactId("String_Node_Str","String_Node_Str","String_Node_Str");
  authorizable=Authorizable.fromEntityId(artifactId);
  String artifactIdNoVer=artifactId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(artifactIdNoVer,authorizable.toString());
  String widcardId=artifactIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4713
Project: 4713
Buggy source:
@Test public void testSecureKey(){
  SecureKeyId secureKeyId=new SecureKeyId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(secureKeyId);
  Assert.assertEquals(secureKeyId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testSecureKey(){
  SecureKeyId secureKeyId=new SecureKeyId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(secureKeyId);
  Assert.assertEquals(secureKeyId.toString(),authorizable.toString());
  String widcardId=secureKeyId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4714
Project: 4714
Buggy source:
@Test public void testPrincipal(){
  KerberosPrincipalId kerberosPrincipalId=new KerberosPrincipalId("String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(kerberosPrincipalId);
  Assert.assertEquals(kerberosPrincipalId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testPrincipal(){
  KerberosPrincipalId kerberosPrincipalId=new KerberosPrincipalId("String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(kerberosPrincipalId);
  Assert.assertEquals(kerberosPrincipalId.toString(),authorizable.toString());
  Assert.assertEquals(kerberosPrincipalId.toString() + "String_Node_Str",Authorizable.fromString(authorizable.toString() + "String_Node_Str").toString());
}
Program: 4715
Project: 4715
Buggy source:
@Test public void testNamespace(){
  Authorizable authorizable;
  NamespaceId namespaceId=new NamespaceId("String_Node_Str");
  authorizable=Authorizable.fromEntityId(namespaceId);
  Assert.assertEquals(namespaceId.toString(),authorizable.toString());
  String wildcardNs=namespaceId.toString() + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  wildcardNs=namespaceId.toString() + "String_Node_Str" + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
}

Fixed version (ground truth):
@Test public void testNamespace(){
  Authorizable authorizable;
  NamespaceId namespaceId=new NamespaceId("String_Node_Str");
  authorizable=Authorizable.fromEntityId(namespaceId);
  Assert.assertEquals(namespaceId.toString(),authorizable.toString());
  String wildcardNs=namespaceId.toString() + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  wildcardNs=namespaceId.toString() + "String_Node_Str" + "String_Node_Str";
  authorizable=Authorizable.fromString(wildcardNs);
  Assert.assertEquals(wildcardNs,authorizable.toString());
  String widcardId=namespaceId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4716
Project: 4716
Buggy source:
@Test public void testStream(){
  StreamId streamId=new StreamId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(streamId);
  Assert.assertEquals(streamId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testStream(){
  StreamId streamId=new StreamId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(streamId);
  Assert.assertEquals(streamId.toString(),authorizable.toString());
  String widcardId=streamId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4717
Project: 4717
Buggy source:
@Test public void testDataset(){
  DatasetId datasetId=new DatasetId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetId);
  Assert.assertEquals(datasetId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testDataset(){
  DatasetId datasetId=new DatasetId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetId);
  Assert.assertEquals(datasetId.toString(),authorizable.toString());
  String widcardId=datasetId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4718
Project: 4718
Buggy source:
@Test public void testProgram(){
  ProgramId programId=new ProgramId("String_Node_Str","String_Node_Str",ProgramType.MAPREDUCE,"String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(programId);
  Assert.assertEquals(programId.toString().replace(ApplicationId.DEFAULT_VERSION + "String_Node_Str","String_Node_Str"),authorizable.toString());
  String wildCardProgramId=programId.toString() + "String_Node_Str";
  try {
    Authorizable.fromString(wildCardProgramId);
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  programId=appId.program(ProgramType.MAPREDUCE,"String_Node_Str");
  authorizable=Authorizable.fromEntityId(programId);
  Assert.assertEquals(programId.toString().replace("String_Node_Str","String_Node_Str"),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testProgram(){
  ProgramId programId=new ProgramId("String_Node_Str","String_Node_Str",ProgramType.MAPREDUCE,"String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(programId);
  Assert.assertEquals(programId.toString().replace(ApplicationId.DEFAULT_VERSION + "String_Node_Str","String_Node_Str"),authorizable.toString());
  String wildCardProgramId=programId.toString() + "String_Node_Str";
  try {
    Authorizable.fromString(wildCardProgramId);
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  programId=appId.program(ProgramType.MAPREDUCE,"String_Node_Str");
  authorizable=Authorizable.fromEntityId(programId);
  String programIdNoVer=programId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(programIdNoVer,authorizable.toString());
  String widcardId=programIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
  String allProgs="String_Node_Str";
  Assert.assertEquals(allProgs,Authorizable.fromString(allProgs).toString());
}
Program: 4719
Project: 4719
Buggy source:
@Test public void testApplication(){
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(appId);
  Assert.assertEquals(appId.toString().replace("String_Node_Str","String_Node_Str"),authorizable.toString());
  try {
    Authorizable.fromString(appId.toString());
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
}

Fixed version (ground truth):
@Test public void testApplication(){
  ApplicationId appId=new ApplicationId("String_Node_Str","String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(appId);
  String appIdNoVer=appId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(appIdNoVer,authorizable.toString());
  try {
    Authorizable.fromString(appId.toString());
    Assert.fail();
  }
 catch (  UnsupportedOperationException e) {
  }
  String widcardId=appIdNoVer.replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4720
Project: 4720
Buggy source:
@Test public void testDatasetModule(){
  DatasetModuleId datasetModuleId=new DatasetModuleId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetModuleId);
  Assert.assertEquals(datasetModuleId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testDatasetModule(){
  DatasetModuleId datasetModuleId=new DatasetModuleId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetModuleId);
  Assert.assertEquals(datasetModuleId.toString(),authorizable.toString());
  String widcardId=datasetModuleId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4721
Project: 4721
Buggy source:
@Test public void testDatasetType(){
  DatasetTypeId datasetTypeId=new DatasetTypeId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetTypeId);
  Assert.assertEquals(datasetTypeId.toString(),authorizable.toString());
}

Fixed version (ground truth):
@Test public void testDatasetType(){
  DatasetTypeId datasetTypeId=new DatasetTypeId("String_Node_Str","String_Node_Str");
  Authorizable authorizable=Authorizable.fromEntityId(datasetTypeId);
  Assert.assertEquals(datasetTypeId.toString(),authorizable.toString());
  String widcardId=datasetTypeId.toString().replace("String_Node_Str","String_Node_Str");
  Assert.assertEquals(widcardId,Authorizable.fromString(widcardId).toString());
}
Program: 4722
Project: 4722
Buggy source:
/** 
 * Returns an Output defined by an OutputFormatProvider.
 * @param outputName the name of the output
 */
public static Output of(String outputName,OutputFormatProvider outputFormatProvider){
  return new OutputFormatProviderOutput(outputName,outputFormatProvider);
}

Fixed version (ground truth):
/** 
 * Returns an Output defined by an OutputFormatProvider.
 * @param outputName the name of the output
 * @param outputFormatProvider an instance of an OutputFormatProvider. It can not be an instance ofa  {@link DatasetOutputCommitter}.
 */
public static Output of(String outputName,OutputFormatProvider outputFormatProvider){
  return new OutputFormatProviderOutput(outputName,outputFormatProvider);
}
Program: 4723
Project: 4723
Buggy source:
/** 
 * @return a map from output name to provided output for the MapReduce job
 */
Map<String,ProvidedOutput> getOutputs(){
  return new LinkedHashMap<>(outputs);
}

Fixed version (ground truth):
/** 
 * @return a map from output name to provided output for the MapReduce job
 */
List<ProvidedOutput> getOutputs(){
  return new ArrayList<>(outputs.values());
}
Program: 4724
Project: 4724
Buggy source:
@Override public void addOutput(Output output){
  if (output instanceof Output.DatasetOutput) {
    Output.DatasetOutput datasetOutput=((Output.DatasetOutput)output);
    String datasetNamespace=datasetOutput.getNamespace();
    if (datasetNamespace == null) {
      datasetNamespace=getNamespace();
    }
    String datasetName=output.getName();
    Map<String,String> arguments=((Output.DatasetOutput)output).getArguments();
    DatasetOutputFormatProvider outputFormatProvider=new DatasetOutputFormatProvider(datasetNamespace,datasetName,arguments,getDataset(datasetNamespace,datasetName,arguments,AccessType.WRITE),MapReduceBatchWritableOutputFormat.class);
    addOutput(output.getAlias(),outputFormatProvider);
  }
 else   if (output instanceof Output.OutputFormatProviderOutput) {
    addOutput(output.getAlias(),((Output.OutputFormatProviderOutput)output).getOutputFormatProvider());
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",output.getName(),output.getClass().getCanonicalName()));
  }
}

Fixed version (ground truth):
@Override public void addOutput(Output output){
  String alias=output.getAlias();
  if (this.outputs.containsKey(alias)) {
    throw new IllegalArgumentException("String_Node_Str" + alias);
  }
  ProvidedOutput providedOutput;
  if (output instanceof Output.DatasetOutput) {
    providedOutput=Outputs.transform((Output.DatasetOutput)output,this);
  }
 else   if (output instanceof Output.OutputFormatProviderOutput) {
    OutputFormatProvider outputFormatProvider=((Output.OutputFormatProviderOutput)output).getOutputFormatProvider();
    if (outputFormatProvider instanceof DatasetOutputCommitter) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
    }
    providedOutput=new ProvidedOutput(output,outputFormatProvider);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",output.getName(),output.getClass().getCanonicalName()));
  }
  this.outputs.put(alias,providedOutput);
}
Program: 4727
Project: 4727
Buggy source:
@Override public void truncate() throws IOException {
  drop();
  create(true);
}

Fixed version (ground truth):
@Override public void truncate() throws IOException {
  if (!isExternal && !useExisting) {
    for (    Location child : baseLocation.list()) {
      child.delete(true);
    }
  }
}