nus-yam/ex-repair huggingface dataset:
Program: 51435
Project: 51435
Buggy source:
synchronized void makeMeasure(RolapBaseCubeMeasure measure){
  RolapStar.Measure starMeasure=new RolapStar.Measure(measure.getName(),measure.getAggregator(),this,measure.getMondrianDefExpression(),true);
  measure.setStarMeasure(starMeasure);
  if (containsColumn(starMeasure)) {
    star.decrementColumnCount();
  }
 else {
    addColumn(starMeasure);
  }
}

Fixed version (ground truth):
synchronized void makeMeasure(RolapBaseCubeMeasure measure){
  RolapStar.Measure starMeasure=new RolapStar.Measure(measure.getName(),measure.getAggregator(),this,measure.getMondrianDefExpression(),measure.isNumeric());
  measure.setStarMeasure(starMeasure);
  if (containsColumn(starMeasure)) {
    star.decrementColumnCount();
  }
 else {
    addColumn(starMeasure);
  }
}
Program: 51436
Project: 51436
Buggy source:
/** 
 * Tests the behavior if you have NON EMPTY on both axes, and the default member of a hierarchy is not 'all' or the first child.
 */
public void testNonEmptyWithWeirdDefaultMember(){
  TestContext testContext=TestContext.createSubstitutingCube("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  testContext.assertQueryReturns("String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
  testContext.assertQueryReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests the behavior if you have NON EMPTY on both axes, and the default member of a hierarchy is not 'all' or the first child.
 */
public void testNonEmptyWithWeirdDefaultMember(){
  if (!Bug.Bug1574942Fixed)   return;
  TestContext testContext=TestContext.createSubstitutingCube("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  testContext.assertQueryReturns("String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
  testContext.assertQueryReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}
Program: 51437
Project: 51437
Buggy source:
/** 
 * Registers a   {@link FormatLocale} to a given {@link Locale}. Returns the previous mapping.
 */
public static FormatLocale registerFormatLocale(FormatLocale formatLocale,Locale locale){
  String key=locale.toString();
  FormatLocale previous=(FormatLocale)mapLocaleToFormatLocale.put(key,formatLocale);
  key=locale.getLanguage() + "String_Node_Str" + locale.getCountry();
  if (mapLocaleToFormatLocale.get(key) == null) {
    mapLocaleToFormatLocale.put(key,formatLocale);
  }
  key=locale.getLanguage();
  if (mapLocaleToFormatLocale.get(key) == null) {
    mapLocaleToFormatLocale.put(key,formatLocale);
  }
  key="String_Node_Str";
  if (mapLocaleToFormatLocale.get(key) == null) {
    mapLocaleToFormatLocale.put(key,formatLocale);
  }
  return previous;
}

Fixed version (ground truth):
/** 
 * Registers a   {@link FormatLocale} to a given {@link Locale}. Returns the previous mapping.
 */
public static FormatLocale registerFormatLocale(FormatLocale formatLocale,Locale locale){
  String key=locale.toString();
  FormatLocale previous=mapLocaleToFormatLocale.put(key,formatLocale);
  return previous;
}
Program: 51438
Project: 51438
Buggy source:
/** 
 * Returns the best   {@link FormatLocale} for a given {@link Locale}. Never returns null, even if <code>locale</code> is null.
 */
public static synchronized FormatLocale getBestFormatLocale(Locale locale){
  FormatLocale formatLocale;
  if (locale == null) {
    return locale_US;
  }
  String key=locale.toString();
  formatLocale=(FormatLocale)mapLocaleToFormatLocale.get(key);
  if (formatLocale == null) {
    formatLocale=getFormatLocaleUsingFactory(locale);
    if (formatLocale == null) {
      formatLocale=locale_US;
    }
    mapLocaleToFormatLocale.put(key,formatLocale);
  }
  return formatLocale;
}

Fixed version (ground truth):
/** 
 * Returns the best   {@link FormatLocale} for a given {@link Locale}. Never returns null, even if <code>locale</code> is null.
 */
public static synchronized FormatLocale getBestFormatLocale(Locale locale){
  FormatLocale formatLocale;
  if (locale == null) {
    return locale_US;
  }
  String key=locale.toString();
  formatLocale=mapLocaleToFormatLocale.get(key);
  if (formatLocale == null) {
    formatLocale=getFormatLocaleUsingFactory(locale);
    if (formatLocale == null) {
      formatLocale=locale_US;
    }
    mapLocaleToFormatLocale.put(key,formatLocale);
  }
  return formatLocale;
}
Program: 51439
Project: 51439
Buggy source:
/** 
 * Returns the   {@link FormatLocale} which precisely matches {@link Locale}, if any, or null if there is none.
 */
public static FormatLocale getFormatLocale(Locale locale){
  if (locale == null) {
    locale=Locale.US;
  }
  String key=locale.toString();
  return (FormatLocale)mapLocaleToFormatLocale.get(key);
}

Fixed version (ground truth):
/** 
 * Returns the   {@link FormatLocale} which precisely matches {@link Locale}, if any, or null if there is none.
 */
public static FormatLocale getFormatLocale(Locale locale){
  if (locale == null) {
    locale=Locale.US;
  }
  String key=locale.toString();
  return mapLocaleToFormatLocale.get(key);
}
Program: 51440
Project: 51440
Buggy source:
public ParameterSlot registerParameter(Parameter parameter){
  ParameterSlot slot=(ParameterSlot)parameterSlots.get(parameter);
  if (slot != null) {
    return slot;
  }
  int index=parameterSlots.size();
  ParameterSlotImpl slot2=new ParameterSlotImpl(parameter,index);
  parameterSlots.put(parameter,slot2);
  Calc calc=parameter.getDefaultExp().accept(this);
  slot2.setDefaultValueCalc(calc);
  return slot2;
}

Fixed version (ground truth):
public ParameterSlot registerParameter(Parameter parameter){
  ParameterSlot slot=(ParameterSlot)parameterSlots.get(parameter);
  if (slot != null) {
    return slot;
  }
  int index=parameterSlots.size();
  ParameterSlotImpl slot2=new ParameterSlotImpl(parameter,index);
  parameterSlots.put(parameter,slot2);
  slot2.value=parameter.getValue();
  Calc calc=parameter.getDefaultExp().accept(this);
  slot2.setDefaultValueCalc(calc);
  return slot2;
}
Program: 51442
Project: 51442
Buggy source:
/** 
 * If all parents belong to the same level and no parent/child is involved, returns that level; this indicates that all member children can be fetched at once. Otherwise returns null.
 */
private RolapLevel getCommonChildLevelForDescendants(List parents){
  if (parents.size() < 2) {
    return null;
  }
  RolapLevel parentLevel=null;
  RolapLevel childLevel=null;
  for (Iterator it=parents.iterator(); it.hasNext(); ) {
    RolapMember member=(RolapMember)it.next();
    if (member.isCalculated()) {
      return null;
    }
    if (parentLevel == null) {
      parentLevel=(RolapLevel)member.getLevel();
      if (parentLevel.isParentChild()) {
        return null;
      }
      childLevel=getChildLevel(parentLevel);
      if (childLevel == null) {
        return null;
      }
      if (childLevel.isParentChild()) {
        return null;
      }
    }
 else     if (parentLevel != member.getLevel()) {
      return null;
    }
  }
  return childLevel;
}

Fixed version (ground truth):
/** 
 * If all parents belong to the same level and no parent/child is involved, returns that level; this indicates that all member children can be fetched at once. Otherwise returns null.
 */
private RolapLevel getCommonChildLevelForDescendants(List parents){
  if (parents.size() < 2) {
    return null;
  }
  RolapLevel parentLevel=null;
  RolapLevel childLevel=null;
  for (Iterator it=parents.iterator(); it.hasNext(); ) {
    RolapMember member=(RolapMember)it.next();
    if (member.isCalculated()) {
      return null;
    }
    if (parentLevel == null) {
      parentLevel=(RolapLevel)member.getLevel();
      if (parentLevel.isParentChild()) {
        return null;
      }
      childLevel=(RolapLevel)parentLevel.getChildLevel();
      if (childLevel == null) {
        return null;
      }
      if (childLevel.isParentChild()) {
        return null;
      }
    }
 else     if (parentLevel != member.getLevel()) {
      return null;
    }
  }
  return childLevel;
}
Program: 51445
Project: 51445
Buggy source:
NativeEvaluator createEvaluator(RolapEvaluator evaluator,FunDef fun,Exp[] args){
  if (!isEnabled()) {
    return null;
  }
  if (!FilterConstraint.isValidContext(evaluator)) {
    return null;
  }
  String funName=fun.getName();
  if (!"String_Node_Str".equalsIgnoreCase(funName)) {
    return null;
  }
  if (args.length != 2) {
    return null;
  }
  CrossJoinArg[] cargs=checkCrossJoinArg(args[0]);
  if (cargs == null) {
    return null;
  }
  if (isPreferInterpreter(cargs)) {
    return null;
  }
  SchemaReader schemaReader=evaluator.getSchemaReader();
  DataSource ds=schemaReader.getDataSource();
  Connection con=null;
  try {
    con=ds.getConnection();
    SqlQuery sqlQuery=SqlTupleReader.newQuery(con,"String_Node_Str");
    RolapNativeSql sql=new RolapNativeSql(sqlQuery);
    String filterExpr=sql.generateFilterCondition(args[1]);
    if (filterExpr == null) {
      return null;
    }
    LOGGER.debug("String_Node_Str");
    RolapEvaluator newEvaluator=(RolapEvaluator)evaluator.push();
    for (int i=0; i < cargs.length; i++) {
      Hierarchy hierarchy=cargs[i].getLevel().getHierarchy();
      Member defaultMember=schemaReader.getHierarchyDefaultMember(hierarchy);
      newEvaluator.setContext(defaultMember);
    }
    TupleConstraint constraint=new FilterConstraint(cargs,newEvaluator,filterExpr);
    return new SetEvaluator(cargs,schemaReader,constraint);
  }
 catch (  SQLException e) {
    throw Util.newInternal(e,"String_Node_Str");
  }
 finally {
    if (con != null) {
      try {
        con.close();
      }
 catch (      SQLException e) {
        LOGGER.error(null,e);
      }
    }
  }
}

Fixed version (ground truth):
NativeEvaluator createEvaluator(RolapEvaluator evaluator,FunDef fun,Exp[] args){
  if (!isEnabled()) {
    return null;
  }
  if (!FilterConstraint.isValidContext(evaluator)) {
    return null;
  }
  String funName=fun.getName();
  if (!"String_Node_Str".equalsIgnoreCase(funName)) {
    return null;
  }
  if (args.length != 2) {
    return null;
  }
  CrossJoinArg[] cargs=checkCrossJoinArg(args[0]);
  if (cargs == null) {
    return null;
  }
  if (isPreferInterpreter(cargs)) {
    return null;
  }
  SchemaReader schemaReader=evaluator.getSchemaReader();
  DataSource ds=schemaReader.getDataSource();
  Connection con=null;
  try {
    con=ds.getConnection();
    SqlQuery sqlQuery=SqlTupleReader.newQuery(con,"String_Node_Str");
    RolapNativeSql sql=new RolapNativeSql(sqlQuery);
    String filterExpr=sql.generateFilterCondition(args[1]);
    if (filterExpr == null) {
      return null;
    }
    LOGGER.debug("String_Node_Str");
    evaluator=overrideContext(evaluator,cargs,sql.getStoredMeasure());
    TupleConstraint constraint=new FilterConstraint(cargs,evaluator,filterExpr);
    return new SetEvaluator(cargs,schemaReader,constraint);
  }
 catch (  SQLException e) {
    throw Util.newInternal(e,"String_Node_Str");
  }
 finally {
    if (con != null) {
      try {
        con.close();
      }
 catch (      SQLException e) {
        LOGGER.error(null,e);
      }
    }
  }
}
Program: 51447
Project: 51447
Buggy source:
/** 
 * For every restricting member in the current context, generates a WHERE condition and a join to the fact table.
 * @param sqlQuery the query to modify
 * @param aggStar Aggregate table, or null if query is against fact table
 * @param strict defines the behavior if the current context containscalculated members. If true, an exception is thrown,
 */
public static void addContextConstraint(SqlQuery sqlQuery,AggStar aggStar,Evaluator e,boolean strict){
}

Fixed version (ground truth):
/** 
 * For every restricting member in the current context, generates a WHERE condition and a join to the fact table.
 * @param sqlQuery the query to modify
 * @param aggStar Aggregate table, or null if query is against fact table
 * @param strict defines the behavior if the current context containscalculated members. If true, an exception is thrown,
 */
public static void addContextConstraint(SqlQuery sqlQuery,AggStar aggStar,Evaluator e,boolean strict){
  Member[] members=e.getMembers();
  if (strict) {
    if (containsCalculatedMember(members)) {
      throw Util.newInternal("String_Node_Str");
    }
  }
 else {
    members=removeCalculatedMembers(members);
  }
  CellRequest request=RolapAggregationManager.makeRequest(members,false,false);
  if (request == null) {
    if (strict) {
      throw Util.newInternal("String_Node_Str");
    }
    return;
  }
  RolapStar.Column[] columns=request.getConstrainedColumns();
  Object[] values=request.getSingleValues();
  int arity=columns.length;
  for (int i=0; i < arity; i++) {
    RolapStar.Column column=columns[i];
    String expr;
    if (aggStar != null) {
      int bitPos=column.getBitPosition();
      AggStar.Table.Column aggColumn=aggStar.lookupColumn(bitPos);
      AggStar.Table table=aggColumn.getTable();
      table.addToFrom(sqlQuery,false,true);
      expr=aggColumn.generateExprString(sqlQuery);
    }
 else {
      RolapStar.Table table=column.getTable();
      table.addToFrom(sqlQuery,false,true);
      expr=column.generateExprString(sqlQuery);
    }
    String value=sqlQuery.quote(column.isNumeric(),values[i]);
    sqlQuery.addWhere(expr,RolapUtil.sqlNullLiteral.equals(value) ? "String_Node_Str" : "String_Node_Str",value);
  }
}
Program: 51448
Project: 51448
Buggy source:
/** 
 * Creates a "WHERE exp IN (...)" condition containing the values of all parents. All parents must belong to the same level.
 * @param sqlQuery the query to modify
 * @param aggStar
 * @param parents the list of parent members
 * @param strict defines the behavior if <code>parents</code>contains calculated members. If true, an exception is thrown,
 */
public static void addMemberConstraint(SqlQuery sqlQuery,AggStar aggStar,List parents,boolean strict){
  if (parents.size() == 0) {
    return;
  }
  for (Collection c=parents; !c.isEmpty(); c=getUniqueParentMembers(c)) {
    RolapMember m=(RolapMember)c.iterator().next();
    if (m.isAll()) {
      continue;
    }
    if (m.isCalculated()) {
      if (strict) {
        throw Util.newInternal("String_Node_Str" + "String_Node_Str" + m);
      }
      continue;
    }
    RolapLevel level=m.getRolapLevel();
    RolapHierarchy hierarchy=(RolapHierarchy)level.getHierarchy();
    hierarchy.addToFrom(sqlQuery,level.getKeyExp());
    String q=level.getKeyExp().getExpression(sqlQuery);
    ColumnConstraint[] cc=getColumnConstraints(c);
    if (cc.length >= MondrianProperties.instance().MaxConstraints.get()) {
    }
 else {
      String cond=RolapStar.Column.createInExpr(q,cc,level.isNumeric());
      sqlQuery.addWhere(cond);
    }
    if (level.isUnique()) {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a "WHERE exp IN (...)" condition containing the values of all parents. All parents must belong to the same level.
 * @param sqlQuery the query to modify
 * @param aggStar
 * @param parents the list of parent members
 * @param strict defines the behavior if <code>parents</code>contains calculated members. If true, an exception is thrown,
 */
public static void addMemberConstraint(SqlQuery sqlQuery,AggStar aggStar,List parents,boolean strict){
  if (parents.size() == 0) {
    return;
  }
  for (Collection c=parents; !c.isEmpty(); c=getUniqueParentMembers(c)) {
    RolapMember m=(RolapMember)c.iterator().next();
    if (m.isAll()) {
      continue;
    }
    if (m.isCalculated()) {
      if (strict) {
        throw Util.newInternal("String_Node_Str" + "String_Node_Str" + m);
      }
      continue;
    }
    RolapLevel level=m.getRolapLevel();
    RolapHierarchy hierarchy=(RolapHierarchy)level.getHierarchy();
    hierarchy.addToFrom(sqlQuery,level.getKeyExp());
    String q=level.getKeyExp().getExpression(sqlQuery);
    ColumnConstraint[] cc=getColumnConstraints(c);
    if (!strict && cc.length >= MondrianProperties.instance().MaxConstraints.get()) {
    }
 else {
      String cond=RolapStar.Column.createInExpr(q,cc,level.isNumeric());
      sqlQuery.addWhere(cond);
    }
    if (level.isUnique()) {
      break;
    }
  }
}
Program: 51449
Project: 51449
Buggy source:
protected Document replaceLastSchemaUpdateDate(Document doc){
  NodeList elements=doc.getElementsByTagName(LAST_SCHEMA_UPDATE_NODE_NAME);
  if (elements.getLength() == 0) {
    return doc;
  }
  Node lastSchemaUpdateNode=elements.item(0);
  lastSchemaUpdateNode.setTextContent(LAST_SCHEMA_UPDATE_DATE);
  return doc;
}

Fixed version (ground truth):
protected Document replaceLastSchemaUpdateDate(Document doc){
  NodeList elements=doc.getElementsByTagName(LAST_SCHEMA_UPDATE_NODE_NAME);
  if (elements.getLength() == 0) {
    return doc;
  }
  Node lastSchemaUpdateNode=elements.item(0);
  lastSchemaUpdateNode.getFirstChild().setNodeValue(LAST_SCHEMA_UPDATE_DATE);
  return doc;
}
Program: 51450
Project: 51450
Buggy source:
/** 
 * Compares two members which are known to have the same parent. First, compare by ordinal. This is only valid now we know they're siblings, because ordinals are only unique within a parent. If the dimension does not use ordinals, both ordinals will be -1. <p>If the ordinals do not differ, compare using regular member comparison.
 * @param m1 First member
 * @param m2 Second member
 * @return -1 if m1 collates less than m2,1 if m1 collates after m2, 0 if m1 == m2.
 */
static int compareSiblingMembers(Member m1,Member m2){
  final boolean calculated1=m1.isCalculatedInQuery();
  final boolean calculated2=m2.isCalculatedInQuery();
  if (calculated1) {
    if (!calculated2) {
      return 1;
    }
  }
 else {
    if (calculated2) {
      return -1;
    }
  }
  final int ordinal1=m1.getOrdinal();
  final int ordinal2=m2.getOrdinal();
  return (ordinal1 == ordinal2) ? m1.compareTo(m2) : (ordinal1 < ordinal2) ? -1 : 1;
}

Fixed version (ground truth):
/** 
 * Compares two members which are known to have the same parent. First, compare by ordinal. This is only valid now we know they're siblings, because ordinals are only unique within a parent. If the dimension does not use ordinals, both ordinals will be -1. <p>If the ordinals do not differ, compare using regular member comparison.
 * @param m1 First member
 * @param m2 Second member
 * @return -1 if m1 collates less than m2,1 if m1 collates after m2, 0 if m1 == m2.
 */
public static int compareSiblingMembers(Member m1,Member m2){
  final boolean calculated1=m1.isCalculatedInQuery();
  final boolean calculated2=m2.isCalculatedInQuery();
  if (calculated1) {
    if (!calculated2) {
      return 1;
    }
  }
 else {
    if (calculated2) {
      return -1;
    }
  }
  final int ordinal1=m1.getOrdinal();
  final int ordinal2=m2.getOrdinal();
  return (ordinal1 == ordinal2) ? m1.compareTo(m2) : (ordinal1 < ordinal2) ? -1 : 1;
}
Program: 51451
Project: 51451
Buggy source:
public OlapElement lookupChild(SchemaReader schemaReader,String name,int matchType){
  Member[] levelMembers=schemaReader.getLevelMembers(this,true);
  int bestMatch=-1;
  for (int i=0; i < levelMembers.length; i++) {
    int rc=levelMembers[i].getName().compareTo(name);
    if (rc == 0) {
      return levelMembers[i];
    }
    if (matchType == MatchType.BEFORE) {
      if (rc < 0 && (bestMatch == -1 || levelMembers[i].getName().compareTo(levelMembers[bestMatch].getName()) > 0)) {
        bestMatch=i;
      }
    }
 else     if (matchType == MatchType.AFTER) {
      if (rc > 0 && (bestMatch == -1 || levelMembers[i].getName().compareTo(levelMembers[bestMatch].getName()) < 0)) {
        bestMatch=i;
      }
    }
  }
  if (matchType != MatchType.EXACT && bestMatch != -1) {
    return levelMembers[bestMatch];
  }
  return null;
}

Fixed version (ground truth):
public OlapElement lookupChild(SchemaReader schemaReader,String name,int matchType){
  Member[] levelMembers=schemaReader.getLevelMembers(this,true);
  if (levelMembers.length > 0) {
    Member parent=levelMembers[0].getParentMember();
    return RolapUtil.findBestMemberMatch(levelMembers,(RolapMember)parent,this,name,matchType,false);
  }
  return null;
}
Program: 51452
Project: 51452
Buggy source:
public Member lookupMemberChildByName(Member parent,String childName,int matchType){
  LOGGER.debug("String_Node_Str" + childName + "String_Node_Str"+ parent);
  try {
    MemberChildrenConstraint constraint=(matchType == MatchType.EXACT) ? sqlConstraintFactory.getChildByNameConstraint((RolapMember)parent,childName) : sqlConstraintFactory.getMemberChildrenConstraint(null);
    Member[] children=internalGetMemberChildren(parent,constraint);
    int bestMatch=-1;
    for (int i=0; i < children.length; i++) {
      final Member child=children[i];
      int rc=Util.compareName(child.getName(),childName);
      if (rc == 0) {
        return child;
      }
      if (matchType == MatchType.BEFORE) {
        if (rc < 0 && (bestMatch == -1 || Util.compareName(child.getName(),children[bestMatch].getName()) > 0)) {
          bestMatch=i;
        }
      }
 else       if (matchType == MatchType.AFTER) {
        if (rc > 0 && (bestMatch == -1 || Util.compareName(child.getName(),children[bestMatch].getName()) < 0)) {
          bestMatch=i;
        }
      }
    }
    if (matchType != MatchType.EXACT && bestMatch != -1) {
      return children[bestMatch];
    }
  }
 catch (  NumberFormatException e) {
    LOGGER.debug("String_Node_Str" + parent + "String_Node_Str"+ childName+ "String_Node_Str"+ e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public Member lookupMemberChildByName(Member parent,String childName,int matchType){
  LOGGER.debug("String_Node_Str" + childName + "String_Node_Str"+ parent);
  try {
    MemberChildrenConstraint constraint=(matchType == MatchType.EXACT) ? sqlConstraintFactory.getChildByNameConstraint((RolapMember)parent,childName) : sqlConstraintFactory.getMemberChildrenConstraint(null);
    Member[] children=internalGetMemberChildren(parent,constraint);
    if (children.length > 0) {
      return RolapUtil.findBestMemberMatch(children,(RolapMember)parent,((RolapMember)children[0]).getRolapLevel(),childName,matchType,true);
    }
  }
 catch (  NumberFormatException e) {
    LOGGER.debug("String_Node_Str" + parent + "String_Node_Str"+ childName+ "String_Node_Str"+ e.getMessage());
  }
  return null;
}
Program: 51453
Project: 51453
Buggy source:
/** 
 * Adds an item to the ORDER BY clause.
 * @param expr the expr to order by
 * @param ascending sort direction
 * @param prepend whether to prepend to the current list of items
 */
public void addOrderBy(String expr,boolean ascending,boolean prepend){
  if (ascending) {
    expr=expr + "String_Node_Str";
  }
 else {
    expr=expr + "String_Node_Str";
  }
  if (prepend) {
    orderBy.add(0,expr);
  }
 else {
    orderBy.add(expr);
  }
}

Fixed version (ground truth):
/** 
 * Adds an item to the ORDER BY clause.
 * @param expr the expr to order by
 * @param ascending sort direction
 * @param prepend whether to prepend to the current list of items
 */
public void addOrderBy(String expr,boolean ascending,boolean prepend){
  if (!dialect.isNullsCollateLast()) {
    expr=dialect.forceNullsCollateLast(expr);
  }
  if (ascending) {
    expr=expr + "String_Node_Str";
  }
 else {
    expr=expr + "String_Node_Str";
  }
  if (prepend) {
    orderBy.add(0,expr);
  }
 else {
    orderBy.add(expr);
  }
}
Program: 51454
Project: 51454
Buggy source:
/** 
 * Tests that data in Hiearchy.Level attribute "nameColumn" can be null.  This will map to the #null memeber.
 */
public void testNullNameColumn(){
  Schema schema=getConnection().getSchema();
  final String cubeName="String_Node_Str";
  final Cube cube=schema.createCube("String_Node_Str" + cubeName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  try {
    getTestContext().assertQueryReturns(fold("String_Node_Str" + "String_Node_Str" + cubeName + "String_Node_Str"),fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
  }
  finally {
    schema.removeCube(cubeName);
  }
}

Fixed version (ground truth):
/** 
 * Tests that data in Hiearchy.Level attribute "nameColumn" can be null. This will map to the #null memeber.
 */
public void testNullNameColumn(){
  final String cubeName="String_Node_Str";
  TestContext testContext=TestContext.create(null,"String_Node_Str" + cubeName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null,null,null);
  testContext.assertQueryReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + cubeName + "String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}
Program: 51455
Project: 51455
Buggy source:
/** 
 * Tests that a #null member on a Hiearchy Level of type String can still be looked up when case sensitive is off.
 */
public void testCaseInsensitiveNullMember(){
  boolean old=MondrianProperties.instance().CaseSensitive.get();
  MondrianProperties.instance().CaseSensitive.set(false);
  Schema schema=getConnection().getSchema();
  final String cubeName="String_Node_Str";
  final Cube cube=schema.createCube("String_Node_Str" + cubeName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  try {
    getTestContext().assertQueryReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
  }
  finally {
    schema.removeCube(cubeName);
    MondrianProperties.instance().CaseSensitive.set(old);
  }
}

Fixed version (ground truth):
/** 
 * Tests that a #null member on a Hiearchy Level of type String can still be looked up when case sensitive is off.
 */
public void testCaseInsensitiveNullMember(){
  final String cubeName="String_Node_Str";
  TestContext testContext=TestContext.create(null,"String_Node_Str" + cubeName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null,null,null);
  boolean old=MondrianProperties.instance().CaseSensitive.get();
  MondrianProperties.instance().CaseSensitive.set(false);
  try {
    testContext.assertQueryReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str",fold("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
  }
  finally {
    MondrianProperties.instance().CaseSensitive.set(old);
  }
}
Program: 51456
Project: 51456
Buggy source:
synchronized void clear(){
  if (LOGGER.isDebugEnabled()) {
    String msg="String_Node_Str";
    LOGGER.debug(msg);
  }
  Iterator it=mapUrlToSchema.values().iterator();
  while (it.hasNext()) {
    SoftReference ref=(SoftReference)it.next();
    if (ref != null) {
      RolapSchema schema=(RolapSchema)ref.get();
      if (schema != null) {
        schema.finalCleanUp();
      }
    }
  }
  mapUrlToSchema.clear();
}

Fixed version (ground truth):
synchronized void clear(){
  if (LOGGER.isDebugEnabled()) {
    String msg="String_Node_Str";
    LOGGER.debug(msg);
  }
  Iterator it=mapUrlToSchema.values().iterator();
  while (it.hasNext()) {
    SoftReference ref=(SoftReference)it.next();
    if (ref != null) {
      RolapSchema schema=(RolapSchema)ref.get();
      if (schema != null) {
        schema.finalCleanUp();
      }
    }
  }
  mapUrlToSchema.clear();
  JdbcSchema.clearAllDBs();
}
Program: 51457
Project: 51457
Buggy source:
/** 
 * Finds a root member of a hierarchy with a given name.
 * @param hierarchy
 * @param memberName
 * @return Member, or null if not found
 */
public static Member lookupHierarchyRootMember(SchemaReader reader,Hierarchy hierarchy,String memberName,int matchType){
  Member[] rootMembers=reader.getHierarchyRootMembers(hierarchy);
  int bestMatch=-1;
  for (int i=0; i < rootMembers.length; i++) {
    int rc=rootMembers[i].getName().compareToIgnoreCase(memberName);
    if (rc == 0) {
      return rootMembers[i];
    }
    if (matchType == MatchType.BEFORE) {
      if (rc < 0 && (bestMatch == -1 || rootMembers[i].getName().compareToIgnoreCase(rootMembers[bestMatch].getName()) > 0)) {
        bestMatch=i;
      }
    }
 else     if (matchType == MatchType.AFTER) {
      if (rc > 0 && (bestMatch == -1 || rootMembers[i].getName().compareToIgnoreCase(rootMembers[bestMatch].getName()) < 0)) {
        bestMatch=i;
      }
    }
  }
  if (matchType != MatchType.EXACT && bestMatch != -1) {
    return rootMembers[bestMatch];
  }
  return (rootMembers.length == 1 && rootMembers[0].isAll()) ? reader.lookupMemberChildByName(rootMembers[0],memberName,matchType) : null;
}

Fixed version (ground truth):
/** 
 * Finds a root member of a hierarchy with a given name.
 * @param hierarchy
 * @param memberName
 * @return Member, or null if not found
 */
public static Member lookupHierarchyRootMember(SchemaReader reader,Hierarchy hierarchy,String memberName,int matchType){
  Member[] rootMembers=reader.getHierarchyRootMembers(hierarchy);
  Member searchMember=null;
  if (matchType != MatchType.EXACT && !hierarchy.hasAll() && rootMembers.length > 0) {
    searchMember=hierarchy.createMember(null,rootMembers[0].getLevel(),memberName,null);
  }
  int bestMatch=-1;
  for (int i=0; i < rootMembers.length; i++) {
    int rc;
    if (matchType == MatchType.EXACT || hierarchy.hasAll()) {
      rc=rootMembers[i].getName().compareToIgnoreCase(memberName);
    }
 else {
      rc=FunUtil.compareSiblingMembers(rootMembers[i],searchMember);
    }
    if (rc == 0) {
      return rootMembers[i];
    }
    if (!hierarchy.hasAll()) {
      if (matchType == MatchType.BEFORE) {
        if (rc < 0 && (bestMatch == -1 || FunUtil.compareSiblingMembers(rootMembers[i],rootMembers[bestMatch]) > 0)) {
          bestMatch=i;
        }
      }
 else       if (matchType == MatchType.AFTER) {
        if (rc > 0 && (bestMatch == -1 || FunUtil.compareSiblingMembers(rootMembers[i],rootMembers[bestMatch]) < 0)) {
          bestMatch=i;
        }
      }
    }
  }
  if (matchType != MatchType.EXACT && bestMatch != -1) {
    return rootMembers[bestMatch];
  }
  return (rootMembers.length == 1 && rootMembers[0].isAll()) ? reader.lookupMemberChildByName(rootMembers[0],memberName,matchType) : null;
}
Program: 51458
Project: 51458
Buggy source:
Query createQuery(MondrianCubeView cubeView) throws OLAPException {
  final QueryAxis[] queryAxes=new QueryAxis[cubeView.getOrdinateEdge().size()];
  for (int i=0; i < queryAxes.length; i++) {
    queryAxes[i]=convert((MondrianEdgeView)cubeView.getOrdinateEdge().get(i),i);
  }
  final Exp slicer=null;
  final QueryPart[] cellProps=new QueryPart[0];
  final Parameter[] parameters=new Parameter[0];
  final MondrianJolapCube mondrianJolapCube=(MondrianJolapCube)cubeView.cube;
  if (mondrianJolapCube == null) {
    throw new OLAPException("String_Node_Str" + cubeView + "String_Node_Str");
  }
  final Query query=new Query(cubeView.connection.mondrianConnection,mondrianJolapCube.cube,new Formula[0],queryAxes,slicer,cellProps,parameters,false);
  return query;
}

Fixed version (ground truth):
Query createQuery(MondrianCubeView cubeView) throws OLAPException {
  final QueryAxis[] queryAxes=new QueryAxis[cubeView.getOrdinateEdge().size()];
  for (int i=0; i < queryAxes.length; i++) {
    queryAxes[i]=convert((MondrianEdgeView)cubeView.getOrdinateEdge().get(i),i);
  }
  final QueryAxis slicerAxis=null;
  final QueryPart[] cellProps=new QueryPart[0];
  final Parameter[] parameters=new Parameter[0];
  final MondrianJolapCube mondrianJolapCube=(MondrianJolapCube)cubeView.cube;
  if (mondrianJolapCube == null) {
    throw new OLAPException("String_Node_Str" + cubeView + "String_Node_Str");
  }
  final Query query=new Query(cubeView.connection.mondrianConnection,mondrianJolapCube.cube,new Formula[0],queryAxes,slicerAxis,cellProps,parameters,false);
  return query;
}
Program: 51459
Project: 51459
Buggy source:
public Object getParameterValue(ParameterSlot slot){
  final int index=slot.getIndex();
  Object value=slot.getParameterValue();
  if (value != null) {
    return value;
  }
  Parameter.Scope scope=slot.getParameter().getScope();
switch (scope.getOrdinal()) {
case Parameter.Scope.System_ordinal:
case Parameter.Scope.Schema_ordinal:
case Parameter.Scope.Connection_ordinal:
case Parameter.Scope.Statement_ordinal:
    break;
default :
  throw scope.unexpected();
}
value=slot.getCachedDefaultValue();
if (value != null) {
if (value == Sentinel) {
  throw MondrianResource.instance().CycleDuringParameterEvaluation.ex(slot.getParameter().getName());
}
return value;
}
slot.setCachedDefaultValue(Sentinel);
value=result.evaluateExp(slot.getDefaultValueCalc(),slicerEvaluator.push());
slot.setCachedDefaultValue(value);
return value;
}

Fixed version (ground truth):
public Object getParameterValue(ParameterSlot slot){
  Object value=slot.getParameterValue();
  if (value != null) {
    return value;
  }
  Parameter.Scope scope=slot.getParameter().getScope();
switch (scope.getOrdinal()) {
case Parameter.Scope.System_ordinal:
case Parameter.Scope.Schema_ordinal:
case Parameter.Scope.Connection_ordinal:
case Parameter.Scope.Statement_ordinal:
    break;
default :
  throw scope.unexpected();
}
value=slot.getCachedDefaultValue();
if (value != null) {
if (value == Sentinel) {
  throw MondrianResource.instance().CycleDuringParameterEvaluation.ex(slot.getParameter().getName());
}
return value;
}
slot.setCachedDefaultValue(Sentinel);
value=result.evaluateExp(slot.getDefaultValueCalc(),slicerEvaluator.push());
slot.setCachedDefaultValue(value);
return value;
}
Program: 51460
Project: 51460
Buggy source:
protected Object evaluateNamedSet(String name,Exp exp){
  Object value=namedSetValues.get(name);
  if (value == null) {
    final RolapEvaluator.RolapEvaluatorRoot root=((RolapEvaluator)slicerEvaluator).root;
    final Calc calc=root.getCompiled(exp,false);
    value=result.evaluateExp(calc,slicerEvaluator.push());
    namedSetValues.put(name,value);
  }
  return value;
}

Fixed version (ground truth):
protected Object evaluateNamedSet(String name,Exp exp){
  Object value=namedSetValues.get(name);
  if (value == null) {
    final RolapEvaluator.RolapEvaluatorRoot root=((RolapEvaluator)slicerEvaluator).root;
    final Calc calc=root.getCompiled(exp,false);
    List list=(List)result.evaluateExp(calc,slicerEvaluator.push());
    value=Collections.unmodifiableList(list);
    namedSetValues.put(name,value);
  }
  return value;
}
Program: 51463
Project: 51463
Buggy source:
public BitKey emptyCopy(){
  return new Big(size());
}

Fixed version (ground truth):
public BitKey emptyCopy(){
  return new Big(bits.length << ChunkBitCount);
}
Program: 51464
Project: 51464
Buggy source:
public Object execute(Evaluator evaluator,Argument[] arguments){
  final Argument memberListExp=arguments[0];
  final List memberList=(List)memberListExp.evaluate(evaluator);
  final Argument exp=arguments[1];
  for (int i=memberList.size() - 1; i >= 0; --i) {
    Member member=(Member)memberList.get(i);
    Evaluator subEvaluator=evaluator.push(member);
    final Object o=exp.evaluateScalar(subEvaluator);
    if (Util.isNull(o)) {
      continue;
    }
    if (o instanceof RuntimeException) {
      RuntimeException runtimeException=(RuntimeException)o;
      if (o == RolapUtil.valueNotReadyException) {
        continue;
      }
      return runtimeException;
    }
    return member;
  }
  final Hierarchy hierarchy=memberListExp.getType().getHierarchy();
  return (hierarchy == null) ? memberListExp.getType().getDimension().getHierarchies()[0].getNullMember() : hierarchy.getNullMember();
}

Fixed version (ground truth):
public Object execute(Evaluator evaluator,Argument[] arguments){
  final Argument memberListExp=arguments[0];
  final List memberList=(List)memberListExp.evaluate(evaluator);
  final Argument exp=arguments[1];
  int nullCount=0;
  int missCount=0;
  for (int i=memberList.size() - 1; i >= 0; --i) {
    Member member=(Member)memberList.get(i);
    Evaluator subEvaluator=evaluator.push(member);
    int missCountBefore=subEvaluator.getMissCount();
    final Object o=exp.evaluateScalar(subEvaluator);
    int missCountAfter=subEvaluator.getMissCount();
    if (Util.isNull(o)) {
      ++nullCount;
      continue;
    }
    if (missCountAfter > missCountBefore) {
      ++missCount;
      if (missCount < nullCount) {
        continue;
      }
    }
    if (o instanceof RuntimeException) {
      RuntimeException runtimeException=(RuntimeException)o;
      if (o == RolapUtil.valueNotReadyException) {
        continue;
      }
      return runtimeException;
    }
    return member;
  }
  final Hierarchy hierarchy=memberListExp.getType().getHierarchy();
  return (hierarchy == null) ? memberListExp.getType().getDimension().getHierarchies()[0].getNullMember() : hierarchy.getNullMember();
}
Program: 51468
Project: 51468
Buggy source:
/** 
 * Get a Connection given the Datasource, catalogUrl and user role. 
 * @param ds 
 * @param catalogUrl 
 * @param role 
 * @return 
 * @throws XmlaException 
 */
Connection getConnection(DataSourcesConfig.DataSource ds,String catalogUrl,String role) throws XmlaException {
  Util.PropertyList connectProperties=Util.parseConnectString(ds.getDataSourceInfo());
  catalogUrl=catalogLocator.locate(catalogUrl);
  if (LOGGER.isDebugEnabled()) {
    if (catalogUrl == null) {
      LOGGER.debug("String_Node_Str");
    }
 else {
      LOGGER.debug("String_Node_Str" + catalogUrl);
    }
  }
  connectProperties.put("String_Node_Str",catalogUrl);
  if (!DataSourcesConfig.DataSource.AUTH_MODE_UNAUTHENTICATED.equalsIgnoreCase(ds.getAuthenticationMode()) && null == role) {
    throw new XmlaException(CLIENT_FAULT_FC,HSB_ACCESS_DENIED_CODE,HSB_ACCESS_DENIED_FAULT_FS,new SecurityException("String_Node_Str"));
  }
  connectProperties.put("String_Node_Str",role);
  RolapConnection conn=(RolapConnection)DriverManager.getConnection(connectProperties,null,false);
  return conn;
}

Fixed version (ground truth):
/** 
 * Get a Connection given the Datasource, catalogUrl and user role. 
 * @param ds 
 * @param catalogUrl 
 * @param role 
 * @return 
 * @throws XmlaException 
 */
protected Connection getConnection(DataSourcesConfig.DataSource ds,String catalogUrl,String role) throws XmlaException {
  Util.PropertyList connectProperties=Util.parseConnectString(ds.getDataSourceInfo());
  catalogUrl=catalogLocator.locate(catalogUrl);
  if (LOGGER.isDebugEnabled()) {
    if (catalogUrl == null) {
      LOGGER.debug("String_Node_Str");
    }
 else {
      LOGGER.debug("String_Node_Str" + catalogUrl);
    }
  }
  connectProperties.put("String_Node_Str",catalogUrl);
  if (!DataSourcesConfig.DataSource.AUTH_MODE_UNAUTHENTICATED.equalsIgnoreCase(ds.getAuthenticationMode()) && null == role) {
    throw new XmlaException(CLIENT_FAULT_FC,HSB_ACCESS_DENIED_CODE,HSB_ACCESS_DENIED_FAULT_FS,new SecurityException("String_Node_Str"));
  }
  connectProperties.put("String_Node_Str",role);
  RolapConnection conn=(RolapConnection)DriverManager.getConnection(connectProperties,null,false);
  return conn;
}
Program: 51470
Project: 51470
Buggy source:
public QueryAxis(boolean nonEmpty,Exp set,AxisOrdinal axisDef,int showSubtotals,Id[] dimensionProperties){
}

Fixed version (ground truth):
/** 
 * Creates an axis with no dimension properties.
 * @see #QueryAxis(boolean,Exp,AxisOrdinal,int,Id[])
 */
public QueryAxis(boolean nonEmpty,Exp set,AxisOrdinal axisDef,int showSubtotals){
  this(nonEmpty,set,axisDef,showSubtotals,new Id[0]);
}
Program: 51472
Project: 51472
Buggy source:
/** 
 * Internally the AggStars are added in sort order, smallest row count to biggest where ties do not matter.
 */
public void addAggStar(AggStar aggStar){
  if (aggStars == Collections.EMPTY_LIST) {
    aggStars=new LinkedList();
    aggStars.add(aggStar);
  }
 else {
    int size=aggStar.getSize();
    ListIterator lit=aggStars.listIterator();
    while (lit.hasNext()) {
      AggStar as=(AggStar)lit.next();
      if (as.getSize() >= size) {
        break;
      }
    }
    lit.previous();
    lit.add(aggStar);
  }
}

Fixed version (ground truth):
/** 
 * Adds an   {@link AggStar} to this star.<p>Internally the AggStars are added in sort order, smallest row count to biggest, so that the most efficient AggStar is encountered first; ties do not matter.
 */
public void addAggStar(AggStar aggStar){
  if (aggStars == Collections.EMPTY_LIST) {
    aggStars=new LinkedList();
  }
  int size=aggStar.getSize();
  ListIterator lit=aggStars.listIterator();
  while (lit.hasNext()) {
    AggStar as=(AggStar)lit.next();
    if (as.getSize() >= size) {
      lit.previous();
      lit.add(aggStar);
      return;
    }
  }
  aggStars.add(aggStar);
}
Program: 51474
Project: 51474
Buggy source:
public void unparse(PrintWriter pw){
  if (isMember) {
    pw.print("String_Node_Str");
    pw.print(mdxMember.getUniqueName());
  }
 else {
    pw.print("String_Node_Str");
    pw.print(Util.quoteMdxIdentifier(names));
  }
  pw.print("String_Node_Str");
  exp.unparse(pw);
  pw.print("String_Node_Str");
  if (memberProperties != null) {
    for (int i=0; i < memberProperties.length; i++) {
      pw.print("String_Node_Str");
      memberProperties[i].unparse(pw);
    }
  }
}

Fixed version (ground truth):
public void unparse(PrintWriter pw){
  if (isMember) {
    pw.print("String_Node_Str");
    if (mdxMember != null) {
      pw.print(mdxMember.getUniqueName());
    }
 else {
      pw.print(Util.quoteMdxIdentifier(names));
    }
  }
 else {
    pw.print("String_Node_Str");
    pw.print(Util.quoteMdxIdentifier(names));
  }
  pw.print("String_Node_Str");
  exp.unparse(pw);
  pw.print("String_Node_Str");
  if (memberProperties != null) {
    for (int i=0; i < memberProperties.length; i++) {
      pw.print("String_Node_Str");
      memberProperties[i].unparse(pw);
    }
  }
}
Program: 51475
Project: 51475
Buggy source:
public void testMultipleAxes() throws Exception {
  ParserData data=new ParserData();
  Parser p=new TestParser(data);
  String query="String_Node_Str" + "String_Node_Str";
  assertNull("String_Node_Str",p.parseInternal(null,query,false,funTable));
  QueryAxis[] axes=data.getAxes();
  assertEquals("String_Node_Str",2,axes.length);
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(0),axes[0].getAxisName());
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(1),axes[1].getAxisName());
  query="String_Node_Str" + "String_Node_Str";
  assertEquals("String_Node_Str",2,axes.length);
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(0),axes[0].getAxisName());
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(1),axes[1].getAxisName());
  Exp colsSetExpr=axes[0].getSet();
  assertNotNull("String_Node_Str",colsSetExpr);
  UnresolvedFunCall fun=(UnresolvedFunCall)colsSetExpr;
  String id=((Id)(fun.getArgs()[0])).getElement(0);
  assertEquals("String_Node_Str","String_Node_Str",id);
  Exp rowsSetExpr=axes[1].getSet();
  assertNotNull("String_Node_Str",rowsSetExpr);
  fun=(UnresolvedFunCall)rowsSetExpr;
  id=((Id)(fun.getArgs()[0])).getElement(0);
  assertEquals("String_Node_Str","String_Node_Str",id);
}

Fixed version (ground truth):
public void testMultipleAxes() throws Exception {
  Parser p=new TestParser();
  String query="String_Node_Str" + "String_Node_Str";
  assertNull("String_Node_Str",p.parseInternal(null,query,false,funTable));
  QueryAxis[] axes=((TestParser)p).getAxes();
  assertEquals("String_Node_Str",2,axes.length);
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(0),axes[0].getAxisName());
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(1),axes[1].getAxisName());
  query="String_Node_Str" + "String_Node_Str";
  assertEquals("String_Node_Str",2,axes.length);
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(0),axes[0].getAxisName());
  assertEquals("String_Node_Str",AxisOrdinal.enumeration.getName(1),axes[1].getAxisName());
  Exp colsSetExpr=axes[0].getSet();
  assertNotNull("String_Node_Str",colsSetExpr);
  UnresolvedFunCall fun=(UnresolvedFunCall)colsSetExpr;
  String id=((Id)(fun.getArgs()[0])).getElement(0);
  assertEquals("String_Node_Str","String_Node_Str",id);
  Exp rowsSetExpr=axes[1].getSet();
  assertNotNull("String_Node_Str",rowsSetExpr);
  fun=(UnresolvedFunCall)rowsSetExpr;
  id=((Id)(fun.getArgs()[0])).getElement(0);
  assertEquals("String_Node_Str","String_Node_Str",id);
}
Program: 51476
Project: 51476
Buggy source:
protected Query makeQuery(Formula[] formulae,QueryAxis[] axes,String cube,Exp slicer,QueryPart[] cellProps){
  parserData.setFormulae(formulae);
  parserData.setAxes(axes);
  parserData.setCube(cube);
  parserData.setSlicer(slicer);
  parserData.setCellProps(cellProps);
  return null;
}

Fixed version (ground truth):
protected Query makeQuery(Formula[] formulae,QueryAxis[] axes,String cube,Exp slicer,QueryPart[] cellProps){
  setFormulas(formulae);
  setAxes(axes);
  setCube(cube);
  setSlicer(slicer);
  setCellProps(cellProps);
  return null;
}
Program: 51477
Project: 51477
Buggy source:
private void checkAxis(String s,String expectedName){
  ParserData data=new ParserData();
  Parser p=new TestParser(data);
  String q="String_Node_Str" + s + "String_Node_Str";
  Query query=p.parseInternal(null,q,false,funTable);
  assertNull("String_Node_Str",query);
  QueryAxis[] axes=data.getAxes();
  assertEquals("String_Node_Str",1,axes.length);
  assertEquals("String_Node_Str",expectedName,axes[0].getAxisName());
}

Fixed version (ground truth):
private void checkAxis(String s,String expectedName){
  Parser p=new TestParser();
  String q="String_Node_Str" + s + "String_Node_Str";
  Query query=p.parseInternal(null,q,false,funTable);
  assertNull("String_Node_Str",query);
  QueryAxis[] axes=((TestParser)p).getAxes();
  assertEquals("String_Node_Str",1,axes.length);
  assertEquals("String_Node_Str",expectedName,axes[0].getAxisName());
}
Program: 51478
Project: 51478
Buggy source:
public TestParser(ParserData pd){
  super();
  parserData=pd;
}

Fixed version (ground truth):
public TestParser(){
  super();
}