nus-yam/ex-repair huggingface dataset:
Program: 32326
Project: 32326
Buggy source:
Set<String> getEntailedRelationshipTypes(Set<String> parents){
  Set<String> entailedTypes=new HashSet<>();
  for (  String parent : parents) {
    if (curieUtil.getIri(parent).isPresent()) {
      parent=GraphUtil.getFragment(curieUtil.getIri(parent).get());
    }
    entailedTypes.add(parent);
    Map<String,Object> params=new HashMap<>();
    params.put("String_Node_Str",parent);
    try (Transaction tx=graphDb.beginTx()){
      Result result=graphDb.execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str",params);
      while (result.hasNext()) {
        Map<String,Object> map=result.next();
        entailedTypes.add((String)map.get("String_Node_Str"));
      }
      tx.success();
    }
   }
  return entailedTypes;
}

Fixed version (ground truth):
Set<String> getEntailedRelationshipTypes(Collection<String> parents){
  Set<String> entailedTypes=new HashSet<>();
  for (  String parent : parents) {
    entailedTypes.add(parent);
    Map<String,Object> params=new HashMap<>();
    params.put("String_Node_Str",parent);
    try (Transaction tx=graphDb.beginTx()){
      Result result=graphDb.execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str",params);
      while (result.hasNext()) {
        Map<String,Object> map=result.next();
        entailedTypes.add((String)map.get("String_Node_Str"));
      }
      tx.success();
    }
   }
  return entailedTypes;
}
Program: 32327
Project: 32327
Buggy source:
@Test public void curiesAreEntailed(){
  String result=util.entailRelationships("String_Node_Str");
  assertThat(result,is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void curiesAreEntailed(){
  String result=util.resolveRelationships("String_Node_Str");
  assertThat(result,is("String_Node_Str"));
}
Program: 32328
Project: 32328
Buggy source:
@Test public void entailmentRegex(){
  String result=util.entailRelationships("String_Node_Str");
  assertThat(result,is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void entailmentRegex(){
  String result=util.resolveRelationships("String_Node_Str");
  assertThat(result,is("String_Node_Str"));
}
Program: 32329
Project: 32329
Buggy source:
public Collection<String> getFullUri(final String curie){
  Preconditions.checkNotNull(curie);
  Preconditions.checkState(curie.contains("String_Node_Str"),"String_Node_Str");
  String prefix=curie.split("String_Node_Str")[0];
  if (uriMap.containsKey(prefix)) {
    return transform(uriMap.get(prefix),new Function<String,String>(){
      @Override public String apply(      String uriPrefix){
        return String.format("String_Node_Str",uriPrefix,curie.substring(curie.indexOf(':') + 1));
      }
    }
);
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
public Collection<String> getFullUri(final String curie){
  Preconditions.checkNotNull(curie);
  String[] parts=curie.split("String_Node_Str");
  if (1 == parts.length) {
    return Collections.emptySet();
  }
  String prefix=parts[0];
  if (uriMap.containsKey(prefix)) {
    return transform(uriMap.get(prefix),new Function<String,String>(){
      @Override public String apply(      String uriPrefix){
        return String.format("String_Node_Str",uriPrefix,curie.substring(curie.indexOf(':') + 1));
      }
    }
);
  }
  return Collections.emptySet();
}
Program: 32330
Project: 32330
Buggy source:
@Override public int hashCode(){
  return new Long(getId()).hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return Long.valueOf(getId()).hashCode();
}
Program: 32331
Project: 32331
Buggy source:
@Override protected ConcurrentMap<String,Long> delegate(){
  return delegate();
}

Fixed version (ground truth):
@Override protected ConcurrentMap<String,Long> delegate(){
  return delegate;
}
Program: 32332
Project: 32332
Buggy source:
@Override protected ConcurrentMap<BatchEdge,Long> delegate(){
  return delegate();
}

Fixed version (ground truth):
@Override protected ConcurrentMap<BatchEdge,Long> delegate(){
  return delegate;
}
Program: 32333
Project: 32333
Buggy source:
public void setNodeProperty(long batchId,String property,Object value){
  if (!ignoreProperty(value)) {
    inserter.setNodeProperty(batchId,property,value);
    Map<String,Object> indexProperties=collectIndexProperties(inserter.getNodeProperties(batchId));
    if (!indexProperties.isEmpty()) {
      logger.fine("String_Node_Str" + indexProperties);
      nodeIndex.updateOrAdd(batchId,indexProperties);
    }
  }
}

Fixed version (ground truth):
public void setNodeProperty(long batchId,String property,Object value){
  try {
    if (!ignoreProperty(value)) {
      inserter.setNodeProperty(batchId,property,value);
      Map<String,Object> indexProperties=collectIndexProperties(inserter.getNodeProperties(batchId));
      if (!indexProperties.isEmpty()) {
        logger.fine("String_Node_Str" + indexProperties);
        nodeIndex.updateOrAdd(batchId,indexProperties);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + property + "String_Node_Str"+ value+ "String_Node_Str"+ batchId,e);
  }
}
Program: 32334
Project: 32334
Buggy source:
void loadOntology(){
  Stopwatch timer=Stopwatch.createStarted();
  logger.info("String_Node_Str");
  walker.walkStructure(visitor);
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.SECONDS)));
  timer.reset();
  timer.start();
  logger.info("String_Node_Str");
  postprocessor.processSomeValuesFrom();
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.SECONDS)));
  timer.reset();
  timer.start();
  logger.info("String_Node_Str");
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.SECONDS)));
  postprocessor.processSomeValuesFrom();
}

Fixed version (ground truth):
void loadOntology(){
  Stopwatch timer=Stopwatch.createStarted();
  logger.info("String_Node_Str");
  walker.walkStructure(visitor);
  visitor.shutdown();
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.SECONDS)));
  timer.reset();
  timer.start();
  logger.info("String_Node_Str");
  postprocessorProvider.get().postprocess();
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.SECONDS)));
  postprocessorProvider.shutdown();
}
Program: 32335
Project: 32335
Buggy source:
public static void load(OwlLoadConfiguration config){
  Injector i=Guice.createInjector(new Neo4jModule(config.getOntologyConfiguration()),new OwlLoaderModule(config));
  BatchOwlLoader loader=i.getInstance(BatchOwlLoader.class);
  logger.info("String_Node_Str");
  Stopwatch timer=Stopwatch.createStarted();
  loader.loadOntology();
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.MINUTES)));
}

Fixed version (ground truth):
public static void load(OwlLoadConfiguration config){
  Injector i=Guice.createInjector(new OwlLoaderModule(config));
  BatchOwlLoader loader=i.getInstance(BatchOwlLoader.class);
  logger.info("String_Node_Str");
  Stopwatch timer=Stopwatch.createStarted();
  loader.loadOntology();
  logger.info(format("String_Node_Str",timer.elapsed(TimeUnit.MINUTES)));
}
Program: 32336
Project: 32336
Buggy source:
@Provides BatchInserter getInserter(){
  return BatchInserters.inserter(config.getOntologyConfiguration().getGraphLocation());
}

Fixed version (ground truth):
@Provides @Singleton BatchInserter getInserter(){
  logger.info("String_Node_Str");
  return BatchInserters.inserter(config.getOntologyConfiguration().getGraphLocation());
}
Program: 32337
Project: 32337
Buggy source:
@Override protected void configure(){
  bindConstant().annotatedWith(Names.named("String_Node_Str")).to(CommonProperties.URI);
  bind(new TypeLiteral<Set<String>>(){
  }
).annotatedWith(Names.named("String_Node_Str")).toInstance(config.getIndexedNodeProperties());
  bind(new TypeLiteral<Set<String>>(){
  }
).annotatedWith(Names.named("String_Node_Str")).toInstance(config.getExactNodeProperties());
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(OwlLoadConfiguration.class).toInstance(config);
  bindConstant().annotatedWith(Names.named("String_Node_Str")).to(CommonProperties.URI);
  bind(new TypeLiteral<Set<String>>(){
  }
).annotatedWith(Names.named("String_Node_Str")).toInstance(config.getIndexedNodeProperties());
  bind(new TypeLiteral<Set<String>>(){
  }
).annotatedWith(Names.named("String_Node_Str")).toInstance(config.getExactNodeProperties());
  bind(new TypeLiteral<Map<String,String>>(){
  }
).annotatedWith(Names.named("String_Node_Str")).toInstance(config.getCategories());
}
Program: 32338
Project: 32338
Buggy source:
public Collection<Entity> getEntities(String token,EntityFormatConfiguration config){
  Query query=new Vocabulary.Query.Builder(token).build();
  List<Concept> terms=vocabulary.getConceptsFromTerm(query);
  Set<Entity> entities=Sets.newHashSet();
  for (  Concept term : terms) {
    if (shouldAnnotate(term,config)) {
      entities.add(new Entity(term));
    }
  }
  return entities;
}

Fixed version (ground truth):
public Collection<Entity> getEntities(String token,EntityFormatConfiguration config){
  Query query=new Vocabulary.Query.Builder(token).build();
  List<Concept> terms=vocabulary.getConceptsFromTerm(query);
  Set<Entity> entities=newHashSet();
  for (  Concept term : terms) {
    if (shouldAnnotate(term,config)) {
      entities.add(new Entity(term));
    }
  }
  return entities;
}
Program: 32339
Project: 32339
Buggy source:
public Set<Long> getOutList(){
  return outList;
}

Fixed version (ground truth):
Set<Long> getOutList(){
  return outList;
}
Program: 32340
Project: 32340
Buggy source:
private boolean nodesAreConnectedInIndex(long nodeIdOut,long nodeIdIn){
  Set<Long> outList=inMemoryIdx.get(nodeIdOut).getOutList();
  Set<Long> inList=inMemoryIdx.get(nodeIdIn).getInList();
  return !Collections.disjoint(outList,inList);
}

Fixed version (ground truth):
boolean nodesAreConnectedInIndex(long nodeIdOut,long nodeIdIn){
  Set<Long> outList=inMemoryIdx.get(nodeIdOut).getOutList();
  Set<Long> inList=inMemoryIdx.get(nodeIdIn).getInList();
  return !Collections.disjoint(outList,inList);
}
Program: 32342
Project: 32342
Buggy source:
@Test public void embeddedCollectionTest(){
  entityManager.getTransaction().begin();
  Hike hike=new Hike("String_Node_Str","String_Node_Str");
  hike.sections.add(new Section("String_Node_Str","String_Node_Str"));
  hike.sections.add(new Section("String_Node_Str","String_Node_Str"));
  entityManager.persist(hike);
  entityManager.getTransaction().commit();
  entityManager.getTransaction().begin();
  hike=entityManager.find(Hike.class,hike.id);
  assertThat(hike.sections).hasSize(2);
  assertThat(hike.sections.get(0).from).isEqualTo("String_Node_Str");
  assertThat(hike.sections.get(1).from).isEqualTo("String_Node_Str");
  entityManager.getTransaction().commit();
}

Fixed version (ground truth):
@Test public void embeddedCollectionTest(){
  entityManager.getTransaction().begin();
  Hike hike=new Hike("String_Node_Str","String_Node_Str");
  hike.sections.add(new Section("String_Node_Str","String_Node_Str"));
  hike.sections.add(new Section("String_Node_Str","String_Node_Str"));
  entityManager.persist(hike);
  entityManager.flush();
  entityManager.clear();
  hike=entityManager.find(Hike.class,hike.id);
  assertThat(hike.sections).hasSize(2);
  assertThat(hike.sections.get(0).from).isEqualTo("String_Node_Str");
  assertThat(hike.sections.get(1).from).isEqualTo("String_Node_Str");
  entityManager.getTransaction().commit();
}
Program: 32343
Project: 32343
Buggy source:
@Test public void associationTest(){
  entityManager.getTransaction().begin();
  Hike hike=new Hike("String_Node_Str","String_Node_Str");
  Trip trip=new Trip();
  trip.name="String_Node_Str";
  hike.recommendedTrip=trip;
  trip.availableHikes.add(hike);
  entityManager.persist(trip);
  entityManager.persist(hike);
  entityManager.getTransaction().commit();
  entityManager.getTransaction().begin();
  hike=entityManager.find(Hike.class,hike.id);
  assertThat(hike.recommendedTrip).isNotNull();
  assertThat(hike.recommendedTrip.name).isEqualTo("String_Node_Str");
  entityManager.getTransaction().commit();
}

Fixed version (ground truth):
@Test public void associationTest(){
  entityManager.getTransaction().begin();
  Hike hike=new Hike("String_Node_Str","String_Node_Str");
  Trip trip=new Trip();
  trip.name="String_Node_Str";
  hike.recommendedTrip=trip;
  trip.availableHikes.add(hike);
  entityManager.persist(trip);
  entityManager.persist(hike);
  entityManager.flush();
  entityManager.clear();
  hike=entityManager.find(Hike.class,hike.id);
  assertThat(hike.recommendedTrip).isNotNull();
  assertThat(hike.recommendedTrip.name).isEqualTo("String_Node_Str");
  entityManager.getTransaction().commit();
}
Program: 32345
Project: 32345
Buggy source:
private static void loadBannedItems(){
  bannedItems.clear();
  File file=new File(saveDir,"String_Node_Str");
  if (!file.exists()) {
    bannedItems.put(new ItemStack(Blocks.command_block),new HashSet<String>(Arrays.asList("String_Node_Str")));
    saveBannedItems();
    return;
  }
  try {
    FileReader r=new FileReader(file);
    int line=0;
    for (    String s : IOUtils.readLines(r)) {
      if (s.charAt(0) == '#' || s.trim().length() == 0)       continue;
      int delim=s.lastIndexOf('=');
      if (delim < 0) {
        logger.error("String_Node_Str" + line + "String_Node_Str");
        continue;
      }
      try {
        NBTTagCompound key=JsonToNBT.func_180713_a(s.substring(0,delim));
        Set<String> values=new HashSet<String>();
        for (        String s2 : s.substring(delim + 1).split("String_Node_Str"))         values.add(s2.trim());
        bannedItems.put(InventoryUtils.loadPersistant(key),values);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + line + "String_Node_Str"+ e.getMessage());
      }
    }
    r.close();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private static void loadBannedItems(){
  bannedItems.clear();
  File file=new File(saveDir,"String_Node_Str");
  if (!file.exists()) {
    bannedItems.put(new ItemStack(Blocks.command_block),new HashSet<String>(Arrays.asList("String_Node_Str")));
    saveBannedItems();
    return;
  }
  try {
    FileReader r=new FileReader(file);
    int line=0;
    for (    String s : IOUtils.readLines(r)) {
      if (s.charAt(0) == '#' || s.trim().length() == 0)       continue;
      int delim=s.lastIndexOf('=');
      if (delim < 0) {
        logger.error("String_Node_Str" + line + "String_Node_Str");
        continue;
      }
      try {
        NBTTagCompound key=JsonToNBT.getTagFromJson(s.substring(0,delim));
        Set<String> values=new HashSet<String>();
        for (        String s2 : s.substring(delim + 1).split("String_Node_Str"))         values.add(s2.trim());
        bannedItems.put(InventoryUtils.loadPersistant(key),values);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str" + line + "String_Node_Str"+ e.getMessage());
      }
    }
    r.close();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 32347
Project: 32347
Buggy source:
/** 
 * Extending Effect classes should use this method to obtain the current "root" Location of the effect. This method will not return null when called from onRun. Effects with invalid locations will be cancelled.
 */
public Location getLocation(){
  Entity entityReference=entity.get();
  if (entityReference != null) {
    long now=System.currentTimeMillis();
    if (locationUpdateInterval == 0 || lastLocationUpdate == 0 || lastLocationUpdate + locationUpdateInterval > now) {
      if (entityReference instanceof LivingEntity) {
        setLocation(((LivingEntity)entityReference).getEyeLocation());
      }
 else {
        setLocation(entityReference.getLocation());
      }
    }
  }
  return location;
}

Fixed version (ground truth):
/** 
 * Extending Effect classes should use this method to obtain the current "root" Location of the effect. This method will not return null when called from onRun. Effects with invalid locations will be cancelled.
 */
public final Location getLocation(){
  Entity entityReference=entity.get();
  if (entityReference != null) {
    long now=System.currentTimeMillis();
    if (locationUpdateInterval == 0 || lastLocationUpdate == 0 || lastLocationUpdate + locationUpdateInterval > now) {
      if (entityReference instanceof LivingEntity) {
        setLocation(((LivingEntity)entityReference).getEyeLocation());
      }
 else {
        setLocation(entityReference.getLocation());
      }
    }
  }
  return location;
}
Program: 32348
Project: 32348
Buggy source:
/** 
 * Extending Effect classes should use this method to obtain the current "target" Location of the effect. Unlike getLocation, this may return null.
 */
public Location getTarget(){
  Entity entityReference=targetEntity.get();
  if (entityReference != null) {
    long now=System.currentTimeMillis();
    if (locationUpdateInterval == 0 || lastTargetUpdate == 0 || lastTargetUpdate + locationUpdateInterval > now) {
      if (entityReference instanceof LivingEntity) {
        setTarget(((LivingEntity)entityReference).getEyeLocation());
      }
 else {
        setTarget(entityReference.getLocation());
      }
    }
  }
  return target;
}

Fixed version (ground truth):
/** 
 * Extending Effect classes should use this method to obtain the current "target" Location of the effect. Unlike getLocation, this may return null.
 */
public final Location getTarget(){
  Entity entityReference=targetEntity.get();
  if (entityReference != null) {
    long now=System.currentTimeMillis();
    if (locationUpdateInterval == 0 || lastTargetUpdate == 0 || lastTargetUpdate + locationUpdateInterval > now) {
      if (entityReference instanceof LivingEntity) {
        setTarget(((LivingEntity)entityReference).getEyeLocation());
      }
 else {
        setTarget(entityReference.getLocation());
      }
    }
  }
  return target;
}
Program: 32349
Project: 32349
Buggy source:
/** 
 * Set the Location this Effect is centered on.
 */
public void setLocation(Location location){
  this.location=location == null ? null : location.clone();
  if (this.offset != null) {
    this.location=this.location.add(this.offset);
  }
}

Fixed version (ground truth):
/** 
 * Set the Location this Effect is centered on.
 */
public void setLocation(Location location){
  Validate.notNull(location,"String_Node_Str");
  this.location=location == null ? null : location.clone();
  if (offset != null && location != null) {
    this.location=location.add(offset);
    lastLocationUpdate=System.currentTimeMillis();
  }
}
Program: 32350
Project: 32350
Buggy source:
/** 
 * Set the Location this Effect is targeting.
 */
public void setTarget(Location location){
  this.target=location == null ? null : location.clone();
  if (this.targetOffset != null) {
    this.target=this.target.add(this.targetOffset);
  }
}

Fixed version (ground truth):
/** 
 * Set the Location this Effect is targeting.
 */
public void setTarget(Location location){
  Validate.notNull(location,"String_Node_Str");
  target=location == null ? null : location.clone();
  if (targetOffset != null && target != null) {
    target.add(targetOffset);
    lastTargetUpdate=System.currentTimeMillis();
  }
}
Program: 32351
Project: 32351
Buggy source:
protected boolean validate(){
  Location location=getLocation();
  if (location == null)   return false;
  if (autoOrient) {
    Location target=getTarget();
    if (target != null) {
      Vector direction=target.toVector().subtract(location.toVector());
      location.setDirection(direction);
      target.setDirection(direction.multiply(-1));
    }
  }
  return true;
}

Fixed version (ground truth):
protected final boolean validate(){
  Location location=getLocation();
  if (location == null)   return false;
  if (autoOrient) {
    Location target=getTarget();
    if (target != null) {
      Vector direction=target.toVector().subtract(location.toVector());
      location.setDirection(direction);
      target.setDirection(direction.multiply(-1));
    }
  }
  return true;
}
Program: 32352
Project: 32352
Buggy source:
@SuppressWarnings("String_Node_Str") private void readData(NamingEnumeration ldapContents) throws Exception {
  SearchResult result=null;
  NamingEnumeration<? extends Attribute> atts=null;
  Attribute a=null;
  while (ldapContents.hasMore()) {
    String name=null;
    String password=null;
    result=(SearchResult)ldapContents.next();
    name=result.getName();
    name=name.split("String_Node_Str")[1];
    if (fMasterUser != null) {
      name+=MASTER_SEP + fMasterUser;
    }
    atts=result.getAttributes().getAll();
    while (atts.hasMore()) {
      a=atts.next();
      if (fPasswordField.equals(a.getID()) && a.get() != null) {
        Object val=a.get();
        if (val instanceof byte[]) {
          password=new String((byte[])val);
        }
 else {
          password=val.toString();
        }
        break;
      }
    }
    if (fMasterPassword != null) {
      password=fMasterPassword;
    }
    fUserNames.add(name);
    fUserPasswords.add(password);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void readData(NamingEnumeration ldapContents) throws Exception {
  SearchResult result=null;
  NamingEnumeration<? extends Attribute> atts=null;
  Attribute a=null;
  while (ldapContents.hasMore()) {
    String name=null;
    String password=null;
    result=(SearchResult)ldapContents.next();
    name=result.getName();
    if (name.indexOf(',') > 0) {
      name=name.split("String_Node_Str")[0];
    }
    name=name.split("String_Node_Str")[1];
    if (fMasterUser != null) {
      name+=MASTER_SEP + fMasterUser;
    }
    atts=result.getAttributes().getAll();
    while (atts.hasMore()) {
      a=atts.next();
      if (fPasswordField.equals(a.getID()) && a.get() != null) {
        Object val=a.get();
        if (val instanceof byte[]) {
          password=new String((byte[])val);
        }
 else {
          password=val.toString();
        }
        break;
      }
    }
    if (fMasterPassword != null) {
      password=fMasterPassword;
    }
    fUserNames.add(name);
    fUserPasswords.add(password);
  }
}
Program: 32353
Project: 32353
Buggy source:
@SuppressWarnings("String_Node_Str") private void readData(NamingEnumeration ldapContents) throws Exception {
  SearchResult result=null;
  NamingEnumeration<? extends Attribute> atts=null;
  Attribute a=null;
  while (ldapContents.hasMore()) {
    String name=null;
    String password=null;
    result=(SearchResult)ldapContents.next();
    name=result.getName();
    name=name.split("String_Node_Str")[1];
    if (fMasterUser != null) {
      name+=MASTER_SEP + fMasterUser;
    }
    atts=result.getAttributes().getAll();
    while (atts.hasMore()) {
      a=atts.next();
      if (fPasswordField.equals(a.getID()) && a.get() != null) {
        Object val=a.get();
        if (val instanceof byte[]) {
          password=new String((byte[])val);
        }
 else {
          password=val.toString();
        }
        break;
      }
    }
    if (fMasterPassword != null) {
      password=fMasterPassword;
    }
    fUserNames.add(name);
    fUserPasswords.add(password);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void readData(NamingEnumeration ldapContents) throws Exception {
  SearchResult result=null;
  NamingEnumeration<? extends Attribute> atts=null;
  Attribute a=null;
  while (ldapContents.hasMore()) {
    String name=null;
    String password=null;
    result=(SearchResult)ldapContents.next();
    name=result.getName();
    if (name.indexOf(',') > 0) {
      name=name.split("String_Node_Str")[0];
    }
    name=name.split("String_Node_Str")[1];
    if (fMasterUser != null) {
      name+=MASTER_SEP + fMasterUser;
    }
    atts=result.getAttributes().getAll();
    while (atts.hasMore()) {
      a=atts.next();
      if (fPasswordField.equals(a.getID()) && a.get() != null) {
        Object val=a.get();
        if (val instanceof byte[]) {
          password=new String((byte[])val);
        }
 else {
          password=val.toString();
        }
        break;
      }
    }
    if (fMasterPassword != null) {
      password=fMasterPassword;
    }
    fUserNames.add(name);
    fUserPasswords.add(password);
  }
}
Program: 32354
Project: 32354
Buggy source:
@Override public void start(){
  logger.info("String_Node_Str");
  try {
    mailDestination.startup();
    sched=StdSchedulerFactory.getDefaultScheduler();
    if (sched.isShutdown()) {
      logger.error("String_Node_Str");
    }
    if (sched.isStarted()) {
      logger.error("String_Node_Str");
    }
    final JobDataMap jdm=new JobDataMap();
    jdm.put("String_Node_Str",mailSource);
    try {
      if (folderPattern != null) {
        jdm.put("String_Node_Str",Pattern.compile(folderPattern));
      }
    }
 catch (    final PatternSyntaxException e) {
      logger.error("String_Node_Str",e,e.toString());
    }
    final JobDetail job=newJob(MailFlowJob.class).withIdentity(riverName + "String_Node_Str" + props.hashCode(),"String_Node_Str").usingJobData(jdm).build();
    Trigger trigger=null;
    if (StringUtils.isEmpty(schedule)) {
      logger.info("String_Node_Str",interval.seconds());
      trigger=newTrigger().withIdentity("String_Node_Str","String_Node_Str").startNow().withSchedule(simpleSchedule().withIntervalInSeconds((int)interval.seconds()).repeatForever()).build();
    }
 else {
      logger.info("String_Node_Str",schedule);
      trigger=newTrigger().withIdentity("String_Node_Str","String_Node_Str").withSchedule(cronSchedule(schedule)).build();
    }
    sched.scheduleJob(job,trigger);
    sched.start();
    logger.info("String_Node_Str");
  }
 catch (  final Exception e) {
    logger.error("String_Node_Str" + e,e);
  }
}

Fixed version (ground truth):
@Override public void start(){
  logger.info("String_Node_Str");
  try {
    mailDestination.startup();
    sched=StdSchedulerFactory.getDefaultScheduler();
    if (sched.isShutdown()) {
      logger.error("String_Node_Str");
    }
    if (sched.isStarted()) {
      logger.error("String_Node_Str");
    }
    final JobDataMap jdm=new JobDataMap();
    jdm.put("String_Node_Str",mailSource);
    try {
      if (folderPattern != null) {
        jdm.put("String_Node_Str",Pattern.compile(folderPattern));
      }
    }
 catch (    final PatternSyntaxException e) {
      logger.error("String_Node_Str",e,e.toString());
    }
    final String group="String_Node_Str" + riverName + "String_Node_Str"+ props.hashCode();
    final JobDetail job=newJob(MailFlowJob.class).withIdentity(riverName + "String_Node_Str" + props.hashCode(),group).usingJobData(jdm).build();
    Trigger trigger=null;
    if (StringUtils.isEmpty(schedule)) {
      logger.info("String_Node_Str",interval.seconds());
      trigger=newTrigger().withIdentity("String_Node_Str",group).startNow().withSchedule(simpleSchedule().withIntervalInSeconds((int)interval.seconds()).repeatForever()).build();
    }
 else {
      logger.info("String_Node_Str",schedule);
      trigger=newTrigger().withIdentity("String_Node_Str",group).withSchedule(cronSchedule(schedule)).build();
    }
    sched.scheduleJob(job,trigger);
    sched.start();
    logger.info("String_Node_Str");
  }
 catch (  final Exception e) {
    logger.error("String_Node_Str" + e,e);
  }
}
Program: 32357
Project: 32357
Buggy source:
public static List<Integer> tableSendPos(Rule r,Map<String,Table> tableMap){
  List<Predicate> bodyP=r.getBodyP();
  List<Integer> sendPos=new ArrayList<Integer>();
  Predicate prevp=null;
  for (  Predicate p : bodyP) {
    if (prevp == null || prevp instanceof PrivPredicate) {
      prevp=p;
      continue;
    }
    if (requireTransfer(prevp,p,tableMap)) {
      if (collectLiveVarsAt(r,p.getPos()).isEmpty()) {
        Assert.impossible();
        continue;
      }
      sendPos.add(p.getPos());
    }
    prevp=p;
  }
  return sendPos;
}

Fixed version (ground truth):
public static List<Integer> tableSendPos(Rule r,Map<String,Table> tableMap){
  List<Predicate> bodyP=r.getBodyP();
  List<Integer> sendPos=new ArrayList<Integer>();
  Predicate prevp=null;
  for (  Predicate p : bodyP) {
    if (prevp == null || prevp instanceof PrivPredicate) {
      prevp=p;
      continue;
    }
    if (requireTransfer(prevp,p,tableMap)) {
      if (collectLiveVarsAt(r,p.getPos()).isEmpty()) {
        continue;
      }
      sendPos.add(p.getPos());
    }
    prevp=p;
  }
  return sendPos;
}
Program: 32358
Project: 32358
Buggy source:
void processRemoteRules(){
  if (!conf.isDistributed())   return;
  List<Rule> toAdd=new ArrayList<Rule>();
  for (  RuleComp rc : ruleComps) {
    for (    Rule r : rc.getRules()) {
      if (hasRemoteRuleHead(r))       processRemoteRuleHead(r,toAdd);
    }
    rc.addAll(toAdd);
    toAdd.clear();
    for (    Rule r : rc.getRules()) {
      if (hasRemoteRuleBody(r))       processRemoteRuleBody(r,toAdd);
    }
    rc.addAll(toAdd);
    while (!toAdd.isEmpty()) {
      List<Rule> toAdd2=new ArrayList<Rule>();
      for (      Rule r : toAdd) {
        if (hasRemoteRuleHead(r))         processRemoteRuleHead(r,toAdd2);
        if (hasRemoteRuleBody(r))         processRemoteRuleBody(r,toAdd2);
      }
      rc.addAll(toAdd2);
      toAdd=toAdd2;
    }
  }
}

Fixed version (ground truth):
void processRemoteRules(){
  if (!conf.isDistributed())   return;
  List<Rule> toAdd=new ArrayList<Rule>();
  for (  RuleComp rc : ruleComps) {
    for (    Rule r : rc.getRules()) {
      if (hasRemoteRuleHead(r,tableMap))       processRemoteRuleHead(r,toAdd);
    }
    rc.addAll(toAdd);
    toAdd.clear();
    for (    Rule r : rc.getRules()) {
      if (hasRemoteRuleBody(r,tableMap))       processRemoteRuleBody(r,toAdd);
    }
    rc.addAll(toAdd);
    while (!toAdd.isEmpty()) {
      List<Rule> toAdd2=new ArrayList<Rule>();
      for (      Rule r : toAdd) {
        if (hasRemoteRuleHead(r,tableMap))         processRemoteRuleHead(r,toAdd2);
        if (hasRemoteRuleBody(r,tableMap))         processRemoteRuleBody(r,toAdd2);
      }
      rc.addAll(toAdd2);
      toAdd=toAdd2;
    }
  }
}
Program: 32359
Project: 32359
Buggy source:
public static boolean hasRemoteRuleHead(Rule r){
  Predicate h=r.getHead();
  if (r.isSimpleArrayInit())   return false;
  if (r.getBodyP().size() == 0)   return true;
  List<Predicate> body=r.getBodyP();
  Predicate p=body.get(body.size() - 1);
  if (p.first().equals(h.first()))   return false;
 else   return true;
}

Fixed version (ground truth):
public static boolean hasRemoteRuleHead(Rule r,Map<String,Table> tableMap){
  Predicate h=r.getHead();
  if (r.isSimpleArrayInit())   return false;
  if (r.getBodyP().size() == 0)   return true;
  List<Predicate> body=r.getBodyP();
  Predicate p=body.get(body.size() - 1);
  return requireTransfer(p,h,tableMap);
}
Program: 32360
Project: 32360
Buggy source:
public static boolean hasRemoteRuleBody(Rule r){
  List<Predicate> bodyP=r.getBodyP();
  if (bodyP.size() <= 1)   return false;
  List<Integer> sendPos=tableSendPos(r);
  if (sendPos.isEmpty())   return false;
  return true;
}

Fixed version (ground truth):
public static boolean hasRemoteRuleBody(Rule r,Map<String,Table> tableMap){
  List<Predicate> bodyP=r.getBodyP();
  if (bodyP.size() <= 1)   return false;
  List<Integer> sendPos=tableSendPos(r,tableMap);
  if (sendPos.isEmpty())   return false;
  return true;
}
Program: 32361
Project: 32361
Buggy source:
public static List<Integer> tableSendPos(List<Predicate> bodyP){
  List<Integer> sendPos=new ArrayList<Integer>();
  Predicate prevp=null;
  for (  Predicate p : bodyP) {
    if (prevp != null) {
      if (!prevp.first().equals(p.first())) {
        sendPos.add(p.getPos());
      }
    }
    prevp=p;
  }
  return sendPos;
}

Fixed version (ground truth):
public static List<Integer> tableSendPos(Rule r,Map<String,Table> tableMap){
  List<Predicate> bodyP=r.getBodyP();
  List<Integer> sendPos=new ArrayList<Integer>();
  Predicate prevp=null;
  for (  Predicate p : bodyP) {
    if (prevp == null || prevp instanceof PrivPredicate) {
      prevp=p;
      continue;
    }
    if (requireTransfer(prevp,p,tableMap)) {
      if (collectLiveVarsAt(r,p.getPos()).isEmpty()) {
        Assert.impossible();
        continue;
      }
      sendPos.add(p.getPos());
    }
    prevp=p;
  }
  return sendPos;
}
Program: 32362
Project: 32362
Buggy source:
boolean hasRemoteRuleHead(){
  if (!conf.isDistributed())   return false;
  return Analysis.hasRemoteRuleHead(rule);
}

Fixed version (ground truth):
boolean hasRemoteRuleHead(){
  if (!conf.isDistributed())   return false;
  return Analysis.hasRemoteRuleHead(rule,tableMap);
}
Program: 32363
Project: 32363
Buggy source:
boolean hasRemoteRuleBody(){
  if (!conf.isDistributed())   return false;
  return Analysis.hasRemoteRuleBody(rule);
}

Fixed version (ground truth):
boolean hasRemoteRuleBody(){
  if (!conf.isDistributed())   return false;
  return Analysis.hasRemoteRuleBody(rule,tableMap);
}
Program: 32364
Project: 32364
Buggy source:
List<Integer> tableSendPos(){
  if (tableSendPos == null)   tableSendPos=Analysis.tableSendPos(rule);
  return tableSendPos;
}

Fixed version (ground truth):
List<Integer> tableSendPos(){
  if (tableSendPos == null)   tableSendPos=Analysis.tableSendPos(rule,tableMap);
  return tableSendPos;
}
Program: 32365
Project: 32365
Buggy source:
public void waitUntilReady(int id) throws InterruptedException {
  if (ready.containsKey(id))   return;
  Object o=new Object();
synchronized (o) {
    Object prev=ready.putIfAbsent(id,o);
    if (prev != null) {
      return;
    }
    o.wait();
  }
}

Fixed version (ground truth):
public void waitUntilReady(int id) throws InterruptedException {
  if (ready.containsKey(id)) {
    ready.get(id);
    return;
  }
  Object o=new Object();
synchronized (o) {
    Object prev=ready.putIfAbsent(id,o);
    if (prev != null) {
      return;
    }
    o.wait();
  }
}
Program: 32366
Project: 32366
Buggy source:
public synchronized SocketChannel next(){
  selected++;
  return channels[selected % channelNum];
}

Fixed version (ground truth):
public synchronized SocketChannel next(){
  int s=selected.incrementAndGet();
  return channels[s % channelNum];
}
Program: 32367
Project: 32367
Buggy source:
public ChannelMux(){
  channels=new SocketChannel[channelNum];
  _pos=0;
  selected=0;
}

Fixed version (ground truth):
public ChannelMux(){
  channels=new SocketChannel[channelNum];
  _pos=0;
  selected=new AtomicInteger(0);
}
Program: 32368
Project: 32368
Buggy source:
public static String[] split(String str,String delim,int maxsplit){
  int delimLength=delim.length();
  if (delimLength == 1) {
    return split(str,delim.charAt(0),maxsplit);
  }
  ArrayList<String> splitted=new ArrayList<String>();
  int idx=0, newIdx=-1;
  int splitnum=0;
  while ((newIdx=str.indexOf(delim,idx)) != -1) {
    if (newIdx > idx)     splitted.add(str.substring(idx,newIdx));
    idx=newIdx + delimLength;
    splitnum++;
    if (maxsplit > 0 && splitnum + 1 >= maxsplit)     break;
  }
  if (idx < str.length())   splitted.add(str.substring(idx));
  return splitted.toArray(new String[splitted.size()]);
}

Fixed version (ground truth):
public static String[] split(String str,String delim,int maxsplit){
  int delimLength=delim.length();
  if (delimLength == 1) {
    return split(str,delim.charAt(0),maxsplit);
  }
  ArrayList<String> splitted=new ArrayList<String>();
  int idx=0, newIdx=-1;
  int splitnum=0;
  while ((newIdx=str.indexOf(delim,idx)) != -1) {
    if (newIdx == idx)     splitted.add("String_Node_Str");
    if (newIdx > idx)     splitted.add(str.substring(idx,newIdx));
    idx=newIdx + delimLength;
    splitnum++;
    if (maxsplit > 0 && splitnum + 1 >= maxsplit)     break;
  }
  if (idx < str.length())   splitted.add(str.substring(idx));
  return splitted.toArray(new String[splitted.size()]);
}
Program: 32369
Project: 32369
Buggy source:
public static List<PyFunction> getFunctions(){
  PyDictionary locals=(PyDictionary)interp.getLocals();
  List<PyFunction> funcs=new ArrayList<PyFunction>(locals.size());
  PyIterator it=(PyIterator)locals.itervalues();
  while (true) {
    PyObject p=it.__iternext__();
    if (p == null)     break;
    if (p instanceof PyFunction && !isInternal(p)) {
      funcs.add((PyFunction)p);
    }
  }
  return funcs;
}

Fixed version (ground truth):
public static List<PyFunction> getFunctions(){
  PyObject _locals=interp.getLocals();
  List<PyFunction> funcs=new ArrayList<PyFunction>(_locals.__len__());
  PyIterator it=null;
  if (_locals instanceof PyDictionary) {
    it=(PyIterator)((PyDictionary)_locals).itervalues();
  }
 else {
    it=(PyIterator)((PyStringMap)_locals).itervalues();
  }
  while (true) {
    PyObject p=it.__iternext__();
    if (p == null)     break;
    if (p instanceof PyFunction && !isInternal(p)) {
      funcs.add((PyFunction)p);
    }
  }
  return funcs;
}
Program: 32371
Project: 32371
Buggy source:
void loadPyFunc() throws InternalException {
  if (name.startsWith("String_Node_Str"))   pyname=name.substring("String_Node_Str".length());
 else   pyname=name;
  if (pyname.indexOf('.') >= 0)   throw new InternalException("String_Node_Str");
  pyfunc=PyInterp.load(pyname);
  if (pyfunc == null)   throw new InternalException("String_Node_Str" + name);
  if (pyfunc.func_defaults != null && pyfunc.func_defaults.length > 0)   throw new InternalException("String_Node_Str" + pyname);
  CompilerFlags f=((PyBaseCode)pyfunc.func_code).co_flags;
  if (f.isFlagSet(CodeFlag.CO_VARARGS) || f.isFlagSet(CodeFlag.CO_VARKEYWORDS)) {
    throw new InternalException("String_Node_Str" + pyname);
  }
  if (!(pyfunc.func_code instanceof PyBaseCode)) {
    throw new InternalException("String_Node_Str" + pyfunc.func_code.getClass().getSimpleName() + "String_Node_Str"+ pyname);
  }
  int idx=PyInvoke.getRegisteredIdx(pyfunc);
  if (idx < 0) {
    if (pyfuncIdx < 0)     pyfuncIdx=IdFactory.nextPyFuncId();
    PyInvoke.register(pyfuncIdx,pyfunc);
  }
 else {
    pyfuncIdx=idx;
  }
}

Fixed version (ground truth):
void loadPyFunc() throws InternalException {
  if (name.startsWith("String_Node_Str"))   pyname=name.substring("String_Node_Str".length());
 else   pyname=name;
  if (pyname.indexOf('.') >= 0)   throw new InternalException("String_Node_Str" + pyname);
  pyfunc=PyInterp.load(pyname);
  if (pyfunc == null)   throw new InternalException("String_Node_Str" + name);
  if (pyfunc.func_defaults != null && pyfunc.func_defaults.length > 0)   throw new InternalException("String_Node_Str" + pyname);
  CompilerFlags f=((PyBaseCode)pyfunc.func_code).co_flags;
  if (f.isFlagSet(CodeFlag.CO_VARARGS) || f.isFlagSet(CodeFlag.CO_VARKEYWORDS)) {
    throw new InternalException("String_Node_Str" + pyname);
  }
  if (!(pyfunc.func_code instanceof PyBaseCode)) {
    throw new InternalException("String_Node_Str" + pyfunc.func_code.getClass().getSimpleName() + "String_Node_Str"+ pyname);
  }
  int idx=PyInvoke.getRegisteredIdx(pyfunc);
  if (idx < 0) {
    if (pyfuncIdx < 0)     pyfuncIdx=IdFactory.nextPyFuncId();
    PyInvoke.register(pyfuncIdx,pyfunc);
  }
 else {
    pyfuncIdx=idx;
  }
}
Program: 32373
Project: 32373
Buggy source:
void computeJavaArrayReturnVarTypes(TypeCast cast,Class<?> methodRetType) throws InternalException {
  if (getReturns().size() == 1) {
    methodRetType=doTypeCast(cast,methodRetType);
    Variable v=getReturns().get(0);
    v.setType(methodRetType);
  }
 else {
    Class<?>[] types=getTypesFromJavaAnnotation();
    isArrayType=true;
    if (types == null) {
      Class<?> arrType=getMethodReturnType();
      if (!arrType.isArray()) {
        String msg="String_Node_Str" + name;
        throw new InternalException(msg);
      }
      Class<?> elemType=arrType.getComponentType();
      elemType=doTypeCast(cast,elemType);
      for (int i=0; i < getReturns().size(); i++) {
        getReturns().get(i).setType(elemType);
      }
      return;
    }
 else {
      if (cast != null)       throw new InternalException("String_Node_Str" + cast.type.getSimpleName());
      if (types.length != getReturns().size()) {
        String msg="String_Node_Str" + name;
        throw new InternalException(msg);
      }
      for (int i=0; i < types.length; i++) {
        getReturns().get(i).setType(types[i]);
      }
    }
  }
}

Fixed version (ground truth):
void computeJavaArrayReturnVarTypes(TypeCast cast,Class<?> methodRetType) throws InternalException {
  if (getReturns().size() == 1) {
    methodRetType=doTypeCast(cast,methodRetType);
    Variable v=getReturns().get(0);
    v.setType(methodRetType);
  }
 else {
    Class<?>[] types=getTypesFromJavaAnnotation();
    isArrayType=true;
    if (types == null) {
      Class<?> arrType=methodRetType;
      if (methodRetType.getComponentType().isPrimitive()) {
        isPrimArrayType=true;
      }
      if (!arrType.isArray()) {
        String msg="String_Node_Str" + name;
        throw new InternalException(msg);
      }
      Class<?> elemType=arrType.getComponentType();
      elemType=doTypeCast(cast,elemType);
      for (int i=0; i < getReturns().size(); i++) {
        getReturns().get(i).setType(elemType);
      }
      return;
    }
 else {
      if (cast != null)       throw new InternalException("String_Node_Str" + cast.type.getSimpleName());
      if (types.length != getReturns().size()) {
        String msg="String_Node_Str" + name;
        throw new InternalException(msg);
      }
      for (int i=0; i < types.length; i++) {
        getReturns().get(i).setType(types[i]);
      }
    }
  }
}
Program: 32374
Project: 32374
Buggy source:
public void dropTable(String name){
  TableDecl decl=tableDeclMap.get(name);
  if (decl.hasIterColumn()) {
    for (int i=0; i < decl.maxIter(); i++) {
      tableMap.remove(IterTable.name(decl.name(),i));
    }
    tableDeclMap.remove(name);
  }
 else {
    tableMap.remove(name);
    tableDeclMap.remove(name);
  }
}

Fixed version (ground truth):
public void dropTable(String name){
  TableDecl decl=tableDeclMap.get(name);
  if (decl == null)   return;
  if (decl.hasIterColumn()) {
    for (int i=0; i < decl.maxIter(); i++) {
      tableMap.remove(IterTable.name(decl.name(),i));
    }
    tableDeclMap.remove(name);
  }
 else {
    tableMap.remove(name);
    tableDeclMap.remove(name);
  }
}
Program: 32375
Project: 32375
Buggy source:
public String signature(Map<String,Table> tableMap){
  String sig="String_Node_Str";
  Predicate p=getHead();
  Table t=tableMap.get(p.name());
  sig+=p.signature(p.name());
  sig+="String_Node_Str";
  boolean first=true;
  for (  Object o : getBody()) {
    if (!first)     sig+="String_Node_Str";
    if (o instanceof Predicate) {
      Predicate p2=(Predicate)o;
      t=tableMap.get(((Predicate)o).name());
      sig+=p2.signature(p2.name());
    }
 else {
      Expr e=(Expr)o;
      sig+=e.sig();
    }
    first=false;
  }
  sig+="String_Node_Str";
  return sig;
}

Fixed version (ground truth):
public String signature(Map<String,Table> tableMap){
  String sig="String_Node_Str";
  Predicate p=getHead();
  Table t=tableMap.get(p.name());
  sig+=p.signature(t.signature());
  sig+="String_Node_Str";
  boolean first=true;
  for (  Object o : getBody()) {
    if (!first)     sig+="String_Node_Str";
    if (o instanceof Predicate) {
      Predicate p2=(Predicate)o;
      t=tableMap.get(((Predicate)o).name());
      sig+=p2.signature(p2.name());
    }
 else {
      Expr e=(Expr)o;
      sig+=e.sig();
    }
    first=false;
  }
  sig+="String_Node_Str";
  return sig;
}
Program: 32376
Project: 32376
Buggy source:
MergeTableMap(Map<String,Table> old,Map<String,Table> newMap){
  if (old.keySet().equals(newMap.keySet())) {
    map=old;
  }
 else {
    map=new HashMap<String,Table>(old);
    map.putAll(newMap);
  }
}

Fixed version (ground truth):
MergeTableMap(Map<String,Table> old,Map<String,Table> newMap){
  if (old.keySet().equals(newMap.keySet())) {
    map=newMap;
  }
 else {
    map=new HashMap<String,Table>(old);
    map.putAll(newMap);
  }
}
Program: 32377
Project: 32377
Buggy source:
public boolean add(int v){
  if (set.isFull()) {
    if (prevSets == null)     prevSets=new ArrayList<BloomFilter>(2);
    prevSets.add(set);
    int expandby=4;
    int expectedSize=set.size() * expandby;
    double bitsPerElm=set.getExpectedBitsPerElement() + 0.25;
    if (bitsPerElm > 10)     bitsPerElm=10;
    int numHash=(int)(bitsPerElm * 0.7f);
    set=new BloomFilter(bitsPerElm,expectedSize,numHash);
  }
  return set.add(v);
}

Fixed version (ground truth):
public boolean add(long v){
  if (set.isFull())   expand();
  return set.add(v);
}
Program: 32378
Project: 32378
Buggy source:
public ApproxSet(double bitsPerElem,int expectedSize,int numHash){
  set=new BloomFilter(bitsPerElem,expectedSize,numHash);
}

Fixed version (ground truth):
public ApproxSet(double bitsPerElem,int expectedSize){
  int numHash=getOptimalNumHash(bitsPerElem);
  set=new BloomFilter(bitsPerElem,expectedSize,numHash);
}
Program: 32379
Project: 32379
Buggy source:
public boolean contains(int v){
  if (set.contains(v))   return true;
  if (prevSets != null) {
    for (    BloomFilter prevSet : prevSets) {
      if (prevSet.contains(v))       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean contains(long v){
  if (set.contains(v))   return true;
  if (prevSets != null) {
    for (    BloomFilter prevSet : prevSets) {
      if (prevSet.contains(v))       return true;
    }
  }
  return false;
}
Program: 32380
Project: 32380
Buggy source:
public static void main(String[] args){
  ApproxSet set=new ApproxSet(5.0,500,3);
  for (int i=-5000; i < 5000; i++) {
    set.add(i);
  }
  int cnt=0;
  for (int i=5001; i < 105000; i++) {
    if (set.contains(i))     cnt++;
  }
  System.out.println("String_Node_Str" + cnt + "String_Node_Str"+ (cnt / 100000.0));
}

Fixed version (ground truth):
public static void main(String[] args){
  ApproxSet set=new ApproxSet(10,1024);
  for (int i=-5000; i < 5000; i++) {
    boolean added=set.add(i);
    if (!added) {
      System.out.println("String_Node_Str" + added);
    }
  }
  int cnt=0;
  for (int i=5001; i < 1005000; i++) {
    if (set.contains(i))     cnt++;
  }
  System.out.println("String_Node_Str" + cnt + "String_Node_Str"+ (cnt / 1000000.0));
}
Program: 32381
Project: 32381
Buggy source:
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeObject(bitset);
  out.writeInt(bitSetSize);
  out.writeFloat(bitsPerElement);
  out.writeInt(numOfElements);
  out.writeShort(k);
}

Fixed version (ground truth):
public void writeExternal(ObjectOutput out) throws IOException {
  out.writeObject(bitset);
  out.writeFloat(bitsPerElement);
  out.writeInt(numElements);
  out.writeShort(k);
}
Program: 32382
Project: 32382
Buggy source:
public void clear(){
  bitset.clear();
  numOfElements=0;
}

Fixed version (ground truth):
public void clear(){
  bitset.clear();
  numElements=0;
}
Program: 32383
Project: 32383
Buggy source:
public int count(){
  return this.numOfElements;
}

Fixed version (ground truth):
public int count(){
  return this.numElements;
}
Program: 32384
Project: 32384
Buggy source:
/** 
 * @param bitSetSize defines how many bits should be used in total for the filter.
 * @param expectedNum defines the maximum number of elements the filter is expected to contain.
 */
public BloomFilter(int bitSetSize,int expectedNum){
  this(bitSetSize / (float)expectedNum,expectedNum,(int)Math.round((bitSetSize / (float)expectedNum) * Math.log(2.0)));
}

Fixed version (ground truth):
public BloomFilter(double c,int n,int k){
  this((float)c,n,k);
}
Program: 32385
Project: 32385
Buggy source:
public int size(){
  return this.bitSetSize;
}

Fixed version (ground truth):
public int size(){
  return this.numElements;
}
Program: 32386
Project: 32386
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=61 * hash + (this.bitset != null ? this.bitset.hashCode() : 0);
  hash=61 * hash + this.bitSetSize;
  hash=61 * hash + this.k;
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=7;
  hash=61 * hash + (this.bitset != null ? this.bitset.hashCode() : 0);
  hash=61 * hash + this.getBitSetSize();
  hash=61 * hash + this.k;
  hash=61 * hash + HashCode.get(bitsPerElement);
  hash=61 * hash + HashCode.get(numElements);
  return hash;
}