nus-yam/ex-repair huggingface dataset:
Program: 51626
Project: 51626
Buggy source:
protected int compareHierarchicallyButSiblingsByValue(Member m1,Member m2){
  if (m1.equals(m2)) {
    return 0;
  }
  while (true) {
    int levelDepth1=m1.getLevel().getDepth(), levelDepth2=m2.getLevel().getDepth();
    if (levelDepth1 < levelDepth2) {
      m2=m2.getParentMember();
      if (m1.equals(m2)) {
        return -1;
      }
    }
 else     if (levelDepth1 > levelDepth2) {
      m1=m1.getParentMember();
      if (m1.equals(m2)) {
        return 1;
      }
    }
 else {
      Member prev1=m1, prev2=m2;
      m1=m1.getParentMember();
      m2=m2.getParentMember();
      if (m1.equals(m2)) {
        int c=compareByValue(prev1,prev2);
        if (c == 0) {
          c=FunUtil.compareValues(prev1.getCaption(),prev2.getCaption());
        }
        return desc ? -c : c;
      }
    }
  }
}

Fixed version (ground truth):
protected int compareHierarchicallyButSiblingsByValue(Member m1,Member m2){
  if (FunUtil.equals(m1,m2)) {
    return 0;
  }
  while (true) {
    int levelDepth1=m1.getLevel().getDepth(), levelDepth2=m2.getLevel().getDepth();
    if (levelDepth1 < levelDepth2) {
      m2=m2.getParentMember();
      if (FunUtil.equals(m1,m2)) {
        return -1;
      }
    }
 else     if (levelDepth1 > levelDepth2) {
      m1=m1.getParentMember();
      if (FunUtil.equals(m1,m2)) {
        return 1;
      }
    }
 else {
      Member prev1=m1, prev2=m2;
      m1=m1.getParentMember();
      m2=m2.getParentMember();
      if (FunUtil.equals(m1,m2)) {
        int c=compareByValue(prev1,prev2);
        if (c == 0) {
          c=FunUtil.compareValues(prev1.getCaption(),prev2.getCaption());
        }
        return desc ? -c : c;
      }
    }
  }
}
Program: 51628
Project: 51628
Buggy source:
public int getMemberDepth(Member member){
  final Role.HierarchyAccess hierarchyAccess=role.getAccessDetails(member.getHierarchy());
  if (hierarchyAccess != null) {
    int memberDepth=member.getLevel().getDepth();
    final Level topLevel=hierarchyAccess.getTopLevel();
    if (topLevel != null) {
      memberDepth-=topLevel.getDepth();
    }
    return memberDepth;
  }
 else   if (((RolapLevel)member.getLevel()).parentExp != null) {
    int depth=0;
    for (Member m=member; m != null; m=m.getParentMember()) {
      depth++;
    }
    return depth;
  }
 else {
    return member.getLevel().getDepth();
  }
}

Fixed version (ground truth):
public int getMemberDepth(Member member){
  final Role.HierarchyAccess hierarchyAccess=role.getAccessDetails(member.getHierarchy());
  if (hierarchyAccess != null) {
    int memberDepth=member.getLevel().getDepth();
    final Level topLevel=hierarchyAccess.getTopLevel();
    if (topLevel != null) {
      memberDepth-=topLevel.getDepth();
    }
    return memberDepth;
  }
 else   if (((RolapLevel)member.getLevel()).parentExp != null) {
    int depth=0;
    for (Member m=member.getParentMember(); m != null; m=m.getParentMember()) {
      depth++;
    }
    return depth;
  }
 else {
    return member.getLevel().getDepth();
  }
}
Program: 51629
Project: 51629
Buggy source:
/** 
 * Enables tracing if "mondrian.trace.level" &gt; 0.
 */
public static void checkTracing(){
  int trace=MondrianProperties.instance().getTraceLevel();
  if (trace > 0) {
    debugOut=new PrintWriter(System.out,true);
  }
}

Fixed version (ground truth):
/** 
 * Enables tracing if "mondrian.trace.level" &gt; 0.
 */
public static void checkTracing(){
  if (debugOut == null) {
    int trace=MondrianProperties.instance().getTraceLevel();
    if (trace > 0) {
      String debugOutFile=MondrianProperties.instance().getProperty(MondrianProperties.DebugOutFile);
      if (debugOutFile != null) {
        File f;
        try {
          f=new File(debugOutFile);
          debugOut=new PrintWriter(new FileOutputStream(f),true);
        }
 catch (        Exception e) {
        }
      }
      if (debugOut == null)       debugOut=new PrintWriter(System.out,true);
    }
  }
}
Program: 51630
Project: 51630
Buggy source:
/** 
 * Checks that a postcondition (declared using the javadoc <code>@post</code> tag) is satisfied.
 */
public static void assertPostcondition(boolean b){
  assertTrue(b);
}

Fixed version (ground truth):
/** 
 * Checks that a postcondition (declared using the javadoc <code>@post</code> tag) is satisfied.
 * @param b The value of executing the condition
 */
public static void assertPostcondition(boolean b,String condition){
  assertTrue(b,condition);
}
Program: 51631
Project: 51631
Buggy source:
/** 
 * Checks that a precondition (declared using the javadoc <code>@pre</code> tag) is satisfied.
 */
public static void assertPrecondition(boolean b){
  assertTrue(b);
}

Fixed version (ground truth):
/** 
 * Checks that a precondition (declared using the javadoc <code>@pre</code> tag) is satisfied. For example, <blockquote><pre>void f(String s) { Util.assertPrecondition(s != null, "s != null"); ... }</pre></blockquote>
 * @param b The value of executing the condition
 * @param condition The text of the condition
 */
public static void assertPrecondition(boolean b,String condition){
  assertTrue(b,condition);
}
Program: 51632
Project: 51632
Buggy source:
public void testToggleDrillState2(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testToggleDrillState2(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51633
Project: 51633
Buggy source:
public void testToggleDrillState3(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testToggleDrillState3(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51634
Project: 51634
Buggy source:
public void testTopCount(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testTopCount(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51635
Project: 51635
Buggy source:
public void testOrderHierarchicalDesc(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testOrderHierarchicalDesc(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51636
Project: 51636
Buggy source:
public void testHierarchizeCrossJoinPost(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testHierarchizeCrossJoinPost(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51637
Project: 51637
Buggy source:
public void testUnion(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testUnion(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51638
Project: 51638
Buggy source:
public void testRangeBoundedByNull(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  test.assertTrue(axis.positions.length == 0);
}

Fixed version (ground truth):
public void testRangeBoundedByNull(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51639
Project: 51639
Buggy source:
public void testUnionTuple(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testUnionTuple(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51640
Project: 51640
Buggy source:
public void testHierarchize(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testHierarchize(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51641
Project: 51641
Buggy source:
public void testHierarchizePost(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testHierarchizePost(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51643
Project: 51643
Buggy source:
public void testTopPercent(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testTopPercent(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51644
Project: 51644
Buggy source:
public void testUnionEmptyBoth(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testUnionEmptyBoth(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51645
Project: 51645
Buggy source:
public void testOrderCrossJoinDesc(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testOrderCrossJoinDesc(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51646
Project: 51646
Buggy source:
public void testBottomSum(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testBottomSum(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51647
Project: 51647
Buggy source:
public void testHierarchizeCrossJoinPre(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testHierarchizeCrossJoinPre(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51648
Project: 51648
Buggy source:
public void testToggleDrillStateTuple(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testToggleDrillStateTuple(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51649
Project: 51649
Buggy source:
public void testRange(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testRange(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51650
Project: 51650
Buggy source:
public void testUnionEmptyRight(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testUnionEmptyRight(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51651
Project: 51651
Buggy source:
/** 
 * Resolves a function call to a particular function. If the function is overloaded, returns as precise a match to the argument types as possible.
 */
public FunDef getDef(FunCall call){
  boolean bIgnoreCase=true;
  String name=call.getFunName();
  String upperName=name.toUpperCase();
  String signature=call.getSignature();
  Resolver[] resolvers=(Resolver[])upperName2Resolvers.get(upperName);
  if (resolvers == null) {
    resolvers=emptyResolvers;
  }
  int[] conversionCount=new int[1];
  int minConversions=Integer.MAX_VALUE;
  int matchCount=0;
  FunDef matchDef=null;
  for (int i=0; i < resolvers.length; i++) {
    conversionCount[0]=0;
    FunDef def=resolvers[i].resolve(call.getSyntacticType(),call.args,conversionCount);
    if (def != null) {
      int conversions=conversionCount[0];
      if (conversions < minConversions) {
        minConversions=conversions;
        matchCount=1;
        matchDef=def;
      }
 else       if (conversions == minConversions) {
        matchCount++;
      }
 else {
      }
    }
  }
switch (matchCount) {
case 0:
    throw Util.newInternal("String_Node_Str" + signature + "String_Node_Str");
case 1:
  return matchDef;
default :
throw Util.newInternal("String_Node_Str" + signature + "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Resolves a function call to a particular function. If the function is overloaded, returns as precise a match to the argument types as possible.
 */
public FunDef getDef(FunCall call){
  String name=call.getFunName();
  String upperName=name.toUpperCase();
  String signature=call.getSignature();
  Resolver[] resolvers=(Resolver[])upperName2Resolvers.get(upperName);
  if (resolvers == null) {
    resolvers=emptyResolvers;
  }
  int[] conversionCount=new int[1];
  int minConversions=Integer.MAX_VALUE;
  int matchCount=0;
  FunDef matchDef=null;
  for (int i=0; i < resolvers.length; i++) {
    conversionCount[0]=0;
    FunDef def=resolvers[i].resolve(call.getSyntacticType(),call.args,conversionCount);
    if (def != null) {
      int conversions=conversionCount[0];
      if (conversions < minConversions) {
        minConversions=conversions;
        matchCount=1;
        matchDef=def;
      }
 else       if (conversions == minConversions) {
        matchCount++;
      }
 else {
      }
    }
  }
switch (matchCount) {
case 0:
    throw Util.newInternal("String_Node_Str" + signature + "String_Node_Str");
case 1:
  return matchDef;
default :
throw Util.newInternal("String_Node_Str" + signature + "String_Node_Str");
}
}
Program: 51652
Project: 51652
Buggy source:
public void testBottomCount(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testBottomCount(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51653
Project: 51653
Buggy source:
public void testRangeBoundedByAll(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testRangeBoundedByAll(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51654
Project: 51654
Buggy source:
public void testTopSum(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testTopSum(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51655
Project: 51655
Buggy source:
public void testToggleDrillState(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testToggleDrillState(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51656
Project: 51656
Buggy source:
public void testRangeEndBeforeStart(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testRangeEndBeforeStart(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51657
Project: 51657
Buggy source:
public void testBottomPercent(FoodMartTestCase test){
  Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testBottomPercent(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51658
Project: 51658
Buggy source:
public void testRangeStartEqualsEnd(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testRangeStartEqualsEnd(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str");
}
Program: 51659
Project: 51659
Buggy source:
public void testUnionAll(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str");
  String expected="String_Node_Str" + nl + "String_Node_Str";
  test.assertEquals(expected,test.toString(axis.positions));
}

Fixed version (ground truth):
public void testUnionAll(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
}
Program: 51660
Project: 51660
Buggy source:
public void testCrossjoinNested(FoodMartTestCase test){
  final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
  test.assertEquals("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str",test.toString(axis.positions));
}

Fixed version (ground truth):
public void testCrossjoinNested(FoodMartTestCase test){
  test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
}
Program: 51661
Project: 51661
Buggy source:
public int compare(RolapMember m1,RolapMember m2,boolean siblingsAreEqual){
  if (m1 == m2) {
    return 0;
  }
  if (siblingsAreEqual && m1.getParentMember() == m2.getParentMember()) {
    return 0;
  }
  int pos1=-1, pos2=-1;
  for (int i=0; i < members.length; i++) {
    RolapMember member=members[i];
    if (member == m1) {
      pos1=i;
    }
    if (member == m2) {
      pos2=i;
    }
  }
  if (pos1 == -1) {
    throw Util.newInternal(m1 + "String_Node_Str");
  }
  if (pos2 == -1) {
    throw Util.newInternal(m2 + "String_Node_Str");
  }
  Util.assertTrue(pos1 != pos2);
  return pos1 < pos2 ? -1 : 1;
}

Fixed version (ground truth):
public int compare(RolapMember m1,RolapMember m2,boolean siblingsAreEqual){
  if (m1 == m2) {
    return 0;
  }
  if (siblingsAreEqual && m1.getParentMember() == m2.getParentMember()) {
    return 0;
  }
  Util.assertTrue(members[m1.ordinal] == m1);
  Util.assertTrue(members[m2.ordinal] == m2);
  return m1.ordinal < m2.ordinal ? -1 : 1;
}
Program: 51662
Project: 51662
Buggy source:
void init(){
  int max=-1;
  for (int i=0; i < dimensions.length; i++) {
    final RolapDimension dimension=(RolapDimension)dimensions[i];
    dimension.init(this);
    max=Math.max(max,dimension.getGlobalOrdinal());
  }
  this.localDimensionOrdinals=new int[max + 1];
  Arrays.fill(localDimensionOrdinals,-1);
  for (int i=0; i < dimensions.length; i++) {
    final RolapDimension dimension=(RolapDimension)dimensions[i];
    final int globalOrdinal=dimension.getGlobalOrdinal();
    Util.assertTrue(localDimensionOrdinals[globalOrdinal] == -1,"String_Node_Str" + globalOrdinal);
    localDimensionOrdinals[globalOrdinal]=i;
  }
  this.cellReader=AggregationManager.instance();
  if (false) {
    this.cellReader=new CachingCellReader(this,this.cellReader);
  }
  register();
}

Fixed version (ground truth):
void init(){
  int max=-1;
  for (int i=0; i < dimensions.length; i++) {
    final RolapDimension dimension=(RolapDimension)dimensions[i];
    dimension.init(this);
    max=Math.max(max,dimension.getGlobalOrdinal());
  }
  this.localDimensionOrdinals=new int[max + 1];
  Arrays.fill(localDimensionOrdinals,-1);
  for (int i=0; i < dimensions.length; i++) {
    final RolapDimension dimension=(RolapDimension)dimensions[i];
    final int globalOrdinal=dimension.getGlobalOrdinal();
    Util.assertTrue(localDimensionOrdinals[globalOrdinal] == -1,"String_Node_Str" + globalOrdinal);
    localDimensionOrdinals[globalOrdinal]=i;
  }
  this.cellReader=AggregationManager.instance();
  register();
}
Program: 51663
Project: 51663
Buggy source:
public int compare(RolapMember m1,RolapMember m2,boolean siblingsAreEqual){
  if (m1 == m2) {
    return 0;
  }
  if (m1.getParentMember() == m2.getParentMember()) {
    if (siblingsAreEqual) {
      return 0;
    }
 else {
      RolapMember[] children=getMemberChildren(new RolapMember[]{(RolapMember)m1.getParentMember()});
      int pos1=-1, pos2=-1;
      for (int i=0; i < children.length; i++) {
        RolapMember child=children[i];
        if (child == m1) {
          pos1=i;
        }
        if (child == m2) {
          pos2=i;
        }
      }
      if (pos1 == -1) {
        throw Util.newInternal(m1 + "String_Node_Str");
      }
      if (pos2 == -1) {
        throw Util.newInternal(m2 + "String_Node_Str");
      }
      Util.assertTrue(pos1 != pos2);
      return pos1 < pos2 ? -1 : 1;
    }
  }
  int levelDepth1=m1.getLevel().getDepth(), levelDepth2=m2.getLevel().getDepth();
  if (levelDepth1 < levelDepth2) {
    return compare(m1,(RolapMember)m2.getParentMember(),false);
  }
 else   if (levelDepth1 > levelDepth2) {
    return compare((RolapMember)m1.getParentMember(),m2,false);
  }
 else {
    return compare((RolapMember)m1.getParentMember(),(RolapMember)m2.getParentMember(),false);
  }
}

Fixed version (ground truth):
public int compare(RolapMember m1,RolapMember m2,boolean siblingsAreEqual){
  if (m1 == m2) {
    return 0;
  }
  if (m1.getParentMember() == m2.getParentMember()) {
    if (siblingsAreEqual) {
      return 0;
    }
 else {
      RolapMember[] children=getMemberChildren(new RolapMember[]{(RolapMember)m1.getParentMember()});
      int pos1=-1, pos2=-1;
      for (int i=0; i < children.length; i++) {
        RolapMember child=children[i];
        if (child == m1) {
          pos1=i;
        }
        if (child == m2) {
          pos2=i;
        }
      }
      if (pos1 == -1) {
        throw Util.newInternal(m1 + "String_Node_Str");
      }
      if (pos2 == -1) {
        throw Util.newInternal(m2 + "String_Node_Str");
      }
      Util.assertTrue(pos1 != pos2);
      return pos1 < pos2 ? -1 : 1;
    }
  }
  int levelDepth1=m1.getLevel().getDepth(), levelDepth2=m2.getLevel().getDepth();
  if (levelDepth1 < levelDepth2) {
    final int c=compare(m1,(RolapMember)m2.getParentMember(),false);
    return (c == 0) ? -1 : c;
  }
 else   if (levelDepth1 > levelDepth2) {
    final int c=compare((RolapMember)m1.getParentMember(),m2,false);
    return (c == 0) ? 1 : c;
  }
 else {
    return compare((RolapMember)m1.getParentMember(),(RolapMember)m2.getParentMember(),false);
  }
}
Program: 51664
Project: 51664
Buggy source:
public void getMemberRange(RolapLevel level,RolapMember startMember,RolapMember endMember,List list){
  int startOrdinal=startMember.ordinal;
  int endOrdinal=endMember.ordinal + 1;
  RolapMember m=endMember;
  while (m != null) {
    if (m.ordinal < startMember.ordinal) {
      break;
    }
  }
  final RolapMember[] descendants=getDescendants(m,startMember.getLevel(),startOrdinal,endOrdinal);
  for (int i=0; i < descendants.length; i++) {
    list.add(descendants[i]);
  }
}

Fixed version (ground truth):
public void getMemberRange(RolapLevel level,RolapMember startMember,RolapMember endMember,List list){
  Util.assertPrecondition(startMember != null,"String_Node_Str");
  Util.assertPrecondition(endMember != null,"String_Node_Str");
  Util.assertPrecondition(startMember.getLevel() == endMember.getLevel(),"String_Node_Str");
  if (compare(startMember,endMember,false) > 0) {
    return;
  }
  list.add(startMember);
  if (startMember == endMember) {
    return;
  }
  SiblingIterator siblings=new SiblingIterator(this,startMember);
  while (siblings.hasNext()) {
    final RolapMember member=siblings.nextMember();
    list.add(member);
    if (member == endMember) {
      return;
    }
  }
  throw Util.newInternal("String_Node_Str" + startMember + "String_Node_Str"+ endMember);
}
Program: 51665
Project: 51665
Buggy source:
/** 
 * Reads the children of <code>member</code> into cache, and also into <code>result</code>.
 */
private void readMemberChildren(ArrayList result,RolapMember[] members){
  RolapMember[] children=source.getMemberChildren(members);
  HashMap tempMap=new HashMap();
  for (int i=0; i < members.length; i++) {
    tempMap.put(members[i],new ArrayList());
  }
  for (int i=0; i < children.length; i++) {
    RolapMember child=children[i];
    ArrayList list=(ArrayList)tempMap.get(child.getParentMember());
    list.add(child);
    result.add(child);
  }
synchronized (this) {
    for (Iterator keys=tempMap.keySet().iterator(); keys.hasNext(); ) {
      RolapMember member=(RolapMember)keys.next();
      ArrayList list=(ArrayList)tempMap.get(member);
      if (!hasChildren(member)) {
        putChildren(member,list);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Reads the children of <code>member</code> into cache, and also into <code>result</code>.
 * @param result Children are written here, in order
 * @param members Members whose children to read
 * @pre isSorted(members)
 */
private void readMemberChildren(ArrayList result,RolapMember[] members){
  Util.assertPrecondition(isSorted(members),"String_Node_Str");
  RolapMember[] children=source.getMemberChildren(members);
  HashMap tempMap=new HashMap();
  for (int i=0; i < members.length; i++) {
    tempMap.put(members[i],new ArrayList());
  }
  for (int i=0; i < children.length; i++) {
    RolapMember child=children[i];
    ArrayList list=(ArrayList)tempMap.get(child.getParentMember());
    list.add(child);
    result.add(child);
  }
synchronized (this) {
    for (Iterator keys=tempMap.keySet().iterator(); keys.hasNext(); ) {
      RolapMember member=(RolapMember)keys.next();
      ArrayList list=(ArrayList)tempMap.get(member);
      if (!hasChildren(member)) {
        putChildren(member,list);
      }
    }
  }
}
Program: 51666
Project: 51666
Buggy source:
private void executeBody(Query query){
  cellValues=new HashMap();
  this.evaluator.cellReader=this.batchingReader;
  executeStripe(query.axes.length - 1);
  if (batchingReader.keys.isEmpty()) {
    return;
  }
  batchingReader.loadAggregations();
  batchingReader.clear();
  this.evaluator.cellReader=this.aggregatingReader;
  executeStripe(query.axes.length - 1);
}

Fixed version (ground truth):
private void executeBody(Query query){
  int count=0;
  while (true) {
    cellValues=new HashMap();
    this.evaluator.cellReader=this.batchingReader;
    executeStripe(query.axes.length - 1);
    if (batchingReader.keys.isEmpty()) {
      return;
    }
    if (count++ > 3) {
      throw Util.newInternal("String_Node_Str" + count + "String_Node_Str");
    }
    batchingReader.loadAggregations();
    batchingReader.clear();
  }
}
Program: 51667
Project: 51667
Buggy source:
/** 
 * Loads the aggregations which we will need. Writes the aggregations it loads (and pins) into <code>pinned</code>; the caller must pass this to   {@link CachePool#unpin(Collection)}. 
 */
void loadAggregations(){
  AggregationManager.instance().loadAggregations(keys,pinnedSegments);
}

Fixed version (ground truth):
/** 
 * Loads the aggregations which we will need. Writes the aggregations it loads (and pins) into <code>pinned</code>; the caller must pass this to   {@link CachePool#unpin(Collection)}. <h3>Design discussion</h3> <p>Do we group them by (a) level, or (b) the underlying columns they access.  I think the columns. <p>Maybe some or all of the group can be derived by rolling up.  We should probably roll up if possible (the danger is that we end up with a fragmented aggregation, which we hit many times). <p>If we roll up, do we also store?  I think so.  Then we can let the caching policy kick in.  (It gets interesting if we roll up, but do not store, part of an aggregation.) <p>For each group, extend the aggregation definition a bit, if it will help us roll up later.
 */
void loadAggregations(){
  AggregationManager.instance().loadAggregations(keys,pinnedSegments);
}
Program: 51668
Project: 51668
Buggy source:
private void executeStripe(int axis){
  if (axis < 0) {
    RolapAxis _axis=(RolapAxis)slicerAxis;
    int count=_axis.positions.length;
    for (int i=0; i < count; i++) {
      RolapPosition position=(RolapPosition)_axis.positions[i];
      for (int j=0; j < position.members.length; j++) {
        evaluator.setContext(position.members[j]);
      }
      Object o;
      try {
        o=evaluator.evaluateCurrent();
      }
 catch (      MondrianEvaluationException e) {
        o=e;
      }
      if (o != null && o != RolapUtil.valueNotReadyException) {
        CellKey key=point.copy();
        cellValues.put(key,o);
      }
    }
  }
 else {
    RolapAxis _axis=(RolapAxis)axes[axis];
    int count=_axis.positions.length;
    for (int i=0; i < count; i++) {
      point.ordinals[axis]=i;
      RolapPosition position=(RolapPosition)_axis.positions[i];
      for (int j=0; j < position.members.length; j++) {
        evaluator.setContext(position.members[j]);
      }
      executeStripe(axis - 1);
    }
  }
}

Fixed version (ground truth):
private void executeStripe(int axis){
  if (axis < 0) {
    RolapAxis _axis=(RolapAxis)slicerAxis;
    int count=_axis.positions.length;
    for (int i=0; i < count; i++) {
      RolapPosition position=(RolapPosition)_axis.positions[i];
      for (int j=0; j < position.members.length; j++) {
        evaluator.setContext(position.members[j]);
      }
      Object o;
      try {
        o=evaluator.evaluateCurrent();
      }
 catch (      MondrianEvaluationException e) {
        o=e;
      }
      if (o != null && o != RolapUtil.valueNotReadyException) {
        CellKey key=point.copy();
        cellValues.put(key,o);
        try {
          Util.discard(getCell(point.ordinals));
        }
 catch (        MondrianEvaluationException e) {
        }
catch (        Throwable e) {
          Util.discard(e);
        }
      }
    }
  }
 else {
    RolapAxis _axis=(RolapAxis)axes[axis];
    int count=_axis.positions.length;
    for (int i=0; i < count; i++) {
      point.ordinals[axis]=i;
      RolapPosition position=(RolapPosition)_axis.positions[i];
      for (int j=0; j < position.members.length; j++) {
        evaluator.setContext(position.members[j]);
      }
      executeStripe(axis - 1);
    }
  }
}
Program: 51669
Project: 51669
Buggy source:
/** 
 * A   {@link Cacheable} <em>must</em> call this from its<code>finalize</code> method.
 */
public void deregister(Cacheable cacheable,boolean fromFinalizer){
synchronized (this) {
    deregisterInternal(cacheable);
  }
  final SoftCacheableReference ref=new SoftCacheableReference(cacheable);
synchronized (this) {
    boolean existed=queue.remove(ref);
    Util.discard(existed);
  }
}

Fixed version (ground truth):
/** 
 * A   {@link Cacheable} <em>must</em> call this from its<code>finalize</code> method.
 */
public void deregister(Cacheable cacheable,boolean fromFinalizer){
  deregisterInternal(cacheable);
  final SoftCacheableReference ref=new SoftCacheableReference(cacheable);
synchronized (this) {
    boolean existed=queue.remove(ref);
    Util.discard(existed);
  }
}
Program: 51670
Project: 51670
Buggy source:
/** 
 * As   {@link #deregister}, but avoids synchronization overhead. <p><b>Note to developers</b>: This method must remain private and be called from a synchronized context.
 */
private void deregisterInternal(Cacheable cacheable){
  String id=cacheableId(cacheable);
  Double registeredCost=(Double)this.mapCacheableIdToCost.remove(id);
  if (registeredCost == null) {
    return;
  }
  double cost=cacheable.getCost();
  if (cost != registeredCost.doubleValue()) {
    throw Util.newInternal(id + "String_Node_Str" + cost+ "String_Node_Str"+ registeredCost);
  }
  unpinnedCost-=cost;
  Util.assertTrue(cacheable.getPinCount() == 0);
  cacheable.removeFromCache();
  if (RolapUtil.debugOut != null) {
    RolapUtil.debugOut.println("String_Node_Str" + cacheable + "String_Node_Str"+ cost+ "String_Node_Str"+ size()+ "String_Node_Str"+ unpinnedCost);
  }
}

Fixed version (ground truth):
/** 
 * As   {@link #deregister}, but avoids synchronization overhead. <p><b>Note to developers</b>: This method must remain private and be called from a synchronized context.
 */
private void deregisterInternal(Cacheable cacheable){
  String id=cacheableId(cacheable);
  final double cost;
synchronized (this) {
    Double registeredCost=(Double)this.mapCacheableIdToCost.remove(id);
    if (registeredCost == null) {
      return;
    }
    cost=cacheable.getCost();
    if (cost != registeredCost.doubleValue()) {
      throw Util.newInternal(id + "String_Node_Str" + cost+ "String_Node_Str"+ registeredCost);
    }
    unpinnedCost-=cost;
  }
  Util.assertTrue(cacheable.getPinCount() == 0);
  cacheable.removeFromCache();
  if (RolapUtil.debugOut != null) {
    RolapUtil.debugOut.println("String_Node_Str" + cacheable + "String_Node_Str"+ cost+ "String_Node_Str"+ size()+ "String_Node_Str"+ unpinnedCost);
  }
}
Program: 51671
Project: 51671
Buggy source:
boolean remove(Object o){
  return list.remove(o);
}

Fixed version (ground truth):
/** 
 * @synchronization lock the cache 
 */
boolean remove(Object o){
  return list.remove(o);
}
Program: 51672
Project: 51672
Buggy source:
void add(Object o){
  for (int i=0; i < list.size(); i++) {
    Object o2=list.get(i);
    if (comparator.compare(o,o2) < 0) {
      list.add(i,o);
      return;
    }
  }
  list.add(o);
}

Fixed version (ground truth):
/** 
 * @synchronization lock the cache 
 */
void add(Object o){
  for (int i=0; i < list.size(); i++) {
    Object o2=list.get(i);
    if (comparator.compare(o,o2) < 0) {
      list.add(i,o);
      return;
    }
  }
  list.add(o);
}
Program: 51673
Project: 51673
Buggy source:
/** 
 * A   {@link Cacheable} <em>must</em> call this from its<code>finalize</code> method.
 */
public void deregister(Cacheable cacheable,boolean fromFinalizer){
synchronized (this) {
    deregisterInternal(cacheable);
  }
  boolean existed=queue.remove(new SoftCacheableReference(cacheable));
  Util.discard(existed);
}

Fixed version (ground truth):
/** 
 * A   {@link Cacheable} <em>must</em> call this from its<code>finalize</code> method.
 */
public void deregister(Cacheable cacheable,boolean fromFinalizer){
synchronized (this) {
    deregisterInternal(cacheable);
  }
  final SoftCacheableReference ref=new SoftCacheableReference(cacheable);
synchronized (this) {
    boolean existed=queue.remove(ref);
    Util.discard(existed);
  }
}
Program: 51674
Project: 51674
Buggy source:
/** 
 * Generates the SQL statement to access the children of <code>member</code>. For example, <blockquote> <pre>SELECT "city" FROM "customer" WHERE "country" = 'USA' AND "state_province" = 'BC' GROUP BY "city"</pre> </blockquote> retrieves the children of the member <code>[Canada].[BC]</code>. See also   {@link #makeLevelSql}.
 */
String makeChildMemberSql(RolapMember member){
  SqlQuery sqlQuery=newQuery("String_Node_Str" + member);
  for (RolapMember m=member; m != null; m=(RolapMember)m.getParentMember()) {
    RolapLevel level=(RolapLevel)m.getLevel();
    if (level.isAll()) {
      continue;
    }
    String q=level.nameExp.getExpression(sqlQuery);
    sqlQuery.addWhere(q + "String_Node_Str" + m.quoteKeyForSql());
    if (level.unique) {
      break;
    }
  }
  RolapLevel[] levels=(RolapLevel[])hierarchy.getLevels();
  RolapLevel level=levels[member.getLevel().getDepth() + 1];
  hierarchy.addToFrom(sqlQuery,level.nameExp,null);
  String q=level.nameExp.getExpression(sqlQuery);
  sqlQuery.addSelect(q);
  sqlQuery.addGroupBy(q);
  hierarchy.addToFrom(sqlQuery,level.ordinalExp,null);
  String orderBy=level.ordinalExp.getExpression(sqlQuery);
  sqlQuery.addOrderBy(orderBy);
  if (!orderBy.equals(q)) {
    sqlQuery.addGroupBy(orderBy);
  }
  return sqlQuery.toString();
}

Fixed version (ground truth):
/** 
 * Generates the SQL statement to access the children of <code>member</code>. For example, <blockquote> <pre>SELECT "city" FROM "customer" WHERE "country" = 'USA' AND "state_province" = 'BC' GROUP BY "city"</pre> </blockquote> retrieves the children of the member <code>[Canada].[BC]</code>. See also   {@link #makeLevelSql}.
 */
String makeChildMemberSql(RolapMember member){
  SqlQuery sqlQuery=newQuery("String_Node_Str" + member);
  for (RolapMember m=member; m != null; m=(RolapMember)m.getParentMember()) {
    RolapLevel level=(RolapLevel)m.getLevel();
    if (level.isAll()) {
      continue;
    }
    hierarchy.addToFrom(sqlQuery,level.nameExp,null);
    String q=level.nameExp.getExpression(sqlQuery);
    sqlQuery.addWhere(q + "String_Node_Str" + m.quoteKeyForSql());
    if (level.unique) {
      break;
    }
  }
  RolapLevel[] levels=(RolapLevel[])hierarchy.getLevels();
  RolapLevel level=levels[member.getLevel().getDepth() + 1];
  hierarchy.addToFrom(sqlQuery,level.nameExp,null);
  String q=level.nameExp.getExpression(sqlQuery);
  sqlQuery.addSelect(q);
  sqlQuery.addGroupBy(q);
  hierarchy.addToFrom(sqlQuery,level.ordinalExp,null);
  String orderBy=level.ordinalExp.getExpression(sqlQuery);
  sqlQuery.addOrderBy(orderBy);
  if (!orderBy.equals(q)) {
    sqlQuery.addGroupBy(orderBy);
  }
  return sqlQuery.toString();
}