nus-yam/ex-repair huggingface dataset:
Program: 51006
Project: 51006
Buggy source:
/** 
 * Adds a member to cache.
 * @param member Member
 * @param parent Member's parent (generally equals member.getParentMember)
 * @param cellRegionList List of cell regions to be flushed
 */
private void addMember(final RolapMember member,final RolapMember parent,List<CellRegion> cellRegionList){
  final MemberCache memberCache=getMemberCache(member);
  final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
  List<RolapMember> childrenList=memberCache.getChildrenFromCache(parent,memberConstraint);
  if (childrenList == null) {
    final List<RolapMember> constrainedList=new ArrayList<RolapMember>();
    constrainedList.add(member);
    memberCache.putChildren(parent,memberConstraint,constrainedList);
  }
  childrenList=memberCache.getChildrenFromCache(parent,DefaultMemberChildrenConstraint.instance());
  if (childrenList == null) {
    final List<RolapMember> unconstrainedList=new ArrayList<RolapMember>();
    unconstrainedList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),unconstrainedList);
  }
 else {
    childrenList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),childrenList);
  }
  final Object memberKey=memberCache.makeKey(member.getParentMember(),member.getKey());
  memberCache.putMember(memberKey,member);
  cellRegionList.add(createMemberRegion(parent,false));
}

Fixed version (ground truth):
/** 
 * Adds a member to cache.
 * @param member Member
 * @param parent Member's parent (generally equals member.getParentMember)
 * @param cellRegionList List of cell regions to be flushed
 */
private Callable<Boolean> addMember(final RolapMember member,final RolapMember parent,List<CellRegion> cellRegionList){
  cellRegionList.add(createMemberRegion(parent,false));
  return new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      final MemberCache memberCache=getMemberCache(member);
      final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
      List<RolapMember> childrenList=memberCache.getChildrenFromCache(parent,memberConstraint);
      if (childrenList == null) {
        final List<RolapMember> constrainedList=new ArrayList<RolapMember>();
        constrainedList.add(member);
        memberCache.putChildren(parent,memberConstraint,constrainedList);
      }
      childrenList=memberCache.getChildrenFromCache(parent,DefaultMemberChildrenConstraint.instance());
      if (childrenList == null) {
        final List<RolapMember> unconstrainedList=new ArrayList<RolapMember>();
        unconstrainedList.add(member);
        memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),unconstrainedList);
      }
 else {
        childrenList.add(member);
        memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),childrenList);
      }
      final Object memberKey=memberCache.makeKey(member.getParentMember(),member.getKey());
      memberCache.putMember(memberKey,member);
      return true;
    }
  }
;
}
Program: 51007
Project: 51007
Buggy source:
public void visit(RolapMember member){
  member=stripMember(member);
  final MemberCache memberCache=getMemberCache(member);
  final Object cacheKey=memberCache.makeKey(member.getParentMember(),member.getKey());
  final RolapMember cacheMember=memberCache.getMember(cacheKey);
  if (cacheMember == null) {
    return;
  }
  for (  Map.Entry<String,Object> entry : propertyValues.entrySet()) {
    cacheMember.setProperty(entry.getKey(),entry.getValue());
  }
}

Fixed version (ground truth):
public void visit(RolapMember member){
  members.add(member);
}
Program: 51009
Project: 51009
Buggy source:
public Boolean call() throws Exception {
  final MemberCache memberCache=getMemberCache(member);
  final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
  List<RolapMember> childrenList=memberCache.getChildrenFromCache(parent,memberConstraint);
  if (childrenList == null) {
    final List<RolapMember> constrainedList=new ArrayList<RolapMember>();
    constrainedList.add(member);
    memberCache.putChildren(parent,memberConstraint,constrainedList);
  }
  childrenList=memberCache.getChildrenFromCache(parent,DefaultMemberChildrenConstraint.instance());
  if (childrenList == null) {
    final List<RolapMember> unconstrainedList=new ArrayList<RolapMember>();
    unconstrainedList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),unconstrainedList);
  }
 else {
    childrenList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),childrenList);
  }
  final Object memberKey=memberCache.makeKey(member.getParentMember(),member.getKey());
  memberCache.putMember(memberKey,member);
  return true;
}

Fixed version (ground truth):
public Boolean call() throws Exception {
  final MemberCache memberCache=getMemberCache(member);
  final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
  List<RolapMember> childrenList=memberCache.getChildrenFromCache(parent,memberConstraint);
  if (childrenList == null) {
    final List<RolapMember> constrainedList=new ArrayList<RolapMember>();
    constrainedList.add(member);
    memberCache.putChildren(parent,memberConstraint,constrainedList);
  }
 else {
    if (childrenList.isEmpty()) {
      childrenList=new ArrayList<RolapMember>();
    }
    childrenList.add(member);
    memberCache.putChildren(parent,memberConstraint,childrenList);
  }
  childrenList=memberCache.getChildrenFromCache(parent,DefaultMemberChildrenConstraint.instance());
  if (childrenList == null) {
    final List<RolapMember> unconstrainedList=new ArrayList<RolapMember>();
    unconstrainedList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),unconstrainedList);
  }
 else {
    childrenList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),childrenList);
  }
  final Object memberKey=memberCache.makeKey(member.getParentMember(),member.getKey());
  memberCache.putMember(memberKey,member);
  return true;
}
Program: 51010
Project: 51010
Buggy source:
public String generateRegularExpression(String source,String javaRegExp){
  final Matcher flagsMatcher=flagsPattern.matcher(javaRegExp);
  if (flagsMatcher.matches()) {
    javaRegExp=javaRegExp.replace(flagsMatcher.group(1),"String_Node_Str");
  }
  final Matcher escapeMatcher=escapePattern.matcher(javaRegExp);
  if (escapeMatcher.matches()) {
    String sequence=escapeMatcher.group(2);
    sequence=sequence.replaceAll("String_Node_Str","String_Node_Str");
    javaRegExp=javaRegExp.replace(escapeMatcher.group(1),sequence.toUpperCase());
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(source);
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(javaRegExp);
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String generateRegularExpression(String source,String javaRegex){
  try {
    Pattern.compile(javaRegex);
  }
 catch (  PatternSyntaxException e) {
    return null;
  }
  final Matcher flagsMatcher=flagsPattern.matcher(javaRegex);
  if (flagsMatcher.matches()) {
    javaRegex=javaRegex.substring(0,flagsMatcher.start(1)) + javaRegex.substring(flagsMatcher.end(1));
  }
  final Matcher escapeMatcher=escapePattern.matcher(javaRegex);
  if (escapeMatcher.matches()) {
    String sequence=escapeMatcher.group(2);
    sequence=sequence.replaceAll("String_Node_Str","String_Node_Str");
    javaRegex=javaRegex.substring(0,escapeMatcher.start(1)) + sequence.toUpperCase() + javaRegex.substring(escapeMatcher.end(1));
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(source);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,javaRegex);
  return sb.toString();
}
Program: 51011
Project: 51011
Buggy source:
@Override public String generateRegularExpression(String source,String javaRegExp){
  final Matcher flagsMatcher=flagsPattern.matcher(javaRegExp);
  final StringBuilder suffixSb=new StringBuilder();
  if (flagsMatcher.matches()) {
    final String flags=flagsMatcher.group(2);
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    javaRegExp=javaRegExp.replace(flagsMatcher.group(1),"String_Node_Str");
  }
  final Matcher escapeMatcher=escapePattern.matcher(javaRegExp);
  if (escapeMatcher.matches()) {
    String sequence=escapeMatcher.group(2);
    sequence=sequence.replaceAll("String_Node_Str","String_Node_Str");
    javaRegExp=javaRegExp.replace(escapeMatcher.group(1),sequence);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(source);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,javaRegExp);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,suffixSb.toString());
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String generateRegularExpression(String source,String javaRegex){
  try {
    Pattern.compile(javaRegex);
  }
 catch (  PatternSyntaxException e) {
    return null;
  }
  final Matcher flagsMatcher=flagsPattern.matcher(javaRegex);
  final String suffix;
  if (flagsMatcher.matches()) {
    final StringBuilder suffixSb=new StringBuilder();
    final String flags=flagsMatcher.group(2);
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    if (flags.contains("String_Node_Str")) {
      suffixSb.append("String_Node_Str");
    }
    suffix=suffixSb.toString();
    javaRegex=javaRegex.substring(0,flagsMatcher.start(1)) + javaRegex.substring(flagsMatcher.end(1));
  }
 else {
    suffix="String_Node_Str";
  }
  final Matcher escapeMatcher=escapePattern.matcher(javaRegex);
  if (escapeMatcher.matches()) {
    String sequence=escapeMatcher.group(2);
    sequence=sequence.replaceAll("String_Node_Str","String_Node_Str");
    javaRegex=javaRegex.replace(escapeMatcher.group(1),sequence);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(source);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,javaRegex);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,suffix);
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 51012
Project: 51012
Buggy source:
public String generateRegularExpression(String source,String javaRegExp){
  javaRegExp=javaRegExp.replace("String_Node_Str","String_Node_Str");
  javaRegExp=javaRegExp.replace("String_Node_Str","String_Node_Str");
  final StringBuilder sb=new StringBuilder();
  sb.append(source);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,javaRegExp);
  return sb.toString();
}

Fixed version (ground truth):
public String generateRegularExpression(String source,String javaRegex){
  try {
    Pattern.compile(javaRegex);
  }
 catch (  PatternSyntaxException e) {
    return null;
  }
  javaRegex=javaRegex.replace("String_Node_Str","String_Node_Str");
  javaRegex=javaRegex.replace("String_Node_Str","String_Node_Str");
  final StringBuilder sb=new StringBuilder();
  sb.append(source);
  sb.append("String_Node_Str");
  quoteStringLiteral(sb,javaRegex);
  return sb.toString();
}
Program: 51015
Project: 51015
Buggy source:
/** 
 * Converts a locale identifier (LCID) as used by Windows into a Java locale. <p>For example,   {@code lcidToLocale(1033)} returns "en_US", because1033 (hex 0409) is US english.</p>
 * @param lcid Locale identifier
 * @return Locale
 * @throws RuntimeException if locale id is unkown
 */
public static Locale lcidToLocale(short lcid){
switch (lcid) {
case 0x0409:
    return Locale.US;
default :
  throw new RuntimeException("String_Node_Str" + lcid);
}
}

Fixed version (ground truth):
/** 
 * Converts a locale identifier (LCID) as used by Windows into a Java locale. <p>For example,   {@code lcidToLocale(1033)} returns "en_US", because1033 (hex 0409) is US english.</p>
 * @param lcid Locale identifier
 * @return Locale
 * @throws RuntimeException if locale id is unkown
 * @deprecated Soon to be moved to Olap4jUtil.
 */
public static Locale lcidToLocale(short lcid){
  if (lcid == 0x0409) {
    return Locale.US;
  }
  Bug.olap4jUpgrade("String_Node_Str");
  return LcidLocale.instance().toLocale(lcid);
}
Program: 51016
Project: 51016
Buggy source:
public Object[] toArray(){
  if (this.plainList == null) {
    final List<T> tmpPlainList=new ArrayList<T>();
    int size=0;
    for (final Iterator<T> it=this.listIterator(0); it.hasNext(); ) {
      tmpPlainList.add(it.next());
      size++;
    }
    this.plainList=tmpPlainList;
  }
  return this.plainList.toArray();
}

Fixed version (ground truth):
@Override public <T>T[] toArray(T[] contents){
  ensurePlainList();
  return this.plainList.toArray(contents);
}
Program: 51018
Project: 51018
Buggy source:
/** 
 * Adds a table to the FROM clause of the query. If <code>table</code> is not null, adds the table. Otherwise, add the relation on which this hierarchy is based on. <p> This method is idempotent: if you call it more than once, it only adds the table(s) to the FROM clause once.
 * @param query Query to add the hierarchy to
 * @param table table to add to the query
 */
void addToFrom(SqlQuery query,RolapStar.Table table){
  if (getRelation() == null) {
    throw Util.newError("String_Node_Str" + getUniqueName() + "String_Node_Str");
  }
  final boolean failIfExists=false;
  MondrianDef.RelationOrJoin subRelation=null;
  if (table != null) {
    subRelation=lookupRelationSubset(getRelation(),table);
  }
  if (subRelation == null) {
    subRelation=getRelation();
  }
  boolean tableAdded=query.addFrom(subRelation,null,failIfExists);
  if (tableAdded && table != null) {
    RolapStar.Condition joinCondition=table.getJoinCondition();
    if (joinCondition != null) {
      query.addWhere(joinCondition);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a table to the FROM clause of the query. If <code>table</code> is not null, adds the table. Otherwise, add the relation on which this hierarchy is based on. <p> This method is idempotent: if you call it more than once, it only adds the table(s) to the FROM clause once.
 * @param query Query to add the hierarchy to
 * @param table table to add to the query
 */
void addToFrom(SqlQuery query,RolapStar.Table table){
  if (getRelation() == null) {
    throw Util.newError("String_Node_Str" + getUniqueName() + "String_Node_Str");
  }
  final boolean failIfExists=false;
  MondrianDef.RelationOrJoin subRelation=null;
  if (table != null) {
    subRelation=lookupRelationSubset(getRelation(),table);
  }
  if (subRelation == null) {
    subRelation=getRelation();
  }
  boolean tableAdded=query.addFrom(subRelation,table != null ? table.getAlias() : null,failIfExists);
  if (tableAdded && table != null) {
    RolapStar.Condition joinCondition=table.getJoinCondition();
    if (joinCondition != null) {
      query.addWhere(joinCondition);
    }
  }
}
Program: 51020
Project: 51020
Buggy source:
public OlapElement lookupCompound(OlapElement parent,List<Id.Segment> names,boolean failIfNotFound,int category,MatchType matchType){
  return schemaReader.lookupCompound(parent,names,failIfNotFound,category,matchType);
}

Fixed version (ground truth):
public final OlapElement lookupCompound(OlapElement parent,List<Id.Segment> names,boolean failIfNotFound,int category,MatchType matchType){
  if (MondrianProperties.instance().SsasCompatibleNaming.get()) {
    return new NameResolver().resolve(parent,Util.toOlap4j(names),failIfNotFound,category,matchType,getNamespaces());
  }
  return lookupCompoundInternal(parent,names,failIfNotFound,category,matchType);
}
Program: 51021
Project: 51021
Buggy source:
public OlapElement lookupChild(SchemaReader schemaReader,Id.Segment s,MatchType matchType){
  OlapElement oe=lookupHierarchy(s);
  if (!MondrianProperties.instance().SsasCompatibleNaming.get()) {
    if (oe == null || oe.getName().equalsIgnoreCase(getName())) {
      OlapElement oeLevel=getHierarchy().lookupChild(schemaReader,s,matchType);
      if (oeLevel != null) {
        oe=oeLevel;
      }
    }
  }
 else {
    if (oe == null) {
      for (      Hierarchy hierarchy : schemaReader.getDimensionHierarchies(this)) {
        oe=hierarchy.lookupChild(schemaReader,s,matchType);
        if (oe != null) {
          break;
        }
      }
    }
  }
  if (getLogger().isDebugEnabled()) {
    StringBuilder buf=new StringBuilder(64);
    buf.append("String_Node_Str");
    buf.append("String_Node_Str");
    buf.append(getName());
    buf.append("String_Node_Str");
    buf.append(s);
    if (oe == null) {
      buf.append("String_Node_Str");
    }
 else {
      buf.append("String_Node_Str" + oe.getName());
    }
    getLogger().debug(buf.toString());
  }
  return oe;
}

Fixed version (ground truth):
public OlapElement lookupChild(SchemaReader schemaReader,Id.Segment s,MatchType matchType){
  OlapElement oe=lookupHierarchy(s);
  if (!MondrianProperties.instance().SsasCompatibleNaming.get()) {
    if (oe == null || oe.getName().equalsIgnoreCase(getName())) {
      OlapElement oeLevel=getHierarchy().lookupChild(schemaReader,s,matchType);
      if (oeLevel != null) {
        return oeLevel;
      }
    }
    return oe;
  }
 else {
    if (oe != null) {
      return oe;
    }
    final List<Hierarchy> hierarchyList=schemaReader.getDimensionHierarchies(this);
    for (    Hierarchy hierarchy : hierarchyList) {
      oe=hierarchy.lookupChild(schemaReader,s,matchType);
      if (oe != null) {
        return oe;
      }
    }
    return null;
  }
}
Program: 51022
Project: 51022
Buggy source:
/** 
 * Wraps a schema reader in a proxy so that each call to schema reader has a locus for profiling purposes.
 * @param connection Connection
 * @param schemaReader Schema reader
 * @return Wrapped schema reader
 */
public static SchemaReader locusSchemaReader(RolapConnection connection,final SchemaReader schemaReader){
  final Statement statement=connection.createDummyStatement();
  final Execution execution=new Execution(statement,0);
  final Locus locus=new Locus(execution,"String_Node_Str",null);
  return (SchemaReader)Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),new Class[]{SchemaReader.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      Locus.push(locus);
      try {
        return method.invoke(schemaReader,args);
      }
  finally {
        Locus.pop(locus);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Wraps a schema reader in a proxy so that each call to schema reader has a locus for profiling purposes.
 * @param connection Connection
 * @param schemaReader Schema reader
 * @return Wrapped schema reader
 */
public static SchemaReader locusSchemaReader(RolapConnection connection,final SchemaReader schemaReader){
  final Statement statement=connection.createDummyStatement();
  final Execution execution=new Execution(statement,0);
  final Locus locus=new Locus(execution,"String_Node_Str",null);
  return (SchemaReader)Proxy.newProxyInstance(SchemaReader.class.getClassLoader(),new Class[]{SchemaReader.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      Locus.push(locus);
      try {
        return method.invoke(schemaReader,args);
      }
  finally {
        Locus.pop(locus);
      }
    }
  }
);
}
Program: 51023
Project: 51023
Buggy source:
@Override public int compare(ConstrainedColumn o1,ConstrainedColumn o2){
  return o1.columnExpression.compareTo(o2.columnExpression);
}

Fixed version (ground truth):
public int compare(ConstrainedColumn o1,ConstrainedColumn o2){
  return o1.columnExpression.compareTo(o2.columnExpression);
}
Program: 51024
Project: 51024
Buggy source:
/** 
 * Base constructor for segment headers.
 * @see #forSegment(Segment)
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns,String rolapStarFactTableName,BitKey constrainedColsBitKey){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.rolapStarFactTableName=rolapStarFactTableName;
  this.constrainedColsBitKey=constrainedColsBitKey;
  this.arity=constrainedColumns.length;
  Arrays.sort(this.constrainedColumns,new Comparator<ConstrainedColumn>(){
    @Override public int compare(    ConstrainedColumn o1,    ConstrainedColumn o2){
      return o1.columnExpression.compareTo(o2.columnExpression);
    }
  }
);
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : this.constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  this.hashCode=hash;
}

Fixed version (ground truth):
/** 
 * Base constructor for segment headers.
 * @see #forSegment(Segment)
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns,String rolapStarFactTableName,BitKey constrainedColsBitKey){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.rolapStarFactTableName=rolapStarFactTableName;
  this.constrainedColsBitKey=constrainedColsBitKey;
  this.arity=constrainedColumns.length;
  Arrays.sort(this.constrainedColumns,new Comparator<ConstrainedColumn>(){
    public int compare(    ConstrainedColumn o1,    ConstrainedColumn o2){
      return o1.columnExpression.compareTo(o2.columnExpression);
    }
  }
);
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : this.constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  this.hashCode=hash;
}
Program: 51025
Project: 51025
Buggy source:
private boolean allArgsCheapToExpand(Exp exp){
  if (exp instanceof NamedSetExpr) {
    exp=((NamedSetExpr)exp).getNamedSet().getExp();
  }
  for (  Exp arg : ((ResolvedFunCall)exp).getArgs()) {
    if (arg instanceof ResolvedFunCall) {
      if (!cheapFuns.contains(((ResolvedFunCall)arg).getFunName())) {
        return false;
      }
    }
 else     if (!(arg instanceof MemberExpr)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean allArgsCheapToExpand(Exp exp){
  while (exp instanceof NamedSetExpr) {
    exp=((NamedSetExpr)exp).getNamedSet().getExp();
  }
  for (  Exp arg : ((ResolvedFunCall)exp).getArgs()) {
    if (arg instanceof ResolvedFunCall) {
      if (!cheapFuns.contains(((ResolvedFunCall)arg).getFunName())) {
        return false;
      }
    }
 else     if (!(arg instanceof MemberExpr)) {
      return false;
    }
  }
  return true;
}
Program: 51026
Project: 51026
Buggy source:
public Pair<String,List<SqlStatement.Type>> generateSqlQuery(){
  SqlQuery sqlQuery=newSqlQuery();
  int k=getDistinctMeasureCount();
  final Dialect dialect=sqlQuery.getDialect();
  if (!dialect.allowsCountDistinct() && k > 0 || !dialect.allowsMultipleCountDistinct() && k > 1) {
    distinctGenerateSql(sqlQuery,countOnly);
  }
 else {
    nonDistinctGenerateSql(sqlQuery);
  }
  if (!countOnly) {
    addGroupingFunction(sqlQuery);
    addGroupingSets(sqlQuery);
  }
  return sqlQuery.toSqlAndTypes();
}

Fixed version (ground truth):
public Pair<String,List<SqlStatement.Type>> generateSqlQuery(){
  SqlQuery sqlQuery=newSqlQuery();
  int k=getDistinctMeasureCount();
  final Dialect dialect=sqlQuery.getDialect();
  final Map<String,String> groupingSetsAliases;
  if (!dialect.allowsCountDistinct() && k > 0 || !dialect.allowsMultipleCountDistinct() && k > 1) {
    groupingSetsAliases=distinctGenerateSql(sqlQuery,countOnly);
  }
 else {
    groupingSetsAliases=nonDistinctGenerateSql(sqlQuery);
  }
  if (!countOnly) {
    addGroupingFunction(sqlQuery);
    addGroupingSets(sqlQuery,groupingSetsAliases);
  }
  return sqlQuery.toSqlAndTypes();
}
Program: 51028
Project: 51028
Buggy source:
protected void nonDistinctGenerateSql(SqlQuery sqlQuery){
  RolapStar.Column[] columns=getColumns();
  int arity=columns.length;
  if (countOnly) {
    sqlQuery.addSelect("String_Node_Str",SqlStatement.Type.INT);
  }
  for (int i=0; i < arity; i++) {
    RolapStar.Column column=columns[i];
    RolapStar.Table table=column.getTable();
    if (table.isFunky()) {
      continue;
    }
    table.addToFrom(sqlQuery,false,true);
    String expr=column.generateExprString(sqlQuery);
    StarColumnPredicate predicate=getColumnPredicate(i);
    final String where=RolapStar.Column.createInExpr(expr,predicate,column.getDatatype(),sqlQuery);
    if (!where.equals("String_Node_Str")) {
      sqlQuery.addWhere(where);
    }
    if (countOnly) {
      continue;
    }
    final Dialect dialect=sqlQuery.getDialect();
    final String alias;
    final Dialect.DatabaseProduct databaseProduct=dialect.getDatabaseProduct();
    if (databaseProduct == Dialect.DatabaseProduct.DB2_AS400) {
      alias=sqlQuery.addSelect(expr,column.getInternalType(),null);
    }
 else {
      alias=sqlQuery.addSelect(expr,column.getInternalType(),getColumnAlias(i));
    }
    if (isAggregate()) {
      sqlQuery.addGroupBy(expr,alias);
    }
    if (isOrdered()) {
      sqlQuery.addOrderBy(expr,true,false,false);
    }
  }
  extraPredicates(sqlQuery);
  for (int i=0, count=getMeasureCount(); i < count; i++) {
    addMeasure(i,sqlQuery);
  }
}

Fixed version (ground truth):
protected Map<String,String> nonDistinctGenerateSql(SqlQuery sqlQuery){
  RolapStar.Column[] columns=getColumns();
  int arity=columns.length;
  if (countOnly) {
    sqlQuery.addSelect("String_Node_Str",SqlStatement.Type.INT);
  }
  for (int i=0; i < arity; i++) {
    RolapStar.Column column=columns[i];
    RolapStar.Table table=column.getTable();
    if (table.isFunky()) {
      continue;
    }
    table.addToFrom(sqlQuery,false,true);
    String expr=column.generateExprString(sqlQuery);
    StarColumnPredicate predicate=getColumnPredicate(i);
    final String where=RolapStar.Column.createInExpr(expr,predicate,column.getDatatype(),sqlQuery);
    if (!where.equals("String_Node_Str")) {
      sqlQuery.addWhere(where);
    }
    if (countOnly) {
      continue;
    }
    final Dialect dialect=sqlQuery.getDialect();
    final String alias;
    final Dialect.DatabaseProduct databaseProduct=dialect.getDatabaseProduct();
    if (databaseProduct == Dialect.DatabaseProduct.DB2_AS400) {
      alias=sqlQuery.addSelect(expr,column.getInternalType(),null);
    }
 else {
      alias=sqlQuery.addSelect(expr,column.getInternalType(),getColumnAlias(i));
    }
    if (isAggregate()) {
      sqlQuery.addGroupBy(expr,alias);
    }
    if (isOrdered()) {
      sqlQuery.addOrderBy(expr,true,false,false);
    }
  }
  extraPredicates(sqlQuery);
  for (int i=0, count=getMeasureCount(); i < count; i++) {
    addMeasure(i,sqlQuery);
  }
  return Collections.emptyMap();
}
Program: 51029
Project: 51029
Buggy source:
protected void addGroupingSets(SqlQuery sqlQuery){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
protected void addGroupingSets(SqlQuery sqlQuery,Map<String,String> groupingSetsAliases){
  throw new UnsupportedOperationException();
}
Program: 51030
Project: 51030
Buggy source:
protected void addGroupingSets(SqlQuery sqlQuery){
  List<RolapStar.Column[]> groupingSetsColumns=groupingSetsList.getGroupingSetsColumns();
  for (  RolapStar.Column[] groupingSetsColumn : groupingSetsColumns) {
    ArrayList<String> groupingColumnsExpr=new ArrayList<String>();
    for (    RolapStar.Column aColumn : groupingSetsColumn) {
      groupingColumnsExpr.add(aColumn.generateExprString(sqlQuery));
    }
    sqlQuery.addGroupingSet(groupingColumnsExpr);
  }
}

Fixed version (ground truth):
protected void addGroupingSets(SqlQuery sqlQuery,Map<String,String> groupingSetsAliases){
  List<RolapStar.Column[]> groupingSetsColumns=groupingSetsList.getGroupingSetsColumns();
  for (  RolapStar.Column[] groupingSetsColumn : groupingSetsColumns) {
    ArrayList<String> groupingColumnsExpr=new ArrayList<String>();
    for (    RolapStar.Column aColumn : groupingSetsColumn) {
      final String columnExpr=aColumn.generateExprString(sqlQuery);
      if (groupingSetsAliases.containsKey(columnExpr)) {
        groupingColumnsExpr.add(groupingSetsAliases.get(columnExpr));
      }
 else {
        groupingColumnsExpr.add(columnExpr);
      }
    }
    sqlQuery.addGroupingSet(groupingColumnsExpr);
  }
}
Program: 51031
Project: 51031
Buggy source:
/** 
 * Compares two cell values. <p>Nulls compare last, exceptions (including the object which indicates the the cell is not in the cache yet) next, then numbers and strings are compared by value.
 * @param value0 First cell value
 * @param value1 Second cell value
 * @return -1, 0, or 1, depending upon whether first cell value is lessthan, equal to, or greater than the second
 */
public static int compareValues(Object value0,Object value1){
  if (value0 == value1) {
    return 0;
  }
  if (value0 == null) {
    return -1;
  }
  if (value1 == null) {
    return 1;
  }
  if (value0 instanceof RuntimeException || value1 instanceof RuntimeException) {
    return 0;
  }
 else   if (value0 == Util.nullValue) {
    return -1;
  }
 else   if (value1 == Util.nullValue) {
    return 1;
  }
 else   if (value0 instanceof String) {
    return ((String)value0).compareTo((String)value1);
  }
 else   if (value0 instanceof Number) {
    return FunUtil.compareValues(((Number)value0).doubleValue(),((Number)value1).doubleValue());
  }
 else   if (value0 instanceof OrderKey) {
    return ((OrderKey)value0).compareTo(value1);
  }
 else {
    throw Util.newInternal("String_Node_Str" + value0);
  }
}

Fixed version (ground truth):
/** 
 * Compares two cell values. <p>Nulls compare last, exceptions (including the object which indicates the the cell is not in the cache yet) next, then numbers and strings are compared by value.
 * @param value0 First cell value
 * @param value1 Second cell value
 * @return -1, 0, or 1, depending upon whether first cell value is lessthan, equal to, or greater than the second
 */
public static int compareValues(Object value0,Object value1){
  if (value0 == value1) {
    return 0;
  }
  if (value0 == null) {
    return -1;
  }
  if (value1 == null) {
    return 1;
  }
  if (value0 instanceof RuntimeException || value1 instanceof RuntimeException) {
    return 0;
  }
 else   if (value0 == Util.nullValue) {
    return -1;
  }
 else   if (value1 == Util.nullValue) {
    return 1;
  }
 else   if (value0 instanceof String) {
    return ((String)value0).compareToIgnoreCase((String)value1);
  }
 else   if (value0 instanceof Number) {
    return FunUtil.compareValues(((Number)value0).doubleValue(),((Number)value1).doubleValue());
  }
 else   if (value0 instanceof OrderKey) {
    return ((OrderKey)value0).compareTo(value1);
  }
 else {
    throw Util.newInternal("String_Node_Str" + value0);
  }
}
Program: 51032
Project: 51032
Buggy source:
/** 
 * Executes drill-through on this cell. <p>Not a part of the public API. Package-protected because this method also implements the DRILLTHROUGH statement.
 * @param maxRowCount Maximum number of rows to retrieve, <= 0 if unlimited
 * @param firstRowOrdinal Ordinal of row to skip to (1-based), or 0 tostart from beginning
 * @param tabFields Comma-separated list of fields to return (deprecated)
 * @param extendedContext   If true, add non-constraining columns to thequery for levels below each current member. This additional context makes the drill-through queries easier for humans to understand.
 * @param logger Logger. If not null and debug is enabled, log SQL here
 * @param rowCountSlot Slot into which the number of fact rows is written
 * @return Result set
 * @throws OlapException on error
 */
ResultSet drillThroughInternal(int maxRowCount,int firstRowOrdinal,String tabFields,boolean extendedContext,Logger logger,int[] rowCountSlot) throws OlapException {
  if (rowCountSlot != null) {
    rowCountSlot[0]=cell.getDrillThroughCount();
  }
  final SqlStatement sqlStmt=cell.drillThroughInternal(maxRowCount,firstRowOrdinal,tabFields,extendedContext,logger);
  return sqlStmt.getWrappedResultSet();
}

Fixed version (ground truth):
/** 
 * Executes drill-through on this cell. <p>Not a part of the public API. Package-protected because this method also implements the DRILLTHROUGH statement.
 * @param maxRowCount Maximum number of rows to retrieve, <= 0 if unlimited
 * @param firstRowOrdinal Ordinal of row to skip to (1-based), or 0 tostart from beginning
 * @param tabFields Comma-separated list of fields to return (deprecated)
 * @param extendedContext   If true, add non-constraining columns to thequery for levels below each current member. This additional context makes the drill-through queries easier for humans to understand.
 * @param logger Logger. If not null and debug is enabled, log SQL here
 * @param rowCountSlot Slot into which the number of fact rows is written
 * @return Result set
 * @throws OlapException on error
 */
ResultSet drillThroughInternal(int maxRowCount,int firstRowOrdinal,String tabFields,boolean extendedContext,Logger logger,int[] rowCountSlot) throws OlapException {
  if (!cell.canDrillThrough()) {
    return null;
  }
  if (rowCountSlot != null) {
    rowCountSlot[0]=cell.getDrillThroughCount();
  }
  final SqlStatement sqlStmt=cell.drillThroughInternal(maxRowCount,firstRowOrdinal,tabFields,extendedContext,logger);
  return sqlStmt.getWrappedResultSet();
}
Program: 51033
Project: 51033
Buggy source:
ResultSet executeQuery2(String mdx,boolean advanced,String tabFields,int[] rowCountSlot) throws SQLException {
  if (advanced) {
    throw new UnsupportedOperationException();
  }
  QueryPart parseTree;
  try {
    parseTree=olap4jConnection.getMondrianConnection().parseStatement(mdx);
  }
 catch (  MondrianException e) {
    throw olap4jConnection.helper.createException("String_Node_Str",e);
  }
  if (!(parseTree instanceof DrillThrough)) {
    throw olap4jConnection.helper.createException("String_Node_Str" + "String_Node_Str");
  }
  DrillThrough drillThrough=(DrillThrough)parseTree;
  final Query query=drillThrough.getQuery();
  query.setResultStyle(ResultStyle.LIST);
  CellSet cellSet=executeOlapQueryInternal(query);
  final List<Integer> coords=Collections.nCopies(cellSet.getAxes().size(),0);
  final MondrianOlap4jCell cell=(MondrianOlap4jCell)cellSet.getCell(coords);
  return cell.drillThroughInternal(drillThrough.getMaxRowCount(),drillThrough.getFirstRowOrdinal(),null,true,null,rowCountSlot);
}

Fixed version (ground truth):
ResultSet executeQuery2(String mdx,boolean advanced,String tabFields,int[] rowCountSlot) throws SQLException {
  if (advanced) {
    throw new UnsupportedOperationException();
  }
  QueryPart parseTree;
  try {
    parseTree=olap4jConnection.getMondrianConnection().parseStatement(mdx);
  }
 catch (  MondrianException e) {
    throw olap4jConnection.helper.createException("String_Node_Str",e);
  }
  if (!(parseTree instanceof DrillThrough)) {
    throw olap4jConnection.helper.createException("String_Node_Str" + "String_Node_Str");
  }
  DrillThrough drillThrough=(DrillThrough)parseTree;
  final Query query=drillThrough.getQuery();
  query.setResultStyle(ResultStyle.LIST);
  CellSet cellSet=executeOlapQueryInternal(query);
  final List<Integer> coords=Collections.nCopies(cellSet.getAxes().size(),0);
  final MondrianOlap4jCell cell=(MondrianOlap4jCell)cellSet.getCell(coords);
  ResultSet resultSet=cell.drillThroughInternal(drillThrough.getMaxRowCount(),drillThrough.getFirstRowOrdinal(),null,true,null,rowCountSlot);
  if (resultSet == null) {
    throw new OlapException("String_Node_Str");
  }
  return resultSet;
}
Program: 51034
Project: 51034
Buggy source:
private void replaceTrivialCalcMember(int i,List<Member> members){
  Member member=members.get(i);
  if (!member.isCalculated()) {
    return;
  }
  member=RolapUtil.strip((RolapMember)member);
  RolapCalculatedMember measure=(RolapCalculatedMember)member;
  final Exp expr=measure.getFormula().getExpression();
  if (expr instanceof MemberExpr) {
    members.set(i,((MemberExpr)expr).getMember());
    return;
  }
  if (expr instanceof ResolvedFunCall) {
    ResolvedFunCall call=(ResolvedFunCall)expr;
    if (call.getFunDef() instanceof AggregateFunDef) {
      final Exp[] args=call.getArgs();
      if (args[0] instanceof ResolvedFunCall) {
        final ResolvedFunCall arg0=(ResolvedFunCall)args[0];
        if (arg0.getFunDef() instanceof SetFunDef) {
          if (arg0.getArgCount() == 1 && arg0.getArg(0) instanceof MemberExpr) {
            final MemberExpr memberExpr=(MemberExpr)arg0.getArg(0);
            members.set(i,memberExpr.getMember());
            return;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void replaceTrivialCalcMember(int i,List<Member> members){
  Member member=members.get(i);
  if (!member.isCalculated()) {
    return;
  }
  member=RolapUtil.strip((RolapMember)member);
  final Exp expr=member.getExpression();
  if (expr instanceof MemberExpr) {
    members.set(i,((MemberExpr)expr).getMember());
    return;
  }
  if (expr instanceof ResolvedFunCall) {
    ResolvedFunCall call=(ResolvedFunCall)expr;
    if (call.getFunDef() instanceof AggregateFunDef) {
      final Exp[] args=call.getArgs();
      if (args[0] instanceof ResolvedFunCall) {
        final ResolvedFunCall arg0=(ResolvedFunCall)args[0];
        if (arg0.getFunDef() instanceof SetFunDef) {
          if (arg0.getArgCount() == 1 && arg0.getArg(0) instanceof MemberExpr) {
            final MemberExpr memberExpr=(MemberExpr)arg0.getArg(0);
            members.set(i,memberExpr.getMember());
          }
        }
      }
    }
  }
}
Program: 51035
Project: 51035
Buggy source:
/** 
 * Base constructor for segment headers.
 * @see #forSegment(Segment)
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.arity=constrainedColumns.length;
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : constrainedColumns) {
    hash=Util.hash(hash,col.tableName);
    hash=Util.hash(hash,col.columnName);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  this.hashCode=hash;
}

Fixed version (ground truth):
/** 
 * Base constructor for segment headers.
 * @see #forSegment(Segment)
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns,String rolapStarFactTableName,BitKey constrainedColsBitKey){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.rolapStarFactTableName=rolapStarFactTableName;
  this.constrainedColsBitKey=constrainedColsBitKey;
  this.arity=constrainedColumns.length;
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  this.hashCode=hash;
}
Program: 51036
Project: 51036
Buggy source:
/** 
 * Returns a human readable description of this segment header.
 * @return A string describing the header.
 */
public String getDescription(){
  if (this.description == null) {
    StringBuilder descriptionSB=new StringBuilder();
    descriptionSB.append("String_Node_Str");
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.schemaName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.cubeName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.measureName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append("String_Node_Str");
    for (    ConstrainedColumn c : constrainedColumns) {
      descriptionSB.append("String_Node_Str");
      descriptionSB.append(c.tableName);
      descriptionSB.append("String_Node_Str");
      descriptionSB.append(c.columnName);
      descriptionSB.append("String_Node_Str");
      for (      Object value : c.values) {
        descriptionSB.append("String_Node_Str");
        descriptionSB.append(value);
        descriptionSB.append("String_Node_Str");
      }
      descriptionSB.deleteCharAt(descriptionSB.length() - 1);
      descriptionSB.append("String_Node_Str");
    }
    descriptionSB.append("String_Node_Str").append("String_Node_Str").append(getUniqueID()).append("String_Node_Str");
    this.description=descriptionSB.toString();
  }
  return description;
}

Fixed version (ground truth):
/** 
 * Returns a human readable description of this segment header.
 * @return A string describing the header.
 */
public String getDescription(){
  if (this.description == null) {
    StringBuilder descriptionSB=new StringBuilder();
    descriptionSB.append("String_Node_Str");
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.schemaName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.cubeName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append(this.measureName);
    descriptionSB.append("String_Node_Str");
    descriptionSB.append("String_Node_Str");
    for (    ConstrainedColumn c : constrainedColumns) {
      descriptionSB.append("String_Node_Str");
      descriptionSB.append(c.columnExpression);
      descriptionSB.append("String_Node_Str");
      for (      Object value : c.values) {
        descriptionSB.append("String_Node_Str");
        descriptionSB.append(value);
        descriptionSB.append("String_Node_Str");
      }
      descriptionSB.deleteCharAt(descriptionSB.length() - 1);
      descriptionSB.append("String_Node_Str");
    }
    descriptionSB.append("String_Node_Str").append("String_Node_Str").append(getUniqueID()).append("String_Node_Str");
    this.description=descriptionSB.toString();
  }
  return description;
}
Program: 51037
Project: 51037
Buggy source:
/** 
 * Returns a unique identifier for this header. The identifier can be used for storage and will be the same across segments which have the same schema name, cube name, measure name, and for each constrained column, the same column name, table name, and predicate values.
 * @return A unique identification string.
 */
public String getUniqueID(){
  if (this.uniqueID == null) {
    StringBuilder hashSB=new StringBuilder();
    hashSB.append(this.schemaName);
    hashSB.append(this.cubeName);
    hashSB.append(this.measureName);
    for (    ConstrainedColumn c : constrainedColumns) {
      hashSB.append(c.tableName);
      hashSB.append(c.columnName);
      for (      Object value : c.values) {
        hashSB.append(String.valueOf(value));
      }
    }
    this.uniqueID=Util.checksumSha256(hashSB.toString());
  }
  final StringBuffer hexString=new StringBuffer();
  for (int i=0; i < this.uniqueID.length; i++) {
    hexString.append(Integer.toHexString(0xFF & this.uniqueID[i]));
  }
  return hexString.toString();
}

Fixed version (ground truth):
/** 
 * Returns a unique identifier for this header. The identifier can be used for storage and will be the same across segments which have the same schema name, cube name, measure name, and for each constrained column, the same column name, table name, and predicate values.
 * @return A unique identification string.
 */
public String getUniqueID(){
  if (this.uniqueID == null) {
    StringBuilder hashSB=new StringBuilder();
    hashSB.append(this.schemaName);
    hashSB.append(this.cubeName);
    hashSB.append(this.measureName);
    for (    ConstrainedColumn c : constrainedColumns) {
      hashSB.append(c.columnExpression);
      for (      Object value : c.values) {
        hashSB.append(String.valueOf(value));
      }
    }
    this.uniqueID=Util.checksumSha256(hashSB.toString());
  }
  final StringBuffer hexString=new StringBuffer();
  for (int i=0; i < this.uniqueID.length; i++) {
    hexString.append(Integer.toHexString(0xFF & this.uniqueID[i]));
  }
  return hexString.toString();
}
Program: 51038
Project: 51038
Buggy source:
public int hashCode(){
  return hashCode;
}

Fixed version (ground truth):
@Override public int hashCode(){
  if (this.hashCode == Integer.MIN_VALUE) {
    int hash=super.hashCode();
    hash=Util.hash(hash,this.columnExpression);
    for (    Object val : this.values) {
      hash=Util.hash(hash,val);
    }
    this.hashCode=hash;
  }
  return hashCode;
}
Program: 51039
Project: 51039
Buggy source:
public boolean equals(Object obj){
  if (!(obj instanceof SegmentHeader)) {
    return false;
  }
  return ((SegmentHeader)obj).getUniqueID() == this.getUniqueID();
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (!(obj instanceof ConstrainedColumn)) {
    return false;
  }
  ConstrainedColumn that=(ConstrainedColumn)obj;
  if (!this.columnExpression.equals(that.columnExpression)) {
    return false;
  }
  if (this.values.length != that.values.length) {
    return false;
  }
  for (int i=0; i < this.values.length; i++) {
    if (!this.values[i].equals(that.values[i])) {
      return false;
    }
  }
  return true;
}