nus-yam/ex-repair huggingface dataset:
Program: 109051
Project: 109051
Buggy source:
/** 
 * Initializes the configuration
 * @param manager
 */
protected void initialize(DataManager manager){
  this.requirements=0x0;
  for (  PrivacyCriterion c : criteria) {
    c.initialize(manager);
    this.requirements|=c.getRequirements();
  }
  absMaxOutliers=(int)Math.floor(this.relMaxOutliers * (double)manager.getDataQI().getDataLength());
  List<PrivacyCriterion> list=new ArrayList<PrivacyCriterion>();
  if (this.containsCriterion(DPresence.class)) {
    list.add(this.getCriterion(DPresence.class));
  }
  if (this.containsCriterion(LDiversity.class)) {
    list.add(this.getCriterion(LDiversity.class));
  }
  if (this.containsCriterion(TCloseness.class)) {
    list.add(this.getCriterion(TCloseness.class));
  }
  this.optimizedCriteria=list.toArray(new PrivacyCriterion[0]);
  if (this.containsCriterion(KAnonymity.class)) {
    list.add(0,this.getCriterion(KAnonymity.class));
    this.criteria=list.toArray(new PrivacyCriterion[0]);
  }
  this.snapshotLength=2;
  if (this.requires(REQUIREMENT_DISTRIBUTION)) {
    this.snapshotLength+=2;
  }
  if (this.requires(REQUIREMENT_SECONDARY_COUNTER)) {
    this.snapshotLength+=1;
  }
}

Fixed version (ground truth):
/** 
 * Initializes the configuration
 * @param manager
 */
protected void initialize(DataManager manager){
  if (criteria.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  this.requirements=0x0;
  for (  PrivacyCriterion c : criteria) {
    c.initialize(manager);
    this.requirements|=c.getRequirements();
  }
  absMaxOutliers=(int)Math.floor(this.relMaxOutliers * (double)manager.getDataQI().getDataLength());
  List<PrivacyCriterion> list=new ArrayList<PrivacyCriterion>();
  if (this.containsCriterion(DPresence.class)) {
    list.add(this.getCriterion(DPresence.class));
  }
  if (this.containsCriterion(LDiversity.class)) {
    list.add(this.getCriterion(LDiversity.class));
  }
  if (this.containsCriterion(TCloseness.class)) {
    list.add(this.getCriterion(TCloseness.class));
  }
  this.aCriteria=list.toArray(new PrivacyCriterion[0]);
  this.snapshotLength=2;
  if (this.requires(REQUIREMENT_DISTRIBUTION)) {
    this.snapshotLength+=2;
  }
  if (this.requires(REQUIREMENT_SECONDARY_COUNTER)) {
    this.snapshotLength+=1;
  }
}
Program: 109052
Project: 109052
Buggy source:
/** 
 * Creates a new instance of the ARX algorithm.
 * @param lattice The lattice
 * @param history The history
 * @param checker The checker
 * @param metric The metric
 */
public FLASHAlgorithm(final Lattice lattice,final INodeChecker checker,final FLASHStrategy metric){
  super(lattice,checker);
  strategy=metric;
  pqueue=new PriorityQueue<Node>(11,strategy);
  sorted=new boolean[lattice.getSize()];
  path=new ArrayList<Node>();
  stack=new Stack<Node>();
  this.history=checker.getHistory();
  if ((checker.getConfiguration().getAbsoluteMaxOutliers() == 0) || (checker.getConfiguration().isCriterionMonotonic() && checker.getMetric().isMonotonic()) || (checker.getConfiguration().isPracticalMonotonicity())) {
    traverseType=TraverseType.FIRST_PHASE_ONLY;
    history.setPruningStrategy(PruningStrategy.ANONYMOUS);
  }
 else {
    if (checker.getConfiguration().containsCriterion(KAnonymity.class)) {
      traverseType=TraverseType.FIRST_AND_SECOND_PHASE;
      history.setPruningStrategy(PruningStrategy.K_ANONYMOUS);
    }
 else {
      traverseType=TraverseType.SECOND_PHASE_ONLY;
      history.setPruningStrategy(PruningStrategy.CHECKED);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the ARX algorithm.
 * @param lattice The lattice
 * @param history The history
 * @param checker The checker
 * @param metric The metric
 */
public FLASHAlgorithm(final Lattice lattice,final INodeChecker checker,final FLASHStrategy metric){
  super(lattice,checker);
  strategy=metric;
  pqueue=new PriorityQueue<Node>(11,strategy);
  sorted=new boolean[lattice.getSize()];
  path=new ArrayList<Node>();
  stack=new Stack<Node>();
  this.history=checker.getHistory();
  if ((checker.getConfiguration().getAbsoluteMaxOutliers() == 0) || (checker.getConfiguration().isCriterionMonotonic() && checker.getMetric().isMonotonic()) || (checker.getConfiguration().isPracticalMonotonicity())) {
    traverseType=TraverseType.FIRST_PHASE_ONLY;
    history.setPruningStrategy(PruningStrategy.ANONYMOUS);
  }
 else {
    if (checker.getConfiguration().getMinimalGroupSize() != Integer.MAX_VALUE) {
      traverseType=TraverseType.FIRST_AND_SECOND_PHASE;
      history.setPruningStrategy(PruningStrategy.K_ANONYMOUS);
    }
 else {
      traverseType=TraverseType.SECOND_PHASE_ONLY;
      history.setPruningStrategy(PruningStrategy.CHECKED);
    }
  }
}
Program: 109053
Project: 109053
Buggy source:
@Override public boolean isAnonymous(HashGroupifyEntry entry){
  return entry.count >= k;
}

Fixed version (ground truth):
@Override public boolean isAnonymous(HashGroupifyEntry entry){
  throw new RuntimeException("String_Node_Str");
}
Program: 109054
Project: 109054
Buggy source:
/** 
 * Checks whether the given entry is anonymous
 * @param entry
 * @return
 */
private boolean isAnonymous(HashGroupifyEntry entry){
  for (int i=0; i < criteria.length; i++) {
    if (!criteria[i].isAnonymous(entry)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks whether the given entry is anonymous
 * @param entry
 * @return
 */
private boolean isAnonymous(HashGroupifyEntry entry){
  if (k != Integer.MAX_VALUE && entry.count < k) {
    return false;
  }
  for (int i=0; i < criteria.length; i++) {
    if (!criteria[i].isAnonymous(entry)) {
      return false;
    }
  }
  return true;
}
Program: 109055
Project: 109055
Buggy source:
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(KAnonymity.class)) {
    k=config.getCriterion(KAnonymity.class).getK();
  }
 else {
    k=Integer.MAX_VALUE;
  }
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriterion(DPresence.class).getResearchSubset();
  }
 else {
    subset=null;
  }
  criteria=config.getCriteria();
  criteriaIgnoreKAnonymity=config.getCriteriaIgnoreKAnonymity();
  if (config.containsCriterion(KAnonymity.class)) {
    if (config.getCriteria().length == 1) {
      this.isOnlyKAnonymity=true;
      this.containsKAnonymity=false;
    }
 else {
      this.isOnlyKAnonymity=false;
      this.containsKAnonymity=true;
    }
  }
 else {
    this.isOnlyKAnonymity=false;
    this.containsKAnonymity=false;
  }
}

Fixed version (ground truth):
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriterion(DPresence.class).getResearchSubset();
  }
 else {
    subset=null;
  }
  criteria=config.getCriteriaAsArray();
  k=config.getMinimalGroupSize();
}
Program: 109056
Project: 109056
Buggy source:
@Override public void addGroupify(int[] key,int representant,int count,Distribution distribution,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (distribution != null) {
    if (entry.distribution == null) {
      entry.distribution=distribution;
    }
    entry.distribution.merge(distribution);
  }
}

Fixed version (ground truth):
@Override public void addGroupify(int[] key,int representant,int count,Distribution distribution,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (distribution != null) {
    if (entry.distribution == null) {
      entry.distribution=distribution;
    }
 else {
      entry.distribution.merge(distribution);
    }
  }
}
Program: 109057
Project: 109057
Buggy source:
@Override public void addSnapshot(int[] key,int representant,int count,int[] elements,int[] frequencies,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (elements != null) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution(elements,frequencies);
    }
    entry.distribution.merge(elements,frequencies);
  }
}

Fixed version (ground truth):
@Override public void addSnapshot(int[] key,int representant,int count,int[] elements,int[] frequencies,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (elements != null) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution(elements,frequencies);
    }
 else {
      entry.distribution.merge(elements,frequencies);
    }
  }
}
Program: 109058
Project: 109058
Buggy source:
/** 
 * Checks whether an equivalence class is anonymous
 * @param entry
 * @return
 */
private boolean isAnonymous(final HashGroupifyEntry entry){
switch (config.getCriterion()) {
case L_DIVERSITY:
switch (config.getLDiversityCriterion()) {
case RECURSIVE:
      return entry.distribution.isRecursiveCLDiverse(ldivC,k);
case DISTINCT:
    return entry.distribution.isDistinctLDiverse(k);
case ENTROPY:
  return entry.distribution.isEntropyLDiverse(logL,k);
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
case T_CLOSENESS:
switch (config.getTClosenessCriterion()) {
case EMD_EQUAL:
return entry.distribution.isTCloseEqualDist(tcloseT,tCloseInitialDistribution);
case EMD_HIERARCHICAL:
System.arraycopy(tCloseEmpty,0,tCloseTree,tCloseExtraStart,tCloseEmpty.length);
return entry.distribution.isTCloseHierachical(tcloseT,tCloseTree);
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
case K_ANONYMITY:
return entry.count >= k;
case D_PRESENCE:
if (entry.count > 0) {
double dCurrent=(double)entry.count / (double)entry.pcount;
return (dCurrent >= dMin) && (dCurrent <= dMax);
}
 else {
return true;
}
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Checks whether an equivalence class is anonymous
 * @param entry
 * @return
 */
private boolean isAnonymous(final HashGroupifyEntry entry){
switch (config.getCriterion()) {
case L_DIVERSITY:
switch (config.getLDiversityCriterion()) {
case RECURSIVE:
      return entry.distribution.isRecursiveCLDiverse(ldivC,k);
case DISTINCT:
    return entry.distribution.isDistinctLDiverse(k);
case ENTROPY:
  return entry.distribution.isEntropyLDiverse(logL,k);
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
case T_CLOSENESS:
if (entry.count < k) {
return false;
}
switch (config.getTClosenessCriterion()) {
case EMD_EQUAL:
return entry.distribution.isTCloseEqualDist(tcloseT,tCloseInitialDistribution);
case EMD_HIERARCHICAL:
System.arraycopy(tCloseEmpty,0,tCloseTree,tCloseExtraStart,tCloseEmpty.length);
return entry.distribution.isTCloseHierachical(tcloseT,tCloseTree);
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
case K_ANONYMITY:
return entry.count >= k;
case D_PRESENCE:
if (entry.count > 0) {
double dCurrent=(double)entry.count / (double)entry.pcount;
return (dCurrent >= dMin) && (dCurrent <= dMax);
}
 else {
return true;
}
default :
throw new UnsupportedOperationException(config.getLDiversityCriterion() + "String_Node_Str");
}
}
Program: 109059
Project: 109059
Buggy source:
/** 
 * Removes a snapshot
 * @param node
 */
private final void removeHistoryEntry(final Node node){
  final int[] snapshot=nodeToSnapshot.remove(node);
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
    for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
      dictionarySensValue.decrementRefCount(snapshot[i + 3]);
      dictionarySensFreq.decrementRefCount(snapshot[i + 4]);
    }
  break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
  dictionarySensValue.decrementRefCount(snapshot[i + 2]);
  dictionarySensFreq.decrementRefCount(snapshot[i + 3]);
}
}
}

Fixed version (ground truth):
/** 
 * Removes a snapshot
 * @param node
 */
private final void removeHistoryEntry(final Node node){
  final int[] snapshot=nodeToSnapshot.remove(node);
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
    for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
      dictionarySensValue.decrementRefCount(snapshot[i + 3]);
      dictionarySensFreq.decrementRefCount(snapshot[i + 4]);
    }
  break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
case ARXConfiguration.REQUIREMENT_DISTRIBUTION:
for (int i=0; i < snapshot.length; i+=config.getSnapshotLength()) {
  dictionarySensValue.decrementRefCount(snapshot[i + 2]);
  dictionarySensFreq.decrementRefCount(snapshot[i + 3]);
}
}
}
Program: 109060
Project: 109060
Buggy source:
/** 
 * Creates a new NodeChecker instance.
 * @param manager The manager
 * @param metric The metric
 * @param config The anonymization configuration
 * @param historyMaxSize The history max size
 * @param snapshotSizeDataset The history threshold
 * @param snapshotSizeSnapshot The history threshold replacement
 */
public NodeChecker(final DataManager manager,final Metric<?> metric,final ARXConfiguration config,final int historyMaxSize,final double snapshotSizeDataset,final double snapshotSizeSnapshot){
  this.metric=metric;
  this.config=config;
  data=manager.getDataQI();
  final int initialSize=(int)(manager.getDataQI().getDataLength() * 0.01d);
  final IntArrayDictionary dictionarySensValue;
  final IntArrayDictionary dictionarySensFreq;
  if (config.containsCriterion(TCloseness.class)) {
    dictionarySensValue=new IntArrayDictionary(initialSize);
    dictionarySensFreq=new IntArrayDictionary(initialSize);
  }
 else {
    dictionarySensValue=new IntArrayDictionary(0);
    dictionarySensFreq=new IntArrayDictionary(0);
  }
  history=new History(manager.getDataQI().getArray().length,historyMaxSize,snapshotSizeDataset,snapshotSizeSnapshot,config,dictionarySensValue,dictionarySensFreq);
  stateMachine=new StateMachine(history);
  currentGroupify=new HashGroupify(initialSize,config);
  lastGroupify=new HashGroupify(initialSize,config);
  transformer=new Transformer(manager.getDataQI().getArray(),manager.getHierarchies(),manager.getDataSE().getArray(),config,dictionarySensValue,dictionarySensFreq);
}

Fixed version (ground truth):
/** 
 * Creates a new NodeChecker instance.
 * @param manager The manager
 * @param metric The metric
 * @param config The anonymization configuration
 * @param historyMaxSize The history max size
 * @param snapshotSizeDataset The history threshold
 * @param snapshotSizeSnapshot The history threshold replacement
 */
public NodeChecker(final DataManager manager,final Metric<?> metric,final ARXConfiguration config,final int historyMaxSize,final double snapshotSizeDataset,final double snapshotSizeSnapshot){
  this.metric=metric;
  this.config=config;
  data=manager.getDataQI();
  final int initialSize=(int)(manager.getDataQI().getDataLength() * 0.01d);
  final IntArrayDictionary dictionarySensValue;
  final IntArrayDictionary dictionarySensFreq;
  if ((config.getRequirements() & ARXConfiguration.REQUIREMENT_DISTRIBUTION) != 0) {
    dictionarySensValue=new IntArrayDictionary(initialSize);
    dictionarySensFreq=new IntArrayDictionary(initialSize);
  }
 else {
    dictionarySensValue=new IntArrayDictionary(0);
    dictionarySensFreq=new IntArrayDictionary(0);
  }
  history=new History(manager.getDataQI().getArray().length,historyMaxSize,snapshotSizeDataset,snapshotSizeSnapshot,config,dictionarySensValue,dictionarySensFreq);
  stateMachine=new StateMachine(history);
  currentGroupify=new HashGroupify(initialSize,config);
  lastGroupify=new HashGroupify(initialSize,config);
  transformer=new Transformer(manager.getDataQI().getArray(),manager.getHierarchies(),manager.getDataSE().getArray(),config,dictionarySensValue,dictionarySensFreq);
}
Program: 109061
Project: 109061
Buggy source:
@Override public void addGroupify(int[] key,int representant,int count,Distribution distribution,int pcount){
  final int hash=HashTableUtil.hashcode(key);
  final HashGroupifyEntry entry;
  if (subset != null && subset.get(representant)) {
    entry=addInternal(key,representant,count,hash,pcount);
  }
 else {
    entry=addInternal(key,representant,0,hash,pcount);
  }
  if (distribution != null) {
    if (entry.distribution == null) {
      entry.distribution=distribution;
    }
    entry.distribution.merge(distribution);
  }
}

Fixed version (ground truth):
@Override public void addGroupify(int[] key,int representant,int count,Distribution distribution,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (distribution != null) {
    if (entry.distribution == null) {
      entry.distribution=distribution;
    }
    entry.distribution.merge(distribution);
  }
}
Program: 109062
Project: 109062
Buggy source:
@Override public void addSnapshot(int[] key,int representant,int count,int[] elements,int[] frequencies,int pcount){
  final int hash=HashTableUtil.hashcode(key);
  final HashGroupifyEntry entry;
  if (subset != null && subset.get(representant)) {
    entry=addInternal(key,representant,count,hash,pcount);
  }
 else {
    entry=addInternal(key,representant,0,hash,pcount);
  }
  if (elements != null) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution(elements,frequencies);
    }
    entry.distribution.merge(elements,frequencies);
  }
}

Fixed version (ground truth):
@Override public void addSnapshot(int[] key,int representant,int count,int[] elements,int[] frequencies,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (elements != null) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution(elements,frequencies);
    }
    entry.distribution.merge(elements,frequencies);
  }
}
Program: 109063
Project: 109063
Buggy source:
/** 
 * Internal adder method.
 * @param key the key
 * @param line the line
 * @param value the value
 * @param hash the hash
 * @return the hash groupify entry
 */
private final HashGroupifyEntry addInternal(final int[] key,final int line,final int value,final int hash,final int pvalue){
  int index=hash & (buckets.length - 1);
  HashGroupifyEntry entry=findEntry(key,index,hash);
  if (entry == null) {
    if (++elementCount > threshold) {
      rehash();
      index=hash & (buckets.length - 1);
    }
    entry=createEntry(key,index,hash,line);
  }
  entry.count+=value;
  if (subset != null) {
    entry.pcount+=pvalue;
    if (value > 0) {
      entry.representant=line;
    }
  }
  if (entry.count >= k) {
    if (!entry.isNotOutlier) {
      entry.isNotOutlier=true;
      currentOutliers-=(entry.count - value);
    }
  }
 else {
    currentOutliers+=value;
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Internal adder method.
 * @param key the key
 * @param line the line
 * @param value the value
 * @param hash the hash
 * @return the hash groupify entry
 */
private final HashGroupifyEntry addInternal(final int[] key,final int representant,int count,final int pcount){
  final int hash=HashTableUtil.hashcode(key);
  if (subset != null && !subset.get(representant)) {
    count=0;
  }
  int index=hash & (buckets.length - 1);
  HashGroupifyEntry entry=findEntry(key,index,hash);
  if (entry == null) {
    if (++elementCount > threshold) {
      rehash();
      index=hash & (buckets.length - 1);
    }
    entry=createEntry(key,index,hash,representant);
  }
  entry.count+=count;
  if (subset != null) {
    entry.pcount+=pcount;
    if (count > 0) {
      entry.representant=representant;
    }
  }
  if (entry.count >= k) {
    if (!entry.isNotOutlier) {
      entry.isNotOutlier=true;
      currentOutliers-=(entry.count - count);
    }
  }
 else {
    currentOutliers+=count;
  }
  return entry;
}
Program: 109064
Project: 109064
Buggy source:
@Override public void addAll(int[] key,int representant,int count,int sensitive,int pcount){
  final int hash=HashTableUtil.hashcode(key);
  final HashGroupifyEntry entry;
  if (subset != null && subset.get(representant)) {
    entry=addInternal(key,representant,count,hash,pcount);
  }
 else {
    entry=addInternal(key,representant,0,hash,pcount);
  }
  if (sensitive != -1) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution();
    }
    entry.distribution.add(sensitive);
  }
}

Fixed version (ground truth):
@Override public void addAll(int[] key,int representant,int count,int sensitive,int pcount){
  final HashGroupifyEntry entry=addInternal(key,representant,count,pcount);
  if (sensitive != -1) {
    if (entry.distribution == null) {
      entry.distribution=new Distribution();
    }
    entry.distribution.add(sensitive);
  }
}
Program: 109065
Project: 109065
Buggy source:
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.config=config;
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(KAnonymity.class)) {
    k=config.getCriterion(KAnonymity.class).getK();
  }
 else {
    k=Integer.MAX_VALUE;
  }
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriterion(DPresence.class).getResearchSubset();
  }
 else {
    subset=null;
  }
  criteria=config.getCriteria();
  criteriaIgnoreKAnonymity=config.getCriteriaIgnoreKAnonymity();
}

Fixed version (ground truth):
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(KAnonymity.class)) {
    k=config.getCriterion(KAnonymity.class).getK();
  }
 else {
    k=Integer.MAX_VALUE;
  }
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriterion(DPresence.class).getResearchSubset();
  }
 else {
    subset=null;
  }
  criteria=config.getCriteria();
  criteriaIgnoreKAnonymity=config.getCriteriaIgnoreKAnonymity();
  if (config.containsCriterion(KAnonymity.class)) {
    if (config.getCriteria().length == 1) {
      this.isOnlyKAnonymity=true;
      this.containsKAnonymity=false;
    }
 else {
      this.isOnlyKAnonymity=false;
      this.containsKAnonymity=true;
    }
  }
 else {
    this.isOnlyKAnonymity=false;
    this.containsKAnonymity=false;
  }
}
Program: 109066
Project: 109066
Buggy source:
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.config=config;
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(KAnonymity.class)) {
    k=config.getCriteria(KAnonymity.class)[0].getK();
  }
 else {
    k=Integer.MAX_VALUE;
  }
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriteria(DPresence.class)[0].getResearchSubset();
  }
 else {
    subset=null;
  }
}

Fixed version (ground truth):
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.config=config;
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(KAnonymity.class)) {
    k=config.getCriteria(KAnonymity.class).iterator().next().getK();
  }
 else {
    k=Integer.MAX_VALUE;
  }
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriteria(DPresence.class).iterator().next().getResearchSubset();
  }
 else {
    subset=null;
  }
}
Program: 109067
Project: 109067
Buggy source:
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}
Program: 109068
Project: 109068
Buggy source:
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}

Fixed version (ground truth):
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}
Program: 109069
Project: 109069
Buggy source:
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}
Program: 109070
Project: 109070
Buggy source:
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}
Program: 109071
Project: 109071
Buggy source:
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}

Fixed version (ground truth):
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}
Program: 109072
Project: 109072
Buggy source:
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}
Program: 109073
Project: 109073
Buggy source:
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processSnapshot(){
  startIndex*=ssStepWidth;
  stopIndex*=ssStepWidth;
  for (int i=startIndex; i < stopIndex; i+=ssStepWidth) {
    intuple=data[snapshot[i]];
    outtuple=buffer[snapshot[i]];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],null,null,snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 3]),dictionarySensFreq.get(snapshot[i + 4]),snapshot[i + 2]);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addSnapshot(outtuple,snapshot[i],snapshot[i + 1],dictionarySensValue.get(snapshot[i + 2]),dictionarySensFreq.get(snapshot[i + 3]),-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}
Program: 109074
Project: 109074
Buggy source:
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}

Fixed version (ground truth):
@Override protected void processGroupify(){
  int processed=0;
  while (element != null) {
    intuple=data[element.representant];
    outtuple=buffer[element.representant];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addGroupify(outtuple,element.representant,element.count,null,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addGroupify(outtuple,element.representant,element.count,null,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,element.pcount);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addGroupify(outtuple,element.representant,element.count,element.distribution,-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
processed++;
if (processed == numElements) {
return;
}
element=element.nextOrdered;
}
}
Program: 109075
Project: 109075
Buggy source:
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}

Fixed version (ground truth):
@Override protected void processAll(){
  for (int i=startIndex; i < stopIndex; i++) {
    intuple=data[i];
    outtuple=buffer[i];
    outtuple[outindex0]=idindex0[intuple[index0]][stateindex0];
    outtuple[outindex1]=idindex1[intuple[index1]][stateindex1];
    outtuple[outindex2]=idindex2[intuple[index2]][stateindex2];
switch (requirements) {
case ARXConfiguration.REQUIREMENT_COUNTER:
      groupify.addAll(outtuple,i,1,-1,-1);
    break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER:
  groupify.addAll(outtuple,i,1,-1,1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_SECONDARY_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],1);
break;
case ARXConfiguration.REQUIREMENT_COUNTER | ARXConfiguration.REQUIREMENT_DISTRIBUTION:
groupify.addAll(outtuple,i,1,sensitiveValues[i],-1);
break;
default :
throw new RuntimeException("String_Node_Str" + requirements);
}
}
}