nus-yam/ex-repair huggingface dataset:
Program: 90162
Project: 90162
Buggy source:
/** 
 * Default constructor - initializes cluster configuration and load balancer.
 * @param jobMonitor The job monitor object to use.
 * @throws CloudServiceException if there is any error in initialization
 */
public YarnJobManager(final JobMonitor jobMonitor) throws CloudServiceException {
  this.jobMonitor=jobMonitor;
}

Fixed version (ground truth):
/** 
 * Default constructor - initializes cluster configuration and load balancer.
 * @param jobMonitor The job monitor object to use.
 * @throws CloudServiceException if there is any error in initialization
 */
@Inject public YarnJobManager(final JobMonitor jobMonitor) throws CloudServiceException {
  this.jobMonitor=jobMonitor;
  this.jobMonitorThread=new Thread(this.jobMonitor);
}
Program: 90164
Project: 90164
Buggy source:
/** 
 * Kill the job pointed to by the job info - this only kills the Yarn job shell.
 * @param ji the jobInfo object for the job to be killed
 * @throws CloudServiceException if there is any error in job killing
 */
@Override public void kill(Job ji) throws CloudServiceException {
  LOG.info("String_Node_Str");
  if (ji == null) {
    String msg="String_Node_Str";
    LOG.error(msg);
    throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
  }
  this.ji=ji;
  int processId=ji.getProcessHandle();
  if (processId > 0) {
    LOG.info("String_Node_Str" + processId);
    try {
      String genieHome=ConfigurationManager.getConfigInstance().getString("String_Node_Str");
      if ((genieHome == null) || genieHome.isEmpty()) {
        String msg="String_Node_Str";
        LOG.error(msg);
        throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
      }
      Runtime.getRuntime().exec(genieHome + File.separator + "String_Node_Str"+ processId);
    }
 catch (    CloudServiceException e) {
      String msg="String_Node_Str";
      LOG.error(msg,e);
      throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg,e);
    }
catch (    IOException e) {
      String msg="String_Node_Str";
      LOG.error(msg,e);
      throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg,e);
    }
  }
 else {
    String msg="String_Node_Str";
    LOG.error(msg);
    throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
  }
}

Fixed version (ground truth):
/** 
 * Kill the job pointed to by the job info - this only kills the Yarn job shell.
 * @param job the jobInfo object for the job to be killed
 * @throws CloudServiceException if there is any error in job killing
 */
@Override public void kill(final Job job) throws CloudServiceException {
  LOG.info("String_Node_Str");
  if (job == null) {
    String msg="String_Node_Str";
    LOG.error(msg);
    throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
  }
  this.ji=job;
  int processId=job.getProcessHandle();
  if (processId > 0) {
    LOG.info("String_Node_Str" + processId);
    try {
      String genieHome=ConfigurationManager.getConfigInstance().getString("String_Node_Str");
      if ((genieHome == null) || genieHome.isEmpty()) {
        String msg="String_Node_Str";
        LOG.error(msg);
        throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
      }
      Runtime.getRuntime().exec(genieHome + File.separator + "String_Node_Str"+ processId);
    }
 catch (    final CloudServiceException e) {
      String msg="String_Node_Str";
      LOG.error(msg,e);
      throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg,e);
    }
catch (    final IOException e) {
      String msg="String_Node_Str";
      LOG.error(msg,e);
      throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg,e);
    }
  }
 else {
    String msg="String_Node_Str";
    LOG.error(msg);
    throw new CloudServiceException(HttpURLConnection.HTTP_INTERNAL_ERROR,msg);
  }
}
Program: 90166
Project: 90166
Buggy source:
/** 
 * Get the tags for this cluster criteria.
 * @return The tags for this criteria as unmodifiable list
 */
@XmlElement public Set<String> getTags(){
  return this.tags;
}

Fixed version (ground truth):
/** 
 * Get the tags for this cluster criteria.
 * @return The tags for this criteria as unmodifiable list
 */
public Set<String> getTags(){
  return this.tags;
}
Program: 90168
Project: 90168
Buggy source:
/** 
 * Insert/update command config.
 * @param id unique id for config to upsert
 * @param request contains the comamnd config element for update
 * @return successful response, or one with an HTTP error code
 */
@PUT @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response updateCommandConfig(@PathParam("String_Node_Str") String id,CommandConfigRequest request){
  LOG.info("String_Node_Str");
  CommandConfig commandConfig=request.getCommandConfig();
  if (commandConfig != null) {
    commandConfig.setId(id);
    ArrayList<String> appids=commandConfig.getAppids();
    if (appids != null) {
      PersistenceManager<ApplicationConfig> pma=new PersistenceManager<ApplicationConfig>();
      ArrayList<ApplicationConfig> appList=new ArrayList<ApplicationConfig>();
      Iterator<String> it=appids.iterator();
      while (it.hasNext()) {
        String appId=(String)it.next();
        ApplicationConfig ae=(ApplicationConfig)pma.getEntity(appId,ApplicationConfig.class);
        if (ae != null) {
          appList.add(ae);
        }
 else {
          CommandConfigResponse acr=new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str" + appId + "String_Node_Str"));
          return ResponseUtil.createResponse(acr);
        }
      }
      commandConfig.setApplications(appList);
    }
  }
  CommandConfigResponse ccr=ccs.updateCommandConfig(request);
  return ResponseUtil.createResponse(ccr);
}

Fixed version (ground truth):
/** 
 * Insert/update command config.
 * @param id unique id for config to upsert
 * @param request contains the comamnd config element for update
 * @return successful response, or one with an HTTP error code
 */
@PUT @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response updateCommandConfig(@PathParam("String_Node_Str") String id,CommandConfigRequest request){
  LOG.info("String_Node_Str");
  CommandConfig commandConfig=request.getCommandConfig();
  if (commandConfig != null) {
    commandConfig.setId(id);
    ArrayList<String> appids=commandConfig.getAppIds();
    if (appids != null) {
      PersistenceManager<ApplicationConfig> pma=new PersistenceManager<ApplicationConfig>();
      ArrayList<ApplicationConfig> appList=new ArrayList<ApplicationConfig>();
      Iterator<String> it=appids.iterator();
      while (it.hasNext()) {
        String appId=(String)it.next();
        ApplicationConfig ae=(ApplicationConfig)pma.getEntity(appId,ApplicationConfig.class);
        if (ae != null) {
          appList.add(ae);
        }
 else {
          CommandConfigResponse acr=new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str" + appId + "String_Node_Str"));
          return ResponseUtil.createResponse(acr);
        }
      }
      commandConfig.setApplications(appList);
    }
  }
  CommandConfigResponse ccr=ccs.updateCommandConfig(request);
  return ResponseUtil.createResponse(ccr);
}
Program: 90169
Project: 90169
Buggy source:
/** 
 * Create Command configuration.
 * @param request contains a command config element
 * @return successful response, or one with an HTTP error code
 */
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response createCommandConfig(CommandConfigRequest request){
  LOG.info("String_Node_Str");
  CommandConfig ce=request.getCommandConfig();
  if (ce == null) {
    return ResponseUtil.createResponse(new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str")));
  }
  ArrayList<String> appids=ce.getAppids();
  if (appids != null) {
    PersistenceManager<ApplicationConfig> pma=new PersistenceManager<ApplicationConfig>();
    ArrayList<ApplicationConfig> appList=new ArrayList<ApplicationConfig>();
    Iterator<String> it=appids.iterator();
    while (it.hasNext()) {
      String appId=(String)it.next();
      ApplicationConfig ae=(ApplicationConfig)pma.getEntity(appId,ApplicationConfig.class);
      if (ae != null) {
        appList.add(ae);
      }
 else {
        CommandConfigResponse acr=new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str" + appId + "String_Node_Str"));
        return ResponseUtil.createResponse(acr);
      }
    }
    ce.setApplications(appList);
  }
  CommandConfigResponse acr=ccs.createCommandConfig(request);
  return ResponseUtil.createResponse(acr);
}

Fixed version (ground truth):
/** 
 * Create Command configuration.
 * @param request contains a command config element
 * @return successful response, or one with an HTTP error code
 */
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public Response createCommandConfig(CommandConfigRequest request){
  LOG.info("String_Node_Str");
  CommandConfig ce=request.getCommandConfig();
  if (ce == null) {
    return ResponseUtil.createResponse(new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str")));
  }
  ArrayList<String> appids=ce.getAppIds();
  if (appids != null) {
    PersistenceManager<ApplicationConfig> pma=new PersistenceManager<ApplicationConfig>();
    ArrayList<ApplicationConfig> appList=new ArrayList<ApplicationConfig>();
    Iterator<String> it=appids.iterator();
    while (it.hasNext()) {
      String appId=(String)it.next();
      ApplicationConfig ae=(ApplicationConfig)pma.getEntity(appId,ApplicationConfig.class);
      if (ae != null) {
        appList.add(ae);
      }
 else {
        CommandConfigResponse acr=new CommandConfigResponse(new CloudServiceException(HttpURLConnection.HTTP_BAD_REQUEST,"String_Node_Str" + appId + "String_Node_Str"));
        return ResponseUtil.createResponse(acr);
      }
    }
    ce.setApplications(appList);
  }
  CommandConfigResponse acr=ccs.createCommandConfig(request);
  return ResponseUtil.createResponse(acr);
}
Program: 90171
Project: 90171
Buggy source:
/** 
 * Default constructor
 */
SMTPAuthenticator(String username,String password){
  this.username=username;
  this.password=password;
}

Fixed version (ground truth):
/** 
 * Default constructor.
 */
SMTPAuthenticator(String username,String password){
  this.username=username;
  this.password=password;
}
Program: 90173
Project: 90173
Buggy source:
/** 
 * Return a PasswordAuthentication object based on username/password
 */
public PasswordAuthentication getPasswordAuthentication(){
  return new PasswordAuthentication(username,password);
}

Fixed version (ground truth):
/** 
 * Return a PasswordAuthentication object based on username/password.
 */
public PasswordAuthentication getPasswordAuthentication(){
  return new PasswordAuthentication(username,password);
}
Program: 90174
Project: 90174
Buggy source:
/** 
 * Get the set of attachments for this job.
 * @return the set of attachments for this job
 */
public FileAttachment[] getAttachments(){
  return attachments;
}

Fixed version (ground truth):
/** 
 * Get the set of attachments for this job.
 * @return the set of attachments for this job
 */
public FileAttachment[] getAttachments(){
  if (attachments == null) {
    return null;
  }
 else {
    return Arrays.copyOf(attachments,attachments.length);
  }
}
Program: 90175
Project: 90175
Buggy source:
/** 
 * Set the attachments for this job.
 * @param attachments the attachments for this job
 */
public void setAttachments(FileAttachment[] attachments){
  this.attachments=attachments;
}

Fixed version (ground truth):
/** 
 * Set the attachments for this job.
 * @param attachments the attachments for this job
 */
public void setAttachments(FileAttachment[] attachments){
  if (attachments == null) {
    this.attachments=null;
  }
 else {
    this.attachments=Arrays.copyOf(attachments,attachments.length);
  }
}
Program: 90178
Project: 90178
Buggy source:
/** 
 * Test the counter and daemon thread that sets running job.
 * @throws InterruptedException
 * @throws CloudServiceException
 */
@Test public void testRunningJobs() throws InterruptedException, CloudServiceException {
  int numRunningJobs=JobCountManager.getNumInstanceJobs();
  stats.setGenieRunningJobs(0);
  Assert.assertEquals(stats.getGenieRunningJobs().intValue(),0);
  ConfigurationManager.getConfigInstance().setProperty("String_Node_Str",new Long(2000));
  stats.setGenieRunningJobs(5);
  Assert.assertEquals(stats.getGenieRunningJobs().intValue(),5);
  Thread.sleep(6000);
  Assert.assertEquals(numRunningJobs,stats.getGenieRunningJobs().intValue());
}

Fixed version (ground truth):
/** 
 * Test the counter and daemon thread that sets running job.
 * @throws InterruptedException
 * @throws CloudServiceException
 */
@Test public void testRunningJobs() throws InterruptedException, CloudServiceException {
  int numRunningJobs=JobCountManager.getNumInstanceJobs();
  stats.setGenieRunningJobs(0);
  Assert.assertEquals(stats.getGenieRunningJobs().intValue(),0);
  ConfigurationManager.getConfigInstance().setProperty("String_Node_Str",new Long(2000));
  stats.setGenieRunningJobs(5);
  Assert.assertEquals(stats.getGenieRunningJobs().intValue(),5);
  Thread.sleep(15000);
  Assert.assertEquals(numRunningJobs,stats.getGenieRunningJobs().intValue());
}
Program: 90179
Project: 90179
Buggy source:
/** 
 * Private constructor for singleton.
 */
private GenieNodeStatistics(){
}

Fixed version (ground truth):
/** 
 * Private constructor for singleton.
 */
private GenieNodeStatistics(){
  jobCountMonitor=new JobCountMonitor(this);
  jobCountMonitor.setDaemon(true);
  jobCountMonitor.start();
}
Program: 90180
Project: 90180
Buggy source:
/** 
 * Shut down cleanly.
 */
public void shutdown(){
  logger.info("String_Node_Str");
  Monitors.unregisterObject(this);
}

Fixed version (ground truth):
/** 
 * Shut down cleanly.
 */
public void shutdown(){
  logger.info("String_Node_Str");
  Monitors.unregisterObject(this);
  jobCountMonitor.setStop(true);
}
Program: 90181
Project: 90181
Buggy source:
@Test public void testContainsArrayContainer_ExcludeDisJointSet(){
  Container rc=new RunContainer().add(0,10);
  Container disjoint=new ArrayContainer().add(20,40);
  assertFalse(rc.contains(disjoint));
  assertFalse(disjoint.contains(rc));
}

Fixed version (ground truth):
@Test public void testContainsArrayContainer_ExcludeDisJointSet(){
  Container rc=new RunContainer().add(0,10);
  Container disjoint=new ArrayContainer().add(20,40);
  assertFalse(rc.contains(disjoint));
  assertFalse(disjoint.contains(rc));
  disjoint=new ArrayContainer().add((short)512);
  assertFalse(rc.contains(disjoint));
  assertFalse(disjoint.contains(rc));
  rc=rc.add(12,14).add(16,18).add(20,22);
  assertFalse(rc.contains(disjoint));
  assertFalse(disjoint.contains(rc));
  rc.trim();
  assertFalse(rc.contains(disjoint));
  assertFalse(disjoint.contains(rc));
}
Program: 90182
Project: 90182
Buggy source:
@Override protected boolean contains(BitmapContainer bitmapContainer){
  final int cardinality=getCardinality();
  if (bitmapContainer.getCardinality() != -1 && bitmapContainer.getCardinality() > cardinality) {
    return false;
  }
  final int runCount=numberOfRuns();
  short ib=0, ir=0;
  while (ib < bitmapContainer.bitmap.length && ir < runCount) {
    long w=bitmapContainer.bitmap[ib];
    while (w != 0 && ir < runCount) {
      short start=getValue(ir);
      int stop=start + toIntUnsigned(getLength(ir));
      long t=w & -w;
      long r=ib * 64 + Long.numberOfTrailingZeros(w);
      if (r < start) {
        return false;
      }
 else       if (r > stop) {
        ++ir;
      }
 else {
        w^=t;
      }
    }
    if (w == 0) {
      ++ib;
    }
 else {
      return false;
    }
  }
  if (ib < bitmapContainer.bitmap.length) {
    for (; ib < bitmapContainer.bitmap.length; ib++) {
      if (bitmapContainer.bitmap[ib] != 0) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean contains(BitmapContainer bitmapContainer){
  final int cardinality=getCardinality();
  if (bitmapContainer.getCardinality() != -1 && bitmapContainer.getCardinality() > cardinality) {
    return false;
  }
  final int runCount=numberOfRuns();
  short ib=0, ir=0;
  while (ib < bitmapContainer.bitmap.length && ir < runCount) {
    long w=bitmapContainer.bitmap[ib];
    while (w != 0 && ir < runCount) {
      int start=Util.toIntUnsigned(getValue(ir));
      int stop=start + toIntUnsigned(getLength(ir));
      long t=w & -w;
      long r=ib * 64 + Long.numberOfTrailingZeros(w);
      if (r < start) {
        return false;
      }
 else       if (r > stop) {
        ++ir;
      }
 else {
        w^=t;
      }
    }
    if (w == 0) {
      ++ib;
    }
 else {
      return false;
    }
  }
  if (ib < bitmapContainer.bitmap.length) {
    for (; ib < bitmapContainer.bitmap.length; ib++) {
      if (bitmapContainer.bitmap[ib] != 0) {
        return false;
      }
    }
  }
  return true;
}
Program: 90183
Project: 90183
Buggy source:
/** 
 * @param high for which high bucket should we compute the cardinality
 * @return the highest validatedIndex
 */
protected int ensureCumulatives(int high){
  if (allValid) {
    return sortedHighs.length;
  }
 else   if (compare(high,firstHighNotValid) < 0) {
    int position=binarySearch(sortedHighs,high);
    if (position >= 0) {
      return position + 1;
    }
 else {
      int insertionPosition=-position - 1;
      return insertionPosition;
    }
  }
 else {
    SortedMap<Integer,BitmapDataProvider> tailMap=highToBitmap.tailMap(firstHighNotValid,true);
    boolean earlyBreak=true;
    int indexOk=highToBitmap.size() - tailMap.size();
    Iterator<Entry<Integer,BitmapDataProvider>> it=tailMap.entrySet().iterator();
    while (it.hasNext()) {
      Entry<Integer,BitmapDataProvider> e=it.next();
      int currentHigh=e.getKey();
      if (compare(currentHigh,high) > 0) {
        earlyBreak=true;
        break;
      }
 else       if (e.getValue().isEmpty()) {
        if (latestAddedHigh != null && latestAddedHigh.getKey().intValue() == currentHigh) {
          latestAddedHigh=null;
        }
        it.remove();
      }
 else {
        ensureOne(e,currentHigh,indexOk);
        indexOk++;
      }
    }
    if (highToBitmap.isEmpty() || !earlyBreak) {
      allValid=true;
    }
    return indexOk;
  }
}

Fixed version (ground truth):
/** 
 * @param high for which high bucket should we compute the cardinality
 * @return the highest validatedIndex
 */
protected int ensureCumulatives(int high){
  if (allValid) {
    return highToBitmap.size();
  }
 else   if (compare(high,firstHighNotValid) < 0) {
    int position=binarySearch(sortedHighs,high);
    if (position >= 0) {
      return position + 1;
    }
 else {
      int insertionPosition=-position - 1;
      return insertionPosition;
    }
  }
 else {
    SortedMap<Integer,BitmapDataProvider> tailMap=highToBitmap.tailMap(firstHighNotValid,true);
    int indexOk=highToBitmap.size() - tailMap.size();
    Iterator<Entry<Integer,BitmapDataProvider>> it=tailMap.entrySet().iterator();
    while (it.hasNext()) {
      Entry<Integer,BitmapDataProvider> e=it.next();
      int currentHigh=e.getKey();
      if (compare(currentHigh,high) > 0) {
        break;
      }
 else       if (e.getValue().isEmpty()) {
        if (latestAddedHigh != null && latestAddedHigh.getKey().intValue() == currentHigh) {
          latestAddedHigh=null;
        }
        it.remove();
      }
 else {
        ensureOne(e,currentHigh,indexOk);
        indexOk++;
      }
    }
    if (highToBitmap.isEmpty() || indexOk == highToBitmap.values().size()) {
      allValid=true;
    }
    return indexOk;
  }
}
Program: 90184
Project: 90184
Buggy source:
/** 
 * Return the jth value stored in this bitmap.
 * @param j index of the value
 * @return the value
 */
@Override public long select(final long j){
  if (!doCacheCardinalities) {
    return selectNoCache(j);
  }
  int indexOk=ensureCumulatives(highestHigh());
  if (highToBitmap.isEmpty()) {
    return throwSelectInvalidIndex(j);
  }
  int position=Arrays.binarySearch(sortedCumulatedCardinality,0,indexOk,j);
  if (position >= 0) {
    if (position == indexOk - 1) {
      return throwSelectInvalidIndex(j);
    }
    int high=sortedHighs[position + 1];
    BitmapDataProvider nextBitmap=highToBitmap.get(high);
    return RoaringIntPacking.pack(high,nextBitmap.select(0));
  }
 else {
    int insertionPoint=-position - 1;
    final long previousBucketCardinality;
    if (insertionPoint == 0) {
      previousBucketCardinality=0L;
    }
 else     if (insertionPoint >= indexOk) {
      return throwSelectInvalidIndex(j);
    }
 else {
      previousBucketCardinality=sortedCumulatedCardinality[insertionPoint - 1];
    }
    final int givenBitmapSelect=(int)(j - previousBucketCardinality);
    int high=sortedHighs[insertionPoint];
    BitmapDataProvider lowBitmap=highToBitmap.get(high);
    int low=lowBitmap.select(givenBitmapSelect);
    return RoaringIntPacking.pack(high,low);
  }
}

Fixed version (ground truth):
/** 
 * Return the jth value stored in this bitmap.
 * @param j index of the value
 * @return the value
 * @throws IllegalArgumentException if j is out of the bounds of the bitmap cardinality
 */
@Override public long select(final long j) throws IllegalArgumentException {
  if (!doCacheCardinalities) {
    return selectNoCache(j);
  }
  int indexOk=ensureCumulatives(highestHigh());
  if (highToBitmap.isEmpty()) {
    return throwSelectInvalidIndex(j);
  }
  int position=Arrays.binarySearch(sortedCumulatedCardinality,0,indexOk,j);
  if (position >= 0) {
    if (position == indexOk - 1) {
      return throwSelectInvalidIndex(j);
    }
    int high=sortedHighs[position + 1];
    BitmapDataProvider nextBitmap=highToBitmap.get(high);
    return RoaringIntPacking.pack(high,nextBitmap.select(0));
  }
 else {
    int insertionPoint=-position - 1;
    final long previousBucketCardinality;
    if (insertionPoint == 0) {
      previousBucketCardinality=0L;
    }
 else     if (insertionPoint >= indexOk) {
      return throwSelectInvalidIndex(j);
    }
 else {
      previousBucketCardinality=sortedCumulatedCardinality[insertionPoint - 1];
    }
    final int givenBitmapSelect=(int)(j - previousBucketCardinality);
    int high=sortedHighs[insertionPoint];
    BitmapDataProvider lowBitmap=highToBitmap.get(high);
    int low=lowBitmap.select(givenBitmapSelect);
    return RoaringIntPacking.pack(high,low);
  }
}
Program: 90185
Project: 90185
Buggy source:
protected void ensureCumulatives(int x){
}

Fixed version (ground truth):
protected void ensureCumulatives(int high){
}
Program: 90186
Project: 90186
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeObject(hiToBitmap);
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeObject(highToBitmap);
}
Program: 90187
Project: 90187
Buggy source:
private long pack(int x,int y){
  return (((long)x) << 32) | (y & 0xffffffffL);
}

Fixed version (ground truth):
private long pack(int high,int low){
  return (((long)high) << 32) | (low & 0xffffffffL);
}
Program: 90188
Project: 90188
Buggy source:
public long getCardinality(){
  if (hiToBitmap.isEmpty()) {
    return 0L;
  }
  ensureCumulatives(Integer.MAX_VALUE);
  return sortedCumulatedCardinality[sortedCumulatedCardinality.length - 1];
}

Fixed version (ground truth):
public long getCardinality(){
  if (highToBitmap.isEmpty()) {
    return 0L;
  }
  ensureCumulatives(Integer.MAX_VALUE);
  return sortedCumulatedCardinality[sortedCumulatedCardinality.length - 1];
}
Program: 90189
Project: 90189
Buggy source:
public LongIterator iterator(){
  final Iterator<Map.Entry<Integer,MutableRoaringBitmap>> it=hiToBitmap.entrySet().iterator();
  return new LongIterator(){
    protected int currentKey;
    protected IntIterator currentIt;
    @Override public boolean hasNext(){
      if (currentIt == null) {
        if (!moveToNextEntry(it)) {
          return false;
        }
      }
      while (true) {
        if (currentIt.hasNext()) {
          return true;
        }
 else {
          if (!moveToNextEntry(it)) {
            return false;
          }
        }
      }
    }
    /** 
 * @param it
 * @return true if we MAY have more entries. false if there is definitely nothing more
 */
    private boolean moveToNextEntry(    Iterator<Map.Entry<Integer,MutableRoaringBitmap>> it){
      if (it.hasNext()) {
        Map.Entry<Integer,MutableRoaringBitmap> next=it.next();
        currentKey=next.getKey();
        currentIt=next.getValue().getIntIterator();
        return true;
      }
 else {
        return false;
      }
    }
    @Override public long next(){
      if (hasNext()) {
        return pack(currentKey,currentIt.next());
      }
 else {
        throw new IllegalStateException("String_Node_Str");
      }
    }
    @Override public LongIterator clone(){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
public LongIterator iterator(){
  final Iterator<Map.Entry<Integer,MutableRoaringBitmap>> it=highToBitmap.entrySet().iterator();
  return new LongIterator(){
    protected int currentKey;
    protected IntIterator currentIt;
    @Override public boolean hasNext(){
      if (currentIt == null) {
        if (!moveToNextEntry(it)) {
          return false;
        }
      }
      while (true) {
        if (currentIt.hasNext()) {
          return true;
        }
 else {
          if (!moveToNextEntry(it)) {
            return false;
          }
        }
      }
    }
    /** 
 * @param it
 * @return true if we MAY have more entries. false if there is definitely nothing more
 */
    private boolean moveToNextEntry(    Iterator<Map.Entry<Integer,MutableRoaringBitmap>> it){
      if (it.hasNext()) {
        Map.Entry<Integer,MutableRoaringBitmap> next=it.next();
        currentKey=next.getKey();
        currentIt=next.getValue().getIntIterator();
        return true;
      }
 else {
        return false;
      }
    }
    @Override public long next(){
      if (hasNext()) {
        return pack(currentKey,currentIt.next());
      }
 else {
        throw new IllegalStateException("String_Node_Str");
      }
    }
    @Override public LongIterator clone(){
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
;
}
Program: 90190
Project: 90190
Buggy source:
public long rankLong(long id){
  int x=(int)(id >> 32);
  int y=(int)id;
  ensureCumulatives(x);
  int bitmapPosition=Arrays.binarySearch(sortedHighs,0,sortedHighs.length,x);
  if (bitmapPosition >= 0) {
    final long previousBucketCardinality;
    if (bitmapPosition == 0) {
      previousBucketCardinality=0;
    }
 else {
      previousBucketCardinality=sortedCumulatedCardinality[bitmapPosition - 1];
    }
    MutableRoaringBitmap bitmap=linkedBitmaps.get(bitmapPosition);
    return previousBucketCardinality + bitmap.rankLong(y);
  }
 else {
    int insertionPoint=-bitmapPosition - 1;
    if (insertionPoint == 0) {
      return 0;
    }
 else {
      return sortedCumulatedCardinality[insertionPoint - 1];
    }
  }
}

Fixed version (ground truth):
public long rankLong(long id){
  int high=(int)(id >> 32);
  int low=(int)id;
  ensureCumulatives(high);
  int bitmapPosition=Arrays.binarySearch(sortedHighs,0,sortedHighs.length,high);
  if (bitmapPosition >= 0) {
    final long previousBucketCardinality;
    if (bitmapPosition == 0) {
      previousBucketCardinality=0;
    }
 else {
      previousBucketCardinality=sortedCumulatedCardinality[bitmapPosition - 1];
    }
    MutableRoaringBitmap bitmap=linkedBitmaps.get(bitmapPosition);
    return previousBucketCardinality + bitmap.rankLong(low);
  }
 else {
    int insertionPoint=-bitmapPosition - 1;
    if (insertionPoint == 0) {
      return 0;
    }
 else {
      return sortedCumulatedCardinality[insertionPoint - 1];
    }
  }
}
Program: 90191
Project: 90191
Buggy source:
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  hiToBitmap=(NavigableMap<Integer,MutableRoaringBitmap>)in.readObject();
}

Fixed version (ground truth):
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  highToBitmap=(NavigableMap<Integer,MutableRoaringBitmap>)in.readObject();
}
Program: 90192
Project: 90192
Buggy source:
public void addLong(long id){
  int x=(int)(id >> 32);
  int y=(int)id;
  Map.Entry<Integer,MutableRoaringBitmap> local=latest;
  if (local != null && local.getKey().intValue() == x) {
    local.getValue().add(y);
  }
 else {
    MutableRoaringBitmap bitmap=hiToBitmap.get(x);
    if (bitmap == null) {
      bitmap=new MutableRoaringBitmap();
      hiToBitmap.put(x,bitmap);
    }
    bitmap.add(y);
    latest=new AbstractMap.SimpleImmutableEntry<>(x,bitmap);
  }
  firstHighNotValid=Math.min(firstHighNotValid,x);
}

Fixed version (ground truth):
public void addLong(long id){
  int high=(int)(id >> 32);
  int low=(int)id;
  Map.Entry<Integer,MutableRoaringBitmap> local=latest;
  if (local != null && local.getKey().intValue() == high) {
    local.getValue().add(low);
  }
 else {
    MutableRoaringBitmap bitmap=highToBitmap.get(high);
    if (bitmap == null) {
      bitmap=new MutableRoaringBitmap();
      highToBitmap.put(high,bitmap);
    }
    bitmap.add(low);
    latest=new AbstractMap.SimpleImmutableEntry<>(high,bitmap);
  }
  firstHighNotValid=Math.min(firstHighNotValid,high);
  allValid=false;
}
Program: 90193
Project: 90193
Buggy source:
@Test public void testAddingLowValueAfterHighValue(){
  RoaringTreeMap map=new RoaringTreeMap();
  map.addLong(Long.MAX_VALUE);
  Assert.assertEquals(Long.MAX_VALUE,map.select(0));
  map.addLong(666);
  Assert.assertEquals(666,map.select(0));
  Assert.assertEquals(Long.MAX_VALUE,map.select(0));
}

Fixed version (ground truth):
@Test public void testAddingLowValueAfterHighValue(){
  RoaringTreeMap map=new RoaringTreeMap();
  map.addLong(Long.MAX_VALUE);
  Assert.assertEquals(Long.MAX_VALUE,map.select(0));
  map.addLong(666);
  Assert.assertEquals(666,map.select(0));
  Assert.assertEquals(Long.MAX_VALUE,map.select(1));
}
Program: 90194
Project: 90194
Buggy source:
/** 
 * @param high for which high bucket should we compute the cardinality
 * @return the highest validatedIndex
 */
protected int ensureCumulatives(int high){
  if (allValid) {
    return sortedHighs.length;
  }
 else   if (compare(high,firstHighNotValid) < 0) {
    int position=binarySearch(sortedHighs,high);
    if (position >= 0) {
      return position + 1;
    }
 else {
      int insertionPosition=-position - 1;
      return insertionPosition;
    }
  }
 else {
    SortedMap<Integer,BitmapDataProvider> tailMap=highToBitmap.tailMap(firstHighNotValid,true);
    int indexOk=highToBitmap.size() - tailMap.size();
    for (    Map.Entry<Integer,BitmapDataProvider> e : tailMap.entrySet()) {
      int currentHigh=e.getKey();
      if (compare(currentHigh,high) > 0) {
        break;
      }
      ensureOne(e,currentHigh,indexOk);
      indexOk++;
    }
    if (highToBitmap.isEmpty() || high == highToBitmap.lastKey().intValue()) {
      allValid=true;
    }
    return indexOk;
  }
}

Fixed version (ground truth):
/** 
 * @param high for which high bucket should we compute the cardinality
 * @return the highest validatedIndex
 */
protected int ensureCumulatives(int high){
  if (allValid) {
    return sortedHighs.length;
  }
 else   if (compare(high,firstHighNotValid) < 0) {
    int position=binarySearch(sortedHighs,high);
    if (position >= 0) {
      return position + 1;
    }
 else {
      int insertionPosition=-position - 1;
      return insertionPosition;
    }
  }
 else {
    SortedMap<Integer,BitmapDataProvider> tailMap=highToBitmap.tailMap(firstHighNotValid,true);
    boolean earlyBreak=true;
    int indexOk=highToBitmap.size() - tailMap.size();
    Iterator<Entry<Integer,BitmapDataProvider>> it=tailMap.entrySet().iterator();
    while (it.hasNext()) {
      Entry<Integer,BitmapDataProvider> e=it.next();
      int currentHigh=e.getKey();
      if (compare(currentHigh,high) > 0) {
        earlyBreak=true;
        break;
      }
 else       if (e.getValue().isEmpty()) {
        int sizeBefore=highToBitmap.size();
        it.remove();
        System.arraycopy(sortedCumulatedCardinality,indexOk + 1,sortedCumulatedCardinality,indexOk,sizeBefore - indexOk);
        System.arraycopy(sortedHighs,indexOk + 1,sortedHighs,indexOk,sizeBefore=indexOk);
        lowBitmaps.remove(indexOk);
      }
 else {
        ensureOne(e,currentHigh,indexOk);
        indexOk++;
      }
    }
    if (highToBitmap.isEmpty() || !earlyBreak) {
      allValid=true;
    }
    return indexOk;
  }
}
Program: 90195
Project: 90195
Buggy source:
@Ignore("String_Node_Str") @Test public void testRemove(){
  Roaring64NavigableMap map=new Roaring64NavigableMap();
  map.addLong(123);
  Assert.assertEquals(1L,map.getLongCardinality());
  map.remove(123L);
  Assert.assertEquals(0L,map.getLongCardinality());
  map.addLong(123);
  Assert.assertEquals(1L,map.getLongCardinality());
}

Fixed version (ground truth):
@Test public void testRemove(){
  Roaring64NavigableMap map=new Roaring64NavigableMap();
  map.addLong(123);
  Assert.assertEquals(1L,map.getLongCardinality());
  map.remove(123L);
  Assert.assertEquals(0L,map.getLongCardinality());
  map.addLong(123);
  Assert.assertEquals(1L,map.getLongCardinality());
}
Program: 90196
Project: 90196
Buggy source:
@Ignore("String_Node_Str") @Test public void testCardinalityAboveIntegerMaxValue(){
  Roaring64NavigableMap map=new Roaring64NavigableMap();
  map.add(0,outOfRoaringBitmapRange);
  Assert.assertEquals(0,map.select(0));
  Assert.assertEquals(outOfRoaringBitmapRange,map.select(outOfRoaringBitmapRange - 1));
  Assert.assertEquals(outOfRoaringBitmapRange,map.getLongCardinality());
}

Fixed version (ground truth):
@Test public void testCardinalityAboveIntegerMaxValue(){
  Roaring64NavigableMap map=new Roaring64NavigableMap();
  map.add(0,outOfRoaringBitmapRange);
  Assert.assertEquals(0,map.select(0));
  Assert.assertEquals(outOfRoaringBitmapRange,map.select(outOfRoaringBitmapRange - 1));
  Assert.assertEquals(outOfRoaringBitmapRange,map.getLongCardinality());
}
Program: 90197
Project: 90197
Buggy source:
@Override public int rank(short lowbits){
  int x=Util.toIntUnsigned(lowbits);
  int answer=0;
  for (int k=0; k < this.nbrruns; ++k) {
    int value=Util.toIntUnsigned(getValue(k));
    int length=Util.toIntUnsigned(getLength(k));
    if (x < value) {
      return answer;
    }
 else     if (value + length + 1 >= x) {
      return answer + x - value + 1;
    }
    answer+=length + 1;
  }
  return answer;
}

Fixed version (ground truth):
@Override public int rank(short lowbits){
  int x=Util.toIntUnsigned(lowbits);
  int answer=0;
  for (int k=0; k < this.nbrruns; ++k) {
    int value=Util.toIntUnsigned(getValue(k));
    int length=Util.toIntUnsigned(getLength(k));
    if (x < value) {
      return answer;
    }
 else     if (value + length + 1 > x) {
      return answer + x - value + 1;
    }
    answer+=length + 1;
  }
  return answer;
}
Program: 90198
Project: 90198
Buggy source:
public void shortRangeRank(){
  Container container=new RunContainer();
  container=container.add(16,32);
  assertTrue(container instanceof RunContainer);
  assertEquals(16,container.rank((short)32));
}

Fixed version (ground truth):
@Test public void shortRangeRank(){
  Container container=new RunContainer();
  container=container.add(16,32);
  assertTrue(container instanceof RunContainer);
  assertEquals(16,container.rank((short)32));
}
Program: 90199
Project: 90199
Buggy source:
/** 
 * Modifies the current bitmap by complementing the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive).
 * @param rangeStart inclusive beginning of range
 * @param rangeEnd exclusive ending of range
 * @deprecated use the version where longs specify the range
 */
@Deprecated public void flip(final int rangeStart,final int rangeEnd){
  if (rangeStart >= 0) {
    flip((long)rangeStart,(long)rangeEnd);
  }
  flip(rangeStart & 0xFFFFFFFFL,rangeEnd & 0xFFFFFFFFL);
}

Fixed version (ground truth):
/** 
 * Modifies the current bitmap by complementing the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive).
 * @param rangeStart inclusive beginning of range
 * @param rangeEnd exclusive ending of range
 * @deprecated use the version where longs specify the range
 */
@Deprecated public void flip(final int rangeStart,final int rangeEnd){
  if (rangeStart >= 0) {
    flip((long)rangeStart,(long)rangeEnd);
  }
 else {
    flip(rangeStart & 0xFFFFFFFFL,rangeEnd & 0xFFFFFFFFL);
  }
}
Program: 90200
Project: 90200
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testDeprecatedStaticFlip(){
  RoaringBitmap rb1=new RoaringBitmap();
  RoaringBitmap.flip(rb1,300000,500000);
  RoaringBitmap rb2=new RoaringBitmap();
  RoaringBitmap.flip(rb2,300000L,500000L);
  assertTrue(rb1.equals(rb2));
  RoaringBitmap.flip(rb1,Integer.MAX_VALUE + 300000,Integer.MAX_VALUE + 500000);
  RoaringBitmap.flip(rb2,Integer.MAX_VALUE + 300000L,Integer.MAX_VALUE + 500000L);
  assertTrue(rb1.equals(rb2));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testDeprecatedStaticFlip(){
  RoaringBitmap rb1=RoaringBitmap.flip(new RoaringBitmap(),300000,500000);
  RoaringBitmap rb2=RoaringBitmap.flip(new RoaringBitmap(),300000L,500000L);
  assertTrue(rb1.equals(rb2));
  rb1=RoaringBitmap.flip(rb1,Integer.MAX_VALUE + 300000,Integer.MAX_VALUE + 500000);
  rb2=RoaringBitmap.flip(rb2,Integer.MAX_VALUE + 300000L,Integer.MAX_VALUE + 500000L);
  assertTrue(rb1.equals(rb2));
}
Program: 90202
Project: 90202
Buggy source:
/** 
 * flip bits at start, start+1,..., end-1
 * @param bitmap array of words to be modified
 * @param start first index to be modified (inclusive)
 * @param end last index to be modified (exclusive)
 */
public static void flipBitmapRange(long[] bitmap,int start,int end){
  if (start == end) {
    return;
  }
  int firstword=start / 64;
  int endword=(end - 1) / 64;
  bitmap[firstword]^=~(~0L << start);
  ;
  for (int i=firstword; i < endword; i++) {
    bitmap[i]=~bitmap[i];
  }
  bitmap[endword]^=~0L >>> -end;
}

Fixed version (ground truth):
/** 
 * flip bits at start, start+1,..., end-1
 * @param bitmap array of words to be modified
 * @param start first index to be modified (inclusive)
 * @param end last index to be modified (exclusive)
 */
public static void flipBitmapRange(long[] bitmap,int start,int end){
  if (start == end) {
    return;
  }
  int firstword=start / 64;
  int endword=(end - 1) / 64;
  bitmap[firstword]^=~(~0L << start);
  for (int i=firstword; i < endword; i++) {
    bitmap[i]=~bitmap[i];
  }
  bitmap[endword]^=~0L >>> -end;
}
Program: 90203
Project: 90203
Buggy source:
protected static int unsignedLocalIntersect2by2Cardinality(final ShortBuffer set1,final int length1,final ShortBuffer set2,final int length2){
  if ((0 == length1) || (0 == length2)) {
    return 0;
  }
  int k1=0;
  int k2=0;
  int pos=0;
  short s1=set1.get(k1);
  short s2=set2.get(k2);
  mainwhile:   while (true) {
    if (toIntUnsigned(s2) < toIntUnsigned(s1)) {
      do {
        ++k2;
        if (k2 == length2) {
          break mainwhile;
        }
        s2=set2.get(k2);
      }
 while (toIntUnsigned(s2) < toIntUnsigned(s1));
    }
    if (toIntUnsigned(s1) < toIntUnsigned(s2)) {
      do {
        ++k1;
        if (k1 == length1) {
          break mainwhile;
        }
        s1=set1.get(k1);
      }
 while (toIntUnsigned(s1) < toIntUnsigned(s2));
    }
 else {
      ++k1;
      if (k1 == length1) {
        break;
      }
      s1=set1.get(k1);
      ++k2;
      if (k2 == length2) {
        break;
      }
      s2=set2.get(k2);
    }
  }
  return pos;
}

Fixed version (ground truth):
protected static int unsignedLocalIntersect2by2Cardinality(final ShortBuffer set1,final int length1,final ShortBuffer set2,final int length2){
  if ((0 == length1) || (0 == length2)) {
    return 0;
  }
  int k1=0;
  int k2=0;
  int pos=0;
  short s1=set1.get(k1);
  short s2=set2.get(k2);
  mainwhile:   while (true) {
    if (toIntUnsigned(s2) < toIntUnsigned(s1)) {
      do {
        ++k2;
        if (k2 == length2) {
          break mainwhile;
        }
        s2=set2.get(k2);
      }
 while (toIntUnsigned(s2) < toIntUnsigned(s1));
    }
    if (toIntUnsigned(s1) < toIntUnsigned(s2)) {
      do {
        ++k1;
        if (k1 == length1) {
          break mainwhile;
        }
        s1=set1.get(k1);
      }
 while (toIntUnsigned(s1) < toIntUnsigned(s2));
    }
 else {
      ++pos;
      ++k1;
      if (k1 == length1) {
        break;
      }
      s1=set1.get(k1);
      ++k2;
      if (k2 == length2) {
        break;
      }
      s2=set2.get(k2);
    }
  }
  return pos;
}
Program: 90204
Project: 90204
Buggy source:
/** 
 * Test massive or.
 */
@Test public void testMassiveXOr(){
  System.out.println("String_Node_Str");
  final int N=128;
  for (int howmany=512; howmany <= 1000000; howmany*=2) {
    RoaringBitmap[] ewah=new RoaringBitmap[N];
    for (int k=0; k < ewah.length; ++k) {
      ewah[k]=new RoaringBitmap();
    }
    for (int k=0; k < howmany; ++k) {
      ewah[Math.abs(k + 2 * k * k) % ewah.length].add(k);
    }
    for (int k=3; k < ewah.length; k+=3) {
      ewah[k].flip(13,howmany / 2);
    }
    RoaringBitmap answer=ewah[0];
    for (int k=1; k < ewah.length; ++k) {
      answer=RoaringBitmap.xor(answer,ewah[k]);
    }
    RoaringBitmap answer2=FastAggregation.xor(ewah);
    RoaringBitmap answer3=FastAggregation.horizontal_xor(ewah);
    Assert.assertTrue(answer.equals(answer2));
    Assert.assertTrue(answer.equals(answer3));
  }
}

Fixed version (ground truth):
/** 
 * Test massive xor.
 */
@Test public void testMassiveXOr(){
  System.out.println("String_Node_Str");
  final int N=128;
  for (int howmany=512; howmany <= 1000000; howmany*=2) {
    RoaringBitmap[] ewah=new RoaringBitmap[N];
    for (int k=0; k < ewah.length; ++k) {
      ewah[k]=new RoaringBitmap();
    }
    for (int k=0; k < howmany; ++k) {
      ewah[Math.abs(k + 2 * k * k) % ewah.length].add(k);
    }
    for (int k=3; k < ewah.length; k+=3) {
      ewah[k].flip(13,howmany / 2);
    }
    RoaringBitmap answer=ewah[0];
    for (int k=1; k < ewah.length; ++k) {
      answer=RoaringBitmap.xor(answer,ewah[k]);
    }
    RoaringBitmap rb1=RoaringBitmap.bitmapOf(randomlists[0]);
    RoaringBitmap rb2=RoaringBitmap.bitmapOf(randomlists[1]);
    RoaringBitmap rxor=FastAggregation.xor(rb1,rb2);
    RoaringBitmap answer2=FastAggregation.xor(ewah);
    RoaringBitmap answer3=FastAggregation.horizontal_xor(ewah);
    Assert.assertTrue(answer.equals(answer2));
    Assert.assertTrue(answer.equals(answer3));
    Assert.assertTrue(rxor.equals(FastAggregation.priorityqueue_xor(rb1,rb2)));
  }
}
Program: 90205
Project: 90205
Buggy source:
/** 
 * Test massive or.
 */
@Test public void testMassiveOr(){
  System.out.println("String_Node_Str");
  final int N=128;
  for (int howmany=512; howmany <= 1000000; howmany*=2) {
    RoaringBitmap[] ewah=new RoaringBitmap[N];
    for (int k=0; k < ewah.length; ++k) {
      ewah[k]=new RoaringBitmap();
    }
    for (int k=0; k < howmany; ++k) {
      ewah[Math.abs(k + 2 * k * k) % ewah.length].add(k);
    }
    for (int k=3; k < ewah.length; k+=3) {
      ewah[k].flip(13,howmany / 2);
    }
    RoaringBitmap answer=ewah[0];
    for (int k=1; k < ewah.length; ++k) {
      answer=RoaringBitmap.or(answer,ewah[k]);
    }
    RoaringBitmap answer2=FastAggregation.or(ewah);
    RoaringBitmap answer3=FastAggregation.horizontal_or(ewah);
    RoaringBitmap answer3b=FastAggregation.or(toIterator(ewah));
    Assert.assertTrue(answer.equals(answer2));
    Assert.assertTrue(answer.equals(answer3));
    Assert.assertTrue(answer.equals(answer3b));
  }
}

Fixed version (ground truth):
/** 
 * Test massive or.
 */
@Test public void testMassiveOr(){
  System.out.println("String_Node_Str");
  final int N=128;
  for (int howmany=512; howmany <= 1000000; howmany*=2) {
    RoaringBitmap[] ewah=new RoaringBitmap[N];
    for (int k=0; k < ewah.length; ++k) {
      ewah[k]=new RoaringBitmap();
    }
    for (int k=0; k < howmany; ++k) {
      ewah[Math.abs(k + 2 * k * k) % ewah.length].add(k);
    }
    for (int k=3; k < ewah.length; k+=3) {
      ewah[k].flip(13,howmany / 2);
    }
    RoaringBitmap answer=ewah[0];
    for (int k=1; k < ewah.length; ++k) {
      answer=RoaringBitmap.or(answer,ewah[k]);
    }
    RoaringBitmap rb1=RoaringBitmap.bitmapOf(randomlists[0]);
    RoaringBitmap rb2=RoaringBitmap.bitmapOf(randomlists[1]);
    List<RoaringBitmap> rbl=new ArrayList<>();
    rbl.add(rb1);
    rbl.add(rb2);
    ArrayList<RoaringBitmap> arrayList=new ArrayList<>();
    arrayList.add(rb1);
    arrayList.add(rb2);
    Iterator<RoaringBitmap> rbi=arrayList.iterator();
    RoaringBitmap rbor=RoaringBitmap.or(rb1,rb2);
    RoaringBitmap answer2=FastAggregation.or(ewah);
    RoaringBitmap answer3=FastAggregation.horizontal_or(ewah);
    RoaringBitmap answer3b=FastAggregation.or(toIterator(ewah));
    Assert.assertTrue(answer.equals(answer2));
    Assert.assertTrue(answer.equals(answer3));
    Assert.assertTrue(answer.equals(answer3b));
    Assert.assertTrue(rbor.equals(FastAggregation.horizontal_or(rbl)));
    Assert.assertTrue(rbor.equals(FastAggregation.priorityqueue_or(rb1,rb2)));
    Assert.assertTrue(rbor.equals(FastAggregation.priorityqueue_or(rbi)));
  }
}
Program: 90206
Project: 90206
Buggy source:
/** 
 * @deprecated use the version where longs specify the range
 */
@Deprecated public void add(final int rangeStart,final int rangeEnd){
  if (rangeStart >= 0) {
    add((long)rangeStart,(long)rangeEnd);
  }
  add(rangeStart & 0xFFFFFFFFL,rangeEnd & 0xFFFFFFFFL);
}

Fixed version (ground truth):
/** 
 * Add to the current bitmap all integers in [rangeStart,rangeEnd).
 * @param rangeStart inclusive beginning of range
 * @param rangeEnd exclusive ending of range
 * @deprecated use the version where longs specify the range
 */
@Deprecated public void add(final int rangeStart,final int rangeEnd){
  if (rangeStart >= 0) {
    add((long)rangeStart,(long)rangeEnd);
  }
  add(rangeStart & 0xFFFFFFFFL,rangeEnd & 0xFFFFFFFFL);
}
Program: 90207
Project: 90207
Buggy source:
/** 
 * @deprecated use the version where longs specify the range. Negative values for rangeendpoints are not allowed.
 */
@Deprecated public static RoaringBitmap andNot(final RoaringBitmap x1,final RoaringBitmap x2,final int rangeStart,final int rangeEnd){
  return andNot(x1,x2,(long)rangeStart,(long)rangeEnd);
}

Fixed version (ground truth):
/** 
 * Bitwise ANDNOT (difference) operation for the given range, rangeStart (inclusive) and rangeEnd (exclusive). The provided bitmaps are *not* modified. This operation is thread-safe as long as the provided bitmaps remain unchanged.
 * @param x1 first bitmap
 * @param x2 other bitmap
 * @param rangeStart starting point of the range (inclusive)
 * @param rangeEnd end point of the range (exclusive)
 * @return result of the operation
 * @deprecated use the version where longs specify the range. Negative values for rangeendpoints are not allowed.
 */
@Deprecated public static RoaringBitmap andNot(final RoaringBitmap x1,final RoaringBitmap x2,final int rangeStart,final int rangeEnd){
  return andNot(x1,x2,(long)rangeStart,(long)rangeEnd);
}
Program: 90208
Project: 90208
Buggy source:
/** 
 * @deprecated use the version where longs specify the range. Negative range end are illegal.
 */
@Deprecated public static RoaringBitmap and(@SuppressWarnings("String_Node_Str") final Iterator bitmaps,final int rangeStart,final int rangeEnd){
  return and(bitmaps,(long)rangeStart,(long)rangeEnd);
}

Fixed version (ground truth):
/** 
 * Computes AND between input bitmaps in the given range, from rangeStart (inclusive) to rangeEnd (exclusive)
 * @param bitmaps input bitmaps, these are not modified
 * @param rangeStart inclusive beginning of range
 * @param rangeEnd exclusive ending of range
 * @return new result bitmap
 * @deprecated use the version where longs specify the range. Negative range end are illegal.
 */
@Deprecated public static RoaringBitmap and(@SuppressWarnings("String_Node_Str") final Iterator bitmaps,final int rangeStart,final int rangeEnd){
  return and(bitmaps,(long)rangeStart,(long)rangeEnd);
}