nus-yam/ex-repair huggingface dataset:
Program: 189030
Project: 189030
Buggy source:
@Override public ReturnValue do_run(){
  AbstractWorkflowEngine engine=new PegasusWorkflowEngine();
  WorkflowDataModelFactory factory=new WorkflowDataModelFactory(options,config,params,metadata);
  AbstractWorkflowDataModel dataModel=factory.getWorkflowDataModel();
  ReturnValue retPegasus=engine.launchWorkflow(dataModel);
  String stdOut=retPegasus.getStdout();
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(stdOut);
  String statusCmd=null;
  if (m.find()) {
    statusCmd=m.group(1);
  }
  p=Pattern.compile("String_Node_Str");
  m=p.matcher(stdOut);
  String statusDir=null;
  if (m.find()) {
    statusDir=m.group(1);
  }
  return ret;
}

Fixed version (ground truth):
@Override public ReturnValue do_run(){
  AbstractWorkflowEngine engine=new PegasusWorkflowEngine();
  WorkflowDataModelFactory factory=new WorkflowDataModelFactory(options,config,params,metadata);
  AbstractWorkflowDataModel dataModel=factory.getWorkflowDataModel();
  ReturnValue retPegasus=engine.launchWorkflow(dataModel);
  if (!Boolean.parseBoolean(dataModel.getConfigs().get("String_Node_Str"))) {
    return retPegasus;
  }
  String wra=dataModel.getConfigs().get("String_Node_Str");
  if (wra == null || wra.isEmpty()) {
    return retPegasus;
  }
  int workflowrunaccession=Integer.parseInt(wra);
  int workflowrun=this.metadata.get_workflow_run_id(workflowrunaccession);
  String stdOut=retPegasus.getStdout();
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(stdOut);
  String statusCmd=null;
  if (m.find()) {
    statusCmd=m.group(1);
  }
  p=Pattern.compile("String_Node_Str");
  m=p.matcher(stdOut);
  String statusDir=null;
  if (m.find()) {
    statusDir=m.group(1);
  }
  List<String> parentsLinkedToWR=new ArrayList<String>();
  WorkflowRun wr=null;
  for (  String parentLinkedToWR : parentsLinkedToWR) {
    try {
      this.metadata.linkWorkflowRunAndParent(workflowrun,Integer.parseInt(parentLinkedToWR));
    }
 catch (    Exception e) {
      Log.error(e.getMessage());
    }
  }
  wr=metadata.getWorkflowRun(workflowrunaccession);
  if (retPegasus.getProcessExitStatus() != ReturnValue.SUCCESS || statusCmd == null) {
    metadata.update_workflow_run(workflowrun,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),0,0,retPegasus.getStderr(),retPegasus.getStdout());
    return (retPegasus);
  }
 else {
    metadata.update_workflow_run(workflowrun,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),retPegasus.getStderr(),retPegasus.getStdout());
    return ret;
  }
}
Program: 189031
Project: 189031
Buggy source:
private ReturnValue addIUS(){
  ReturnValue ret=new ReturnValue(ReturnValue.SUCCESS);
  if (fields.containsKey("String_Node_Str") && fields.containsKey("String_Node_Str") && fields.containsKey("String_Node_Str")&& fields.containsKey("String_Node_Str")&& fields.containsKey("String_Node_Str")&& fields.containsKey("String_Node_Str")) {
    ret=metadata.addIUS(Integer.parseInt(fields.get("String_Node_Str")),Integer.parseInt(fields.get("String_Node_Str")),fields.get("String_Node_Str"),fields.get("String_Node_Str"),fields.get("String_Node_Str"),"String_Node_Str".equalsIgnoreCase(fields.get("String_Node_Str")));
    print("String_Node_Str" + ret.getAttribute("String_Node_Str"));
  }
 else {
    Logger.getLogger(Metadata.class.getName()).log(Level.SEVERE,"String_Node_Str","String_Node_Str");
    ret.setExitStatus(ReturnValue.INVALIDPARAMETERS);
  }
  return (ret);
}

Fixed version (ground truth):
private ReturnValue addIUS(){
  ReturnValue ret=new ReturnValue(ReturnValue.SUCCESS);
  if (fields.containsKey("String_Node_Str") && fields.containsKey("String_Node_Str") && fields.containsKey("String_Node_Str")&& fields.containsKey("String_Node_Str")&& fields.containsKey("String_Node_Str")) {
    ret=metadata.addIUS(Integer.parseInt(fields.get("String_Node_Str")),Integer.parseInt(fields.get("String_Node_Str")),fields.get("String_Node_Str"),fields.get("String_Node_Str"),fields.get("String_Node_Str"),"String_Node_Str".equalsIgnoreCase(fields.get("String_Node_Str")));
    print("String_Node_Str" + ret.getAttribute("String_Node_Str"));
  }
 else {
    Logger.getLogger(Metadata.class.getName()).log(Level.SEVERE,"String_Node_Str","String_Node_Str");
    ret.setExitStatus(ReturnValue.INVALIDPARAMETERS);
  }
  return (ret);
}
Program: 189035
Project: 189035
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=31 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
  hash=31 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
  hash=31 * hash + (this.emailAddress != null ? this.emailAddress.hashCode() : 0);
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return new HashCodeBuilder(17,37).append(super.getSGID().getRowKey()).append(firstName).append(lastName).append(emailAddress).toHashCode();
}
Program: 189036
Project: 189036
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=31 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
  hash=31 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
  hash=31 * hash + (this.emailAddress != null ? this.emailAddress.hashCode() : 0);
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return new HashCodeBuilder(17,37).append(super.getSGID().getRowKey()).append(firstName).append(lastName).append(emailAddress).toHashCode();
}
Program: 189038
Project: 189038
Buggy source:
/** 
 * Compiles the given query string that adheres to the syntax of SeqWareQueryLanguage.g and returns a RPNStack object representing the query.
 * @param query A query string.
 * @return An RPNStack that represents the query.
 */
public static RPNStack compileQuery(String query) throws RecognitionException {
  Logger.getLogger(RPNStack.class.getName()).info("String_Node_Str" + query);
  SeqWareQueryLanguageLexer lexer=new SeqWareQueryLanguageLexer(new ANTLRStringStream(query));
  CommonTokenStream tokenStream=new CommonTokenStream(lexer);
  SeqWareQueryLanguageParser parser=new SeqWareQueryLanguageParser(tokenStream);
  SeqWareQueryLanguageParser.query_return parsedInput=parser.query();
  Tree tree=(CommonTree)parsedInput.getTree();
  List<Object> arguments=new ArrayList<Object>();
  abstractSyntaxTreeTraversal(tree,arguments);
  return new RPNStack(arguments);
}

Fixed version (ground truth):
/** 
 * Compiles the given query string that adheres to the syntax of SeqWareQueryLanguage.g and returns a RPNStack object representing the query.
 * @param query A query string.
 * @return An RPNStack that represents the query.
 */
public static RPNStack compileQuery(String query) throws RecognitionException {
  Logger.getLogger(RPNStack.class.getName()).info("String_Node_Str" + query);
  try {
    SeqWareQueryLanguageLexerWrapper lexer=new SeqWareQueryLanguageLexerWrapper(new ANTLRStringStream(query));
    CommonTokenStream tokenStream=new CommonTokenStream(lexer);
    SeqWareQueryLanguageParserWrapper parser=new SeqWareQueryLanguageParserWrapper(tokenStream);
    SeqWareQueryLanguageParser.query_return parsedInput=parser.query();
    Tree tree=(CommonTree)parsedInput.getTree();
    List<Object> arguments=new ArrayList<Object>();
    abstractSyntaxTreeTraversal(tree,arguments);
    return new RPNStack(arguments);
  }
 catch (  IllegalArgumentException e) {
    RecognitionException re=(RecognitionException)e.getCause();
    throw re;
  }
}
Program: 189039
Project: 189039
Buggy source:
/** 
 * Ugly and inefficient, just testing this out to get the tests to compile Carries out a numeric GREATERTHAN.
 */
private boolean lesser(Object a,Object b,boolean allowEq){
  if (a == null || b == null) {
    return false;
  }
  if (a instanceof Long || b instanceof Long) {
    if (allowEq) {
      return (Long.valueOf(a.toString())).longValue() <= (Long.valueOf(b.toString())).longValue();
    }
    return (Long.valueOf(a.toString())).longValue() < (Long.valueOf(b.toString())).longValue();
  }
  if (a instanceof Float || b instanceof Float) {
    if (allowEq) {
      return (Float.valueOf(a.toString())).floatValue() <= (Float.valueOf(b.toString())).floatValue();
    }
    return (Float.valueOf(a.toString())).floatValue() < (Float.valueOf(b.toString())).floatValue();
  }
  if (a instanceof Integer || b instanceof Integer) {
    if (allowEq) {
      return (Integer.valueOf(a.toString())).intValue() <= (Integer.valueOf(b.toString())).intValue();
    }
    return (Integer.valueOf(a.toString())).intValue() < (Integer.valueOf(b.toString())).intValue();
  }
  if (a instanceof Double || b instanceof Double) {
    if (allowEq) {
      return (Double.valueOf(a.toString())).doubleValue() <= (Double.valueOf(b.toString())).doubleValue();
    }
    return (Double.valueOf(a.toString())).doubleValue() < (Double.valueOf(b.toString())).doubleValue();
  }
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Ugly and inefficient, just testing this out to get the tests to compile Carries out a numeric GREATERTHAN.
 */
private boolean lesser(Object a,Object b,boolean allowEq){
  if (a == null || b == null) {
    return false;
  }
  if (a instanceof Long) {
    if (allowEq) {
      return (Long.valueOf(a.toString())).longValue() <= (Long.valueOf(b.toString())).longValue();
    }
    return (Long.valueOf(a.toString())).longValue() < (Long.valueOf(b.toString())).longValue();
  }
  if (a instanceof Float) {
    if (allowEq) {
      return (Float.valueOf(a.toString())).floatValue() <= (Float.valueOf(b.toString())).floatValue();
    }
    return (Float.valueOf(a.toString())).floatValue() < (Float.valueOf(b.toString())).floatValue();
  }
  if (a instanceof Integer) {
    if (allowEq) {
      return (Integer.valueOf(a.toString())).intValue() <= (Integer.valueOf(b.toString())).intValue();
    }
    return (Integer.valueOf(a.toString())).intValue() < (Integer.valueOf(b.toString())).intValue();
  }
  if (a instanceof Double) {
    if (allowEq) {
      return (Double.valueOf(a.toString())).doubleValue() <= (Double.valueOf(b.toString())).doubleValue();
    }
    return (Double.valueOf(a.toString())).doubleValue() < (Double.valueOf(b.toString())).doubleValue();
  }
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 189041
Project: 189041
Buggy source:
public <T>T getTermValue(Class<T> type){
  if (Constants.SETTINGS_MAP != null && Constants.SETTINGS_MAP.containsKey(term_name)) {
    String value=Constants.SETTINGS_MAP.get(term_name);
    if (type.equals(Boolean.class)) {
      Boolean parseBoolean=Boolean.parseBoolean(value);
      return (T)parseBoolean;
    }
 else     if (type.equals(Map.class)) {
      if (value.equalsIgnoreCase("String_Node_Str") || value.equalsIgnoreCase("String_Node_Str")) {
        return (T)LOCAL;
      }
      return (T)Maps.newHashMap(ImmutableMap.<String,String>builder().put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).build());
    }
  }
  return (T)term_default;
}

Fixed version (ground truth):
public <T>T getTermValue(Class<T> type){
  if (Constants.SETTINGS_MAP != null && Constants.SETTINGS_MAP.containsKey(term_name)) {
    String value=Constants.SETTINGS_MAP.get(term_name);
    if (type.equals(Boolean.class)) {
      Boolean parseBoolean=Boolean.parseBoolean(value);
      return (T)parseBoolean;
    }
 else     if (type.equals(Map.class)) {
      if (value.equalsIgnoreCase("String_Node_Str") || value.equalsIgnoreCase("String_Node_Str")) {
        return (T)LOCAL;
      }
      return (T)Maps.newHashMap(ImmutableMap.<String,String>builder().put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).put("String_Node_Str",Constants.SETTINGS_MAP.get("String_Node_Str" + value + "String_Node_Str")).build());
    }
 else {
      return (T)value;
    }
  }
  return (T)term_default;
}
Program: 189042
Project: 189042
Buggy source:
/** 
 * Set the settings map, overriding hard-coded values for our constants.
 * @param SETTINGS_MAP
 */
public static void setSETTINGS_MAP(Map<String,String> SETTINGS_MAP){
  Constants.SETTINGS_MAP=SETTINGS_MAP;
}

Fixed version (ground truth):
/** 
 * Set the settings map, overriding hard-coded values for our constants.
 * @param SETTINGS_MAP
 */
public static void setSETTINGS_MAP(Map<String,String> SETTINGS_MAP){
  Constants.SETTINGS_MAP=SETTINGS_MAP;
  Logger.getLogger(Constants.class.getName()).info("String_Node_Str" + Constants.Term.HBASE_PROPERTIES.getTermValue(Map.class).toString() + "String_Node_Str"+ Constants.Term.NAMESPACE.getTermValue(String.class));
}
Program: 189043
Project: 189043
Buggy source:
public HBaseStorage(SerializationInterface i){
  if (DEBUG) {
    minMap=new HashMap<String,Integer>();
    maxMap=new HashMap<String,Integer>();
    countMap=new HashMap<String,Long>();
  }
  this.serializer=i;
  this.config=HBaseConfiguration.create();
  configureHBaseConfig(config);
  try {
    Logger.getLogger(HBaseStorage.class.getName()).info("String_Node_Str" + HBaseStorage.class.getSimpleName() + "String_Node_Str"+ serializer.getClass().getSimpleName()+ "String_Node_Str"+ java.net.InetAddress.getLocalHost().getHostName());
    HBaseAdmin hba=new HBaseAdmin(config);
    if (!PERSIST) {
      Logger.getLogger(HBaseStorage.class.getName()).info("String_Node_Str");
      hba.disableTables(TEST_TABLE_PREFIX + "String_Node_Str");
      hba.deleteTables(TEST_TABLE_PREFIX + "String_Node_Str");
    }
    for (    String s : super.directBIMap.values()) {
      createTable(s,hba);
    }
    HTableDescriptor[] listTables=hba.listTables(TEST_TABLE_PREFIX + "String_Node_Str");
    for (    HTableDescriptor des : listTables) {
      String nameAsString=des.getNameAsString();
      if (!tableMap.containsKey(nameAsString)) {
        tableMap.put(nameAsString,new HTable(config,nameAsString));
      }
    }
  }
 catch (  IOException ex) {
    Logger.getLogger(HBaseStorage.class.getName()).fatal("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public HBaseStorage(SerializationInterface i){
  if (DEBUG) {
    minMap=new HashMap<String,Integer>();
    maxMap=new HashMap<String,Integer>();
    countMap=new HashMap<String,Long>();
  }
  this.serializer=i;
  this.config=HBaseConfiguration.create();
  configureHBaseConfig(config);
  Logger.getLogger(HBaseStorage.class.getName()).info("String_Node_Str" + Constants.Term.HBASE_PROPERTIES.getTermValue(Map.class).toString() + "String_Node_Str"+ Constants.Term.NAMESPACE.getTermValue(String.class));
  try {
    Logger.getLogger(HBaseStorage.class.getName()).info("String_Node_Str" + HBaseStorage.class.getSimpleName() + "String_Node_Str"+ serializer.getClass().getSimpleName()+ "String_Node_Str"+ java.net.InetAddress.getLocalHost().getHostName());
    HBaseAdmin hba=new HBaseAdmin(config);
    if (!PERSIST) {
      Logger.getLogger(HBaseStorage.class.getName()).info("String_Node_Str");
      hba.disableTables(TEST_TABLE_PREFIX + "String_Node_Str");
      hba.deleteTables(TEST_TABLE_PREFIX + "String_Node_Str");
    }
    for (    String s : super.directBIMap.values()) {
      createTable(s,hba);
    }
    HTableDescriptor[] listTables=hba.listTables(TEST_TABLE_PREFIX + "String_Node_Str");
    for (    HTableDescriptor des : listTables) {
      String nameAsString=des.getNameAsString();
      if (!tableMap.containsKey(nameAsString)) {
        tableMap.put(nameAsString,new HTable(config,nameAsString));
      }
    }
  }
 catch (  IOException ex) {
    Logger.getLogger(HBaseStorage.class.getName()).fatal("String_Node_Str",ex);
  }
}
Program: 189045
Project: 189045
Buggy source:
public static void main(String[] args){
  try {
    SGID mainMethod=ReferenceCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SGID mainMethod=ReferenceCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    Logger.getLogger(ReferenceCreator.class.getName()).fatal(e);
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}
Program: 189046
Project: 189046
Buggy source:
public static void main(String[] args){
  try {
    SGID mainMethod=TagSetCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SGID mainMethod=TagSetCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    Logger.getLogger(ReferenceCreator.class.getName()).fatal(e);
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}
Program: 189047
Project: 189047
Buggy source:
/** 
 * Carries out an exact match.
 */
private boolean equal(Object a,Object b){
  return a.equals(b);
}

Fixed version (ground truth):
/** 
 * Carries out an exact match.
 */
private boolean equal(Object a,Object b){
  if (a == null || b == null) {
    return a == null && b == null;
  }
  return a.equals(b);
}
Program: 189050
Project: 189050
Buggy source:
private long convertToGB(ContentSummary contentSummary){
  long spaceConsumedinGB=contentSummary.getLength() / 1024 / 1024/ 1024/ 1024;
  return spaceConsumedinGB;
}

Fixed version (ground truth):
private long convertToGB(ContentSummary contentSummary){
  long spaceConsumedinGB=contentSummary.getLength() / 1024 / 1024/ 1024;
  return spaceConsumedinGB;
}
Program: 189052
Project: 189052
Buggy source:
private void recordSpace(String key) throws IOException {
  try {
    Configuration conf=new Configuration();
    HBaseStorage.configureHBaseConfig(conf);
    HBaseConfiguration.addHbaseResources(conf);
    FileSystem fs=FileSystem.get(conf);
    Path homeDirectory=fs.getHomeDirectory();
    Path root=homeDirectory.getParent().getParent();
    Path hbase=new Path(root,"String_Node_Str");
    ContentSummary contentSummary=fs.getContentSummary(hbase);
    long spaceConsumedinGB=convertToGB(contentSummary);
    keyValues.put(key + "String_Node_Str",Long.toString(spaceConsumedinGB));
    if (spaceConsumedinGB > CUT_OFF) {
      return;
    }
    Path featureTable=new Path(hbase,"String_Node_Str" + Constants.NAMESPACE + "String_Node_Str"+ HG_19);
    contentSummary=fs.getContentSummary(featureTable);
    spaceConsumedinGB=convertToGB(contentSummary);
    keyValues.put(key + "String_Node_Str",Long.toString(spaceConsumedinGB));
  }
 catch (  FileNotFoundException e) {
  }
}

Fixed version (ground truth):
private void recordSpace(String key) throws IOException {
  try {
    Configuration conf=new Configuration();
    HBaseStorage.configureHBaseConfig(conf);
    HBaseConfiguration.addHbaseResources(conf);
    FileSystem fs=FileSystem.get(conf);
    Path homeDirectory=fs.getHomeDirectory();
    Path root=homeDirectory.getParent().getParent();
    Path hbase=new Path(root,"String_Node_Str");
    ContentSummary contentSummary=fs.getContentSummary(hbase);
    long spaceConsumedinGB=convertToGB(contentSummary);
    keyValues.put(key + "String_Node_Str",Long.toString(spaceConsumedinGB));
    Path featureTable=new Path(hbase,Constants.NAMESPACE + "String_Node_Str" + HG_19);
    contentSummary=fs.getContentSummary(featureTable);
    spaceConsumedinGB=convertToGB(contentSummary);
    keyValues.put(key + "String_Node_Str",Long.toString(spaceConsumedinGB));
  }
 catch (  FileNotFoundException e) {
  }
}
Program: 189055
Project: 189055
Buggy source:
@Test public void testNormalVCFImport(){
  testFile(testVCFFile,true);
}

Fixed version (ground truth):
@Test public void testNormalVCFImport(){
  testFile(testVCFFile,true,false);
}
Program: 189057
Project: 189057
Buggy source:
@Test public void testMissingValueVCFImport(){
  testFile(testVCFFile_missingValues,true);
}

Fixed version (ground truth):
@Test public void testMissingValueVCFImport(){
  testFile(testVCFFile_missingValues,true,false);
}
Program: 189058
Project: 189058
Buggy source:
@BeforeClass public static void setupTests(){
  String curDir=System.getProperty("String_Node_Str");
  File file=new File(curDir + "String_Node_Str");
  SGID tagSetID=OBOImporter.mainMethod(new String[]{file.getAbsolutePath()});
  sequenceOntology=SWQEFactory.getQueryInterface().getAtomBySGID(TagSet.class,tagSetID);
  try {
    SGID refID=ReferenceCreator.mainMethod(new String[]{"String_Node_Str"});
    reference=SWQEFactory.getQueryInterface().getAtomBySGID(Reference.class,refID);
  }
 catch (  IllegalArgumentException e) {
  }
  try {
    SGID aSetID=TagSetCreator.mainMethod(new String[]{"String_Node_Str"});
    adHocSet=SWQEFactory.getQueryInterface().getAtomBySGID(TagSet.class,aSetID);
  }
 catch (  IllegalArgumentException e) {
  }
  testVCFFile=new File(curDir + "String_Node_Str");
  testVCFFile_missingValues=new File(curDir + "String_Node_Str");
  testVCFFile_invalid=new File(curDir + "String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void setupTests(){
  String curDir=System.getProperty("String_Node_Str");
  File file=new File(curDir + "String_Node_Str");
  SGID tagSetID=OBOImporter.mainMethod(new String[]{file.getAbsolutePath()});
  sequenceOntology=SWQEFactory.getQueryInterface().getAtomBySGID(TagSet.class,tagSetID);
  try {
    SGID refID=ReferenceCreator.mainMethod(new String[]{"String_Node_Str"});
    reference=SWQEFactory.getQueryInterface().getAtomBySGID(Reference.class,refID);
  }
 catch (  IllegalArgumentException e) {
    reference=SWQEFactory.getQueryInterface().getLatestAtomByRowKey("String_Node_Str",Reference.class);
  }
  try {
    SGID aSetID=TagSetCreator.mainMethod(new String[]{"String_Node_Str"});
    adHocSet=SWQEFactory.getQueryInterface().getAtomBySGID(TagSet.class,aSetID);
  }
 catch (  IllegalArgumentException e) {
    adHocSet=SWQEFactory.getQueryInterface().getLatestAtomByRowKey("String_Node_Str",TagSet.class);
  }
  testVCFFile_zipped=new File(curDir + "String_Node_Str");
  testVCFFile=new File(curDir + "String_Node_Str");
  testVCFFile_missingValues=new File(curDir + "String_Node_Str");
  testVCFFile_invalid=new File(curDir + "String_Node_Str");
}
Program: 189059
Project: 189059
Buggy source:
@Test public void testInvalidVCFImport(){
  testFile(testVCFFile_invalid,false);
}

Fixed version (ground truth):
@Test public void testInvalidVCFImport(){
  testFile(testVCFFile_invalid,false,false);
}
Program: 189061
Project: 189061
Buggy source:
public static void main(String[] args){
  try {
    SGID mainMethod=ReferenceCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SGID mainMethod=ReferenceCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}
Program: 189062
Project: 189062
Buggy source:
/** 
 * Create a reference given just a name for the new reference to be created.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args) throws IllegalArgumentException {
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(ReferenceCreator.class.getSimpleName() + "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  Reference checkAtom=SWQEFactory.getQueryInterface().getLatestAtomByRowKey(args[0],Reference.class);
  if (checkAtom != null) {
    throw new IllegalArgumentException();
  }
  try {
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    Reference build=modelManager.buildReference().setFriendlyRowKey(args[0]).setName(args[0]).build();
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Logger.getLogger(ReferenceCreator.class.getName()).info("String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println("String_Node_Str");
    String outputID=build.getSGID().getUuid().toString();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return build.getSGID();
  }
 catch (  IOException ex) {
    Logger.getLogger(ReferenceCreator.class.getName()).fatal(null,ex);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Create a reference given just a name for the new reference to be created.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args) throws IllegalArgumentException {
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(ReferenceCreator.class.getSimpleName() + "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  Reference checkAtom=SWQEFactory.getQueryInterface().getLatestAtomByRowKey(args[0],Reference.class);
  if (checkAtom != null) {
    throw new IllegalArgumentException();
  }
  try {
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    Reference build=modelManager.buildReference().setFriendlyRowKey(args[0]).setName(args[0]).build();
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Logger.getLogger(ReferenceCreator.class.getName()).info("String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println("String_Node_Str");
    String outputID=build.getSGID().getRowKey();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return build.getSGID();
  }
 catch (  IOException ex) {
    Logger.getLogger(ReferenceCreator.class.getName()).fatal(null,ex);
  }
  return null;
}
Program: 189063
Project: 189063
Buggy source:
public static void main(String[] args){
  try {
    SGID mainMethod=TagSetCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SGID mainMethod=TagSetCreator.mainMethod(args);
    if (mainMethod == null) {
      System.exit(FeatureImporter.EXIT_CODE_INVALID_FILE);
    }
  }
 catch (  IllegalArgumentException e) {
    System.exit(FeatureImporter.EXIT_CODE_EXISTING_NAME);
  }
}
Program: 189064
Project: 189064
Buggy source:
/** 
 * Create a reference given just a name for the new reference to be created.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args) throws IllegalArgumentException {
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(TagSetCreator.class.getSimpleName() + "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  TagSet checkAtom=SWQEFactory.getQueryInterface().getLatestAtomByRowKey(args[0],TagSet.class);
  if (checkAtom != null) {
    throw new IllegalArgumentException();
  }
  try {
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    TagSet build=modelManager.buildTagSet().setFriendlyRowKey(args[0]).setName(args[0]).build();
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Logger.getLogger(TagSetCreator.class.getName()).info("String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println("String_Node_Str");
    String outputID=build.getSGID().getUuid().toString();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return build.getSGID();
  }
 catch (  IOException ex) {
    Logger.getLogger(TagSetCreator.class.getName()).fatal(null,ex);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Create a reference given just a name for the new reference to be created.
 * @param args
 * @return
 */
public static SGID mainMethod(String[] args) throws IllegalArgumentException {
  if (args.length < 1) {
    System.err.println("String_Node_Str" + args.length + "String_Node_Str");
    System.out.println(TagSetCreator.class.getSimpleName() + "String_Node_Str");
    System.exit(FeatureImporter.EXIT_CODE_INVALID_ARGS);
  }
  TagSet checkAtom=SWQEFactory.getQueryInterface().getLatestAtomByRowKey(args[0],TagSet.class);
  if (checkAtom != null) {
    throw new IllegalArgumentException();
  }
  try {
    CreateUpdateManager modelManager=SWQEFactory.getModelManager();
    TagSet build=modelManager.buildTagSet().setFriendlyRowKey(args[0]).setName(args[0]).build();
    File outputFile=null;
    if (args.length == 2) {
      outputFile=Utility.checkOutput(args[1]);
    }
    Logger.getLogger(TagSetCreator.class.getName()).info("String_Node_Str");
    modelManager.close();
    SWQEFactory.getStorage().closeStorage();
    System.out.println("String_Node_Str");
    String outputID=build.getSGID().getRowKey();
    System.out.println(outputID);
    Map<String,String> keyValues=new HashMap<String,String>();
    keyValues.put("String_Node_Str",outputID);
    Utility.writeKeyValueFile(outputFile,keyValues);
    return build.getSGID();
  }
 catch (  IOException ex) {
    Logger.getLogger(TagSetCreator.class.getName()).fatal(null,ex);
  }
  return null;
}
Program: 189067
Project: 189067
Buggy source:
private void processTimestamp(FSGID fsgid){
  if (this.getPrecedingSGID() == null) {
    if (getManager() != null && getManager().getState(this) != CreateUpdateManager.State.NEW_CREATION) {
      fsgid.setBackendTimestamp(new Date(this.getTimestamp().getTime()));
    }
 else {
      fsgid.setBackendTimestamp(new Date(this.getTimestamp().getTime() - 1));
    }
  }
 else {
    fsgid.setBackendTimestamp(this.getTimestamp());
  }
}

Fixed version (ground truth):
private void processTimestamp(FSGID fsgid){
  if (this.getPrecedingSGID() == null) {
    if (getManager() != null && getManager().getState(this) != null && getManager().getState(this) != CreateUpdateManager.State.NEW_CREATION) {
      fsgid.setBackendTimestamp(new Date(this.getTimestamp().getTime()));
    }
 else {
      fsgid.setBackendTimestamp(new Date(this.getTimestamp().getTime() - 1));
    }
  }
 else {
    fsgid.setBackendTimestamp(this.getTimestamp());
  }
}
Program: 189068
Project: 189068
Buggy source:
private void upgradeFeatureSGID(Feature feature){
  FSGID fsgid=new FSGID(feature.getSGID(),feature,this);
  processTimestamp(fsgid);
  feature.impersonate(fsgid,feature.getPrecedingSGID());
  if (getManager() != null) {
    getManager().atomStateChange(feature,CreateUpdateManager.State.NEW_CREATION);
  }
}

Fixed version (ground truth):
private void upgradeFeatureSGID(Feature feature){
  FSGID fsgid=new FSGID(feature.getSGID(),feature,this);
  processTimestamp(fsgid);
  feature.impersonate(fsgid,feature.getPrecedingSGID());
  if (feature.getManager() != null) {
    feature.getManager().atomStateChange(feature,CreateUpdateManager.State.NEW_CREATION);
  }
}
Program: 189069
Project: 189069
Buggy source:
@Override public long getCount(){
  Logger.getLogger(LazyFeatureSet.class.getName()).log(Level.WARNING,"String_Node_Str");
  Iterator<Feature> features=this.getFeatures();
  long count=0;
  while (features.hasNext()) {
    Feature next=features.next();
    if (((FSGID)next.getSGID()).isTombstone()) {
      continue;
    }
    count++;
  }
  return count;
}

Fixed version (ground truth):
@Override public long getCount(){
  if (!EXPENSIVE_ITERATION_WARNED) {
    Logger.getLogger(LazyFeatureSet.class.getName()).log(Level.WARNING,"String_Node_Str");
    EXPENSIVE_ITERATION_WARNED=true;
  }
  Iterator<Feature> features=this.getFeatures();
  long count=0;
  while (features.hasNext()) {
    Feature next=features.next();
    if (((FSGID)next.getSGID()).isTombstone()) {
      continue;
    }
    count++;
  }
  return count;
}
Program: 189071
Project: 189071
Buggy source:
@Override public void persist(Particle p){
  this.dirtySet.put(p.getSGID(),new ParticleStatePair(p,State.MANAGED));
}

Fixed version (ground truth):
@Override public void persist(Particle p){
  if (this.dirtySet.containsKey(p.getSGID())) {
    Logger.getLogger(SimpleModelManager.class.getName()).log(Level.INFO,"String_Node_Str");
    return;
  }
  p.setManager(this);
  this.dirtySet.put(p.getSGID(),new ParticleStatePair(p,State.MANAGED));
}
Program: 189072
Project: 189072
Buggy source:
@Override public void close(){
  this.flush();
  this.clear();
}

Fixed version (ground truth):
@Override public void close(){
  for (  ParticleStatePair p : dirtySet.values()) {
    p.p.setManager(null);
  }
  this.flush();
  this.clear();
}
Program: 189074
Project: 189074
Buggy source:
@Override public Builder setManager(ModelManager aThis){
  return this;
}

Fixed version (ground truth):
@Override public Builder setManager(ModelManager aThis){
  tag.setManager(aThis);
  return this;
}
Program: 189075
Project: 189075
Buggy source:
@Override public Tag build(){
  if (tag.key == null) {
    throw new RuntimeException("String_Node_Str");
  }
  return tag;
}

Fixed version (ground truth):
@Override public Tag build(){
  if (tag.key == null) {
    throw new RuntimeException("String_Node_Str");
  }
  tag.getManager().objectCreated(tag);
  return tag;
}
Program: 189076
Project: 189076
Buggy source:
/** 
 * Create an ACL builder started with a copy of this
 * @return 
 */
@Override public abstract TagSet.Builder toBuilder();

Fixed version (ground truth):
/** 
 * Create an ACL builder started with a copy of this
 * @return
 */
@Override public abstract TagSet.Builder toBuilder();
Program: 189079
Project: 189079
Buggy source:
@Test public void testTaggingOnEverything(){
  SeqWareIterable<TagSet> tagSets=Factory.getFeatureStoreInterface().getTagSets();
  SeqWareIterable<Tag> tags1=fSet.getTags();
  Assert.assertTrue(tags1.getCount() == 3);
  Assert.assertTrue(a.getTags().getCount() == 1);
}

Fixed version (ground truth):
@Test public void testTaggingOnEverything(){
  SeqWareIterable<TagSet> tagSets=Factory.getFeatureStoreInterface().getTagSets();
  boolean t1found=false;
  boolean t2found=false;
  for (  TagSet t : tagSets) {
    if (t.equals(tSet1)) {
      t1found=true;
    }
 else     if (t.equals(tSet2)) {
      t2found=true;
    }
  }
  Assert.assertTrue(t1found == true && t2found == true);
  SeqWareIterable<Tag> tags=Factory.getFeatureStoreInterface().getTags();
  Tag[] tagsCheck={t1a,t1b,t1c,t2a,t2b,t2c,t3a};
  boolean[] tagsCheckFound=new boolean[tagsCheck.length];
  Arrays.fill(tagsCheckFound,false);
  for (  Tag ta : tags) {
    for (int i=0; i < tagsCheckFound.length; i++) {
      if (tagsCheck[i].equals(ta)) {
        tagsCheckFound[i]=true;
      }
    }
  }
  for (  boolean b : tagsCheckFound) {
    Assert.assertTrue(b);
  }
  SeqWareIterable<Tag> tags1=fSet.getTags();
  Assert.assertTrue(tags1.getCount() == 3);
  Assert.assertTrue(a.getTags().getCount() == 1);
}
Program: 189080
Project: 189080
Buggy source:
LoggingEvent(final Optional<TestLogger> creatingLogger,final Level level,final Map<String,String> mdc,final Optional<Marker> marker,final Optional<Throwable> throwable,final String message,final Object... arguments){
  super();
  this.creatingLogger=creatingLogger;
  this.level=checkNotNull(level);
  this.mdc=ImmutableMap.copyOf(mdc);
  this.marker=checkNotNull(marker);
  this.throwable=checkNotNull(throwable);
  this.message=checkNotNull(message);
  this.arguments=ImmutableList.copyOf(arguments);
}

Fixed version (ground truth):
LoggingEvent(final Optional<TestLogger> creatingLogger,final Level level,final Map<String,String> mdc,final Optional<Marker> marker,final Optional<Throwable> throwable,final String message,final Object... arguments){
  super();
  this.creatingLogger=creatingLogger;
  this.level=checkNotNull(level);
  this.mdc=ImmutableMap.copyOf(mdc);
  this.marker=checkNotNull(marker);
  this.throwable=checkNotNull(throwable);
  this.message=checkNotNull(message);
  this.arguments=from(asList(arguments)).transform(new Function<Object,Object>(){
    @Override public Object apply(    Object input){
      return fromNullable(input).or((Object)absent());
    }
  }
).toList();
}
Program: 189081
Project: 189081
Buggy source:
private void log(final Level level,final Marker marker,final String msg,final Throwable throwable){
  addLoggingEvent(level,of(marker),of(throwable),msg);
}

Fixed version (ground truth):
private void log(final Level level,final Marker marker,final String msg,final Throwable throwable){
  addLoggingEvent(level,fromNullable(marker),fromNullable(throwable),msg);
}
Program: 189082
Project: 189082
Buggy source:
public void put(final String key,final String val){
  value.get().put(key,val);
}

Fixed version (ground truth):
public void put(final String key,final String val){
  value.get().put(key,fromNullable(val).or("String_Node_Str"));
}
Program: 189083
Project: 189083
Buggy source:
LoggingEvent(final Optional<TestLogger> creatingLogger,final Level level,final Map<String,String> mdc,final Optional<Marker> marker,final Optional<Throwable> throwable,final String message,final Object... arguments){
  super();
  this.creatingLogger=creatingLogger;
  this.level=checkNotNull(level);
  this.mdc=ImmutableMap.copyOf(mdc);
  this.marker=checkNotNull(marker);
  this.throwable=checkNotNull(throwable);
  this.message=checkNotNull(message);
  this.arguments=ImmutableList.copyOf(arguments);
}

Fixed version (ground truth):
LoggingEvent(final Optional<TestLogger> creatingLogger,final Level level,final Map<String,String> mdc,final Optional<Marker> marker,final Optional<Throwable> throwable,final String message,final Object... arguments){
  super();
  this.creatingLogger=creatingLogger;
  this.level=checkNotNull(level);
  this.mdc=ImmutableMap.copyOf(mdc);
  this.marker=checkNotNull(marker);
  this.throwable=checkNotNull(throwable);
  this.message=checkNotNull(message);
  this.arguments=from(asList(arguments)).transform(TO_NON_NULL_VALUE).toList();
}
Program: 189084
Project: 189084
Buggy source:
private void log(final Level level,final Marker marker,final String msg,final Throwable throwable){
  addLoggingEvent(level,of(marker),of(throwable),msg);
}

Fixed version (ground truth):
private void log(final Level level,final Marker marker,final String msg,final Throwable throwable){
  addLoggingEvent(level,fromNullable(marker),fromNullable(throwable),msg);
}
Program: 189085
Project: 189085
Buggy source:
public void put(final String key,final String val){
  value.get().put(key,val);
}

Fixed version (ground truth):
public void put(final String key,final String val){
  value.get().put(key,fromNullable(val).or("String_Node_Str"));
}
Program: 189086
Project: 189086
Buggy source:
/** 
 * Returns a service instance for an end point to the cache so that it may be used by other users.
 * @param endPoint The end point that the service instance belongs to.
 * @param service  The service instance to return to the pool.
 * @throws Exception Never.
 */
public void checkIn(ServiceEndPoint endPoint,S service) throws Exception {
  checkNotNull(endPoint);
  checkNotNull(service);
  ServiceEndPointInstancePair pair=new ServiceEndPointInstancePair(endPoint,service);
  if (_isClosed || !pair.isValid()) {
    _pool.invalidateObject(endPoint,service);
  }
 else {
    _pool.returnObject(endPoint,service);
  }
  if (_checkOutCounts.remove(pair,1) == 1) {
    _checkOutRevisions.remove(pair);
  }
}

Fixed version (ground truth):
/** 
 * Returns a service instance for an end point to the cache so that it may be used by other users.
 * @param handle The service handle that is being checked in.
 * @throws Exception Never.
 */
public void checkIn(ServiceHandle<S> handle) throws Exception {
  checkNotNull(handle);
  S service=handle.getService();
  ServiceEndPoint endPoint=handle.getEndPoint();
  Long invalidRevision=_invalidRevisions.get(endPoint);
  Long serviceRevision=_checkedOutRevisions.remove(handle);
  if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) {
    _pool.invalidateObject(endPoint,service);
  }
 else {
    _pool.returnObject(endPoint,service);
  }
}
Program: 189087
Project: 189087
Buggy source:
/** 
 * Retrieves a cached service instance for an end point that is not currently checked out.  If no idle cached instance is available and the cache is not full, a new one will be created, added to the cache, and then checked out.  Once the checked out instance is no longer in use, it should be returned by calling   {@link #checkIn}.
 * @param endPoint The end point to retrieve a cached service instance for.
 * @return A cached service instance for the requested end point.
 * @throws NoCachedInstancesAvailableException If the cache has reached total maximum capacity, or maximum capacityfor the requested end point, and no connections that aren't already checked out are available.
 */
public S checkOut(ServiceEndPoint endPoint) throws Exception {
  checkNotNull(endPoint);
  _requestCount.incrementAndGet();
  long currentRevision=_revisionNumber.get();
  try {
    S service=_pool.borrowObject(endPoint);
    ServiceEndPointInstancePair pair=new ServiceEndPointInstancePair(endPoint,service);
    _checkOutCounts.add(pair);
    _checkOutRevisions.putIfAbsent(pair,currentRevision);
    return service;
  }
 catch (  NoSuchElementException e) {
    _missCount.incrementAndGet();
    throw new NoCachedInstancesAvailableException();
  }
}

Fixed version (ground truth):
/** 
 * Retrieves a cached service instance for an end point that is not currently checked out.  If no idle cached instance is available and the cache is not full, a new one will be created, added to the cache, and then checked out.  Once the checked out instance is no longer in use, it should be returned by calling   {@link #checkIn}.
 * @param endPoint The end point to retrieve a cached service instance for.
 * @return A service handle that contains a cached service instance for the requested end point.
 * @throws NoCachedInstancesAvailableException If the cache has reached total maximum capacity, or maximum capacityfor the requested end point, and no connections that aren't already checked out are available.
 */
public ServiceHandle<S> checkOut(ServiceEndPoint endPoint) throws Exception {
  checkNotNull(endPoint);
  _requestCount.incrementAndGet();
  try {
    long revision=_revisionNumber.incrementAndGet();
    S service=_pool.borrowObject(endPoint);
    ServiceHandle<S> handle=new ServiceHandle<S>(service,endPoint);
    _checkedOutRevisions.put(handle,revision);
    return handle;
  }
 catch (  NoSuchElementException e) {
    _missCount.incrementAndGet();
    throw new NoCachedInstancesAvailableException();
  }
}
Program: 189088
Project: 189088
Buggy source:
/** 
 * Execute a callback on a specific end point. <p/> NOTE: This method is package private specifically so that   {@link AsyncServicePool} can call it.
 */
<R>R executeOnEndPoint(ServiceEndPoint endPoint,ServiceCallback<S,R> callback) throws Exception {
  S service=null;
  try {
    service=_serviceCache.checkOut(endPoint);
    TimerContext timer=_callbackExecutionTime.time();
    try {
      return callback.call(service);
    }
  finally {
      timer.stop();
    }
  }
 catch (  NoCachedInstancesAvailableException e) {
    LOG.debug("String_Node_Str",endPoint.getId(),e);
    throw e;
  }
catch (  Exception e) {
    if (_serviceFactory.isRetriableException(e)) {
      markEndPointAsBad(endPoint);
      LOG.debug("String_Node_Str",endPoint.getId(),e);
    }
    throw e;
  }
 finally {
    if (service != null) {
      try {
        _serviceCache.checkIn(endPoint,service);
      }
 catch (      Exception e) {
        LOG.warn("String_Node_Str",endPoint.getId(),e.toString());
        LOG.debug("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute a callback on a specific end point. <p/> NOTE: This method is package private specifically so that   {@link AsyncServicePool} can call it.
 */
<R>R executeOnEndPoint(ServiceEndPoint endPoint,ServiceCallback<S,R> callback) throws Exception {
  ServiceHandle<S> handle=null;
  try {
    handle=_serviceCache.checkOut(endPoint);
    TimerContext timer=_callbackExecutionTime.time();
    try {
      return callback.call(handle.getService());
    }
  finally {
      timer.stop();
    }
  }
 catch (  NoCachedInstancesAvailableException e) {
    LOG.debug("String_Node_Str",endPoint.getId(),e);
    throw e;
  }
catch (  Exception e) {
    if (_serviceFactory.isRetriableException(e)) {
      markEndPointAsBad(endPoint);
      LOG.debug("String_Node_Str",endPoint.getId(),e);
    }
    throw e;
  }
 finally {
    if (handle != null) {
      try {
        _serviceCache.checkIn(handle);
      }
 catch (      Exception e) {
        LOG.warn("String_Node_Str",endPoint.getId(),e.toString());
        LOG.debug("String_Node_Str",e);
      }
    }
  }
}
Program: 189089
Project: 189089
Buggy source:
/** 
 * Returns a service instance for an end point to the cache so that it may be used by other users.
 * @param endPoint The end point that the service instance belongs to.
 * @param service  The service instance to return to the pool.
 * @throws Exception Never.
 */
public void checkIn(ServiceEndPoint endPoint,S service) throws Exception {
  checkNotNull(endPoint);
  checkNotNull(service);
  Long invalidRevision=_invalidRevisions.get(endPoint);
  Long serviceRevision=_checkOutRevisions.remove(service);
  if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) {
    _pool.invalidateObject(endPoint,service);
  }
 else {
    _pool.returnObject(endPoint,service);
  }
}

Fixed version (ground truth):
/** 
 * Returns a service instance for an end point to the cache so that it may be used by other users.
 * @param handle The service handle that is being checked in.
 * @throws Exception Never.
 */
public void checkIn(ServiceHandle<S> handle) throws Exception {
  checkNotNull(handle);
  S service=handle.getService();
  ServiceEndPoint endPoint=handle.getEndPoint();
  Long invalidRevision=_invalidRevisions.get(endPoint);
  Long serviceRevision=_checkedOutRevisions.remove(handle);
  if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) {
    _pool.invalidateObject(endPoint,service);
  }
 else {
    _pool.returnObject(endPoint,service);
  }
}