nus-yam/ex-repair huggingface dataset:
Program: 50951
Project: 50951
Buggy source:
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  return Collections.binarySearch(Arrays.asList(ts).subList(start,end),t,new Comparator<T>(){
    public int compare(    T o1,    T o2){
      if (o1 instanceof RolapUtilComparable) {
        return -1;
      }
      if (o2 instanceof RolapUtilComparable) {
        return 1;
      }
      return o1.compareTo(o2);
    }
  }
);
}

Fixed version (ground truth):
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  return Collections.binarySearch(Arrays.asList(ts).subList(start,end),t,RolapUtil.ROLAP_COMPARATOR);
}
Program: 50952
Project: 50952
Buggy source:
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  final int i=Collections.binarySearch(Arrays.asList(ts).subList(start,end),t,new Comparator<T>(){
    public int compare(    T o1,    T o2){
      if (o1 instanceof RolapUtilComparable) {
        return -1;
      }
      if (o2 instanceof RolapUtilComparable) {
        return 1;
      }
      return o1.compareTo(o2);
    }
  }
);
  return (i < 0) ? (i - start) : (i + start);
}

Fixed version (ground truth):
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  final int i=Collections.binarySearch(Arrays.asList(ts).subList(start,end),t,RolapUtil.ROLAP_COMPARATOR);
  return (i < 0) ? (i - start) : (i + start);
}
Program: 50953
Project: 50953
Buggy source:
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  return Arrays.binarySearch(ts,start,end,t,new Comparator<T>(){
    public int compare(    T o1,    T o2){
      if (o1 instanceof RolapUtilComparable) {
        return -1;
      }
      if (o2 instanceof RolapUtilComparable) {
        return 1;
      }
      return o1.compareTo(o2);
    }
  }
);
}

Fixed version (ground truth):
public <T extends Comparable<T>>int binarySearch(T[] ts,int start,int end,T t){
  return Arrays.binarySearch(ts,start,end,t,RolapUtil.ROLAP_COMPARATOR);
}
Program: 50954
Project: 50954
Buggy source:
protected void loadMembers(List<List<Member>> nonAllMembers,RolapEvaluator evaluator,QueryAxis axis,Calc calc,AxisMember axisMembers){
  int attempt=0;
  evaluator.setCellReader(batchingReader);
  while (true) {
    axisMembers.clearAxisCount();
    try {
      evalLoad(nonAllMembers,nonAllMembers.size() - 1,evaluator,axis,calc,axisMembers);
    }
 catch (    CellRequestQuantumExceededException e) {
      --attempt;
    }
    if (!phase()) {
      break;
    }
 else {
      evaluator.clearExpResultCache(false);
    }
    if (attempt++ > maxEvalDepth) {
      throw Util.newInternal("String_Node_Str" + maxEvalDepth + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void loadMembers(List<List<Member>> nonAllMembers,RolapEvaluator evaluator,QueryAxis axis,Calc calc,AxisMember axisMembers){
  int attempt=0;
  evaluator.setCellReader(batchingReader);
  while (true) {
    axisMembers.clearAxisCount();
    final int savepoint=evaluator.savepoint();
    try {
      evalLoad(nonAllMembers,nonAllMembers.size() - 1,evaluator,axis,calc,axisMembers);
    }
 catch (    CellRequestQuantumExceededException e) {
      --attempt;
    }
 finally {
      evaluator.restore(savepoint);
    }
    if (!phase()) {
      break;
    }
 else {
      evaluator.clearExpResultCache(false);
    }
    if (attempt++ > maxEvalDepth) {
      throw Util.newInternal("String_Node_Str" + maxEvalDepth + "String_Node_Str");
    }
  }
}
Program: 50955
Project: 50955
Buggy source:
/** 
 * Creates a CellCacheSegmentCreateEvent.
 * @param timestamp Timestamp
 * @param locus Locus
 * @param coordinateCount Number of coordinates of segment header
 * @param actualCellCount Number of cells in body (or 0 if body not yetpresent)
 * @param source Source of segment
 */
public CellCacheSegmentCreateEvent(long timestamp,int serverId,int connectionId,long statementId,long executionId,int coordinateCount,int actualCellCount,Source source){
  super(timestamp,serverId,connectionId,statementId,executionId,source);
  this.coordinateCount=coordinateCount;
  this.actualCellCount=actualCellCount;
}

Fixed version (ground truth):
/** 
 * Creates a CellCacheSegmentCreateEvent.
 * @param timestamp Timestamp
 * @param serverId ID of the server from which the event originates.
 * @param connectionId ID of the connection from which the eventoriginates.
 * @param statementId ID of the statement from which the event originates.
 * @param executionId ID of the execution from which the event originates.
 * @param coordinateCount Number of coordinates of segment header
 * @param actualCellCount Number of cells in body (or 0 if body not yetpresent)
 * @param source Source of segment
 */
public CellCacheSegmentCreateEvent(long timestamp,int serverId,int connectionId,long statementId,long executionId,int coordinateCount,int actualCellCount,Source source){
  super(timestamp,serverId,connectionId,statementId,executionId,source);
  this.coordinateCount=coordinateCount;
  this.actualCellCount=actualCellCount;
}
Program: 50956
Project: 50956
Buggy source:
/** 
 * Creates a CellCacheSegmentCreateEvent.
 * @param timestamp Timestamp
 * @param locus Locus
 * @param coordinateCount Number of coordinates of segment header
 */
public CellCacheSegmentDeleteEvent(long timestamp,int serverId,int connectionId,long statementId,long executionId,int coordinateCount,Source source){
  super(timestamp,serverId,connectionId,statementId,executionId,source);
  this.coordinateCount=coordinateCount;
}

Fixed version (ground truth):
/** 
 * Creates a CellCacheSegmentCreateEvent.
 * @param timestamp Timestamp
 * @param serverId ID of the server from which the event originates.
 * @param connectionId ID of the connection from which the eventoriginates.
 * @param statementId ID of the statement from which the event originates.
 * @param executionId ID of the execution from which the event originates.
 * @param coordinateCount Number of coordinates of segment header
 * @param source Source of segment
 */
public CellCacheSegmentDeleteEvent(long timestamp,int serverId,int connectionId,long statementId,long executionId,int coordinateCount,Source source){
  super(timestamp,serverId,connectionId,statementId,executionId,source);
  this.coordinateCount=coordinateCount;
}
Program: 50957
Project: 50957
Buggy source:
/** 
 * test case for bug #2477623, Closure Tables not working with Virtual Cubes
 */
public void testClosureTableInVirtualCube(){
  final TestContext testContext=TestContext.instance().create("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,"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","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):
/** 
 * Test case for <a href="http://jira.pentaho.org/browse/MONDRIAN-488">MONDRIAN-488, "Closure Tables not working with Virtual Cubes"</a>.
 */
public void testClosureTableInVirtualCube(){
  final TestContext testContext=TestContext.instance().create("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,"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","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: 50958
Project: 50958
Buggy source:
/** 
 * Tests snow flake closure combination. bug #1675125 - now fixed.
 */
public void testSnowflakeClosure(){
  getEmpSnowFlakeClosureTestContext().assertQueryReturns("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");
}

Fixed version (ground truth):
/** 
 * Tests snow flake closure combination. <p>Test case for <a href="http://jira.pentaho.org/browse/MONDRIAN-266">MONDRIAN-266, "Closure tables do not work in a Snowflake Dimension"</a>.
 */
public void testSnowflakeClosure(){
  getEmpSnowFlakeClosureTestContext().assertQueryReturns("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");
}
Program: 50959
Project: 50959
Buggy source:
public void testDistinctAll(){
  assertQueryReturns("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");
}

Fixed version (ground truth):
/** 
 * Test case for <a href="http://jira.pentaho.org/browse/MONDRIAN-75">MONDRIAN-75, "'distinct count' measure cause exception in parent/child"</a>.
 */
public void testDistinctAll(){
  assertQueryReturns("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");
}
Program: 50960
Project: 50960
Buggy source:
/** 
 * Test case for bug #1708327
 */
public void _testNonClosureParentChildHierarchy(){
  getEmpNonClosureTestContext().assertQueryReturns("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");
}

Fixed version (ground truth):
/** 
 * Test case for <a href="http://jira.pentaho.org/browse/MONDRIAN-284">MONDRIAN-284, "Parent child hierarchies without closures are broken"</a>.
 */
public void _testNonClosureParentChildHierarchy(){
  getEmpNonClosureTestContext().assertQueryReturns("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");
}
Program: 50962
Project: 50962
Buggy source:
private Exp getFormula(Member member){
  return (Exp)member.getPropertyValue(Property.FORMAT_EXP.name);
}

Fixed version (ground truth):
private Exp getFormula(Member member){
  return (Exp)member.getPropertyValue(Property.FORMAT_EXP_PARSED.name);
}
Program: 50963
Project: 50963
Buggy source:
/** 
 * Returns whether this property is standard.
 */
public boolean isStandard(){
  return ordinal <= VALUE_ORDINAL;
}

Fixed version (ground truth):
/** 
 * Returns whether this property is standard.
 */
public boolean isStandard(){
  return ordinal < MAX_ORDINAL;
}
Program: 50964
Project: 50964
Buggy source:
/** 
 * Returns whether this property is a standard member property.
 */
public boolean isCellProperty(){
  return cell && ordinal <= VALUE_ORDINAL;
}

Fixed version (ground truth):
/** 
 * Returns whether this property is a standard cell property.
 */
public boolean isCellProperty(){
  return cell && isStandard();
}
Program: 50965
Project: 50965
Buggy source:
public int compare(Comparable<?> o1,Comparable<?> o2){
  if (o1 == RolapUtil.sqlNullValue) {
    return -1;
  }
  if (o2 == RolapUtil.sqlNullValue) {
    return 1;
  }
  return ((Comparable)o1).compareTo(o2);
}

Fixed version (ground truth):
public int compare(Comparable o1,Comparable o2){
  if (o1 == RolapUtil.sqlNullValue) {
    return -1;
  }
  if (o2 == RolapUtil.sqlNullValue) {
    return 1;
  }
  return o1.compareTo(o2);
}
Program: 50966
Project: 50966
Buggy source:
/** 
 * Creates a MondrianOlap4jCellSetAxisMetaData.
 * @param cellSetMetaData Cell set axis metadata
 * @param queryAxis Query axis
 */
MondrianOlap4jCellSetAxisMetaData(MondrianOlap4jCellSetMetaData cellSetMetaData,QueryAxis queryAxis){
  if (queryAxis == null) {
    queryAxis=new QueryAxis(false,null,AxisOrdinal.StandardAxisOrdinal.SLICER,QueryAxis.SubtotalVisibility.Undefined);
  }
  this.queryAxis=queryAxis;
  this.cellSetMetaData=cellSetMetaData;
  for (  Id id : queryAxis.getDimensionProperties()) {
    final String[] names=id.toStringArray();
    Property olap4jProperty=null;
    if (names.length == 1) {
      olap4jProperty=Util.lookup(Property.StandardMemberProperty.class,names[0]);
    }
    if (olap4jProperty == null) {
      final UnresolvedFunCall call=(UnresolvedFunCall)Util.lookup(cellSetMetaData.query,id.getSegments(),true);
      olap4jProperty=new MondrianOlap4jProperty(Util.lookupProperty(((LevelExpr)call.getArg(0)).getLevel(),call.getFunName()));
    }
    propertyList.add(olap4jProperty);
  }
}

Fixed version (ground truth):
/** 
 * Creates a MondrianOlap4jCellSetAxisMetaData.
 * @param cellSetMetaData Cell set axis metadata
 * @param queryAxis Query axis
 */
MondrianOlap4jCellSetAxisMetaData(MondrianOlap4jCellSetMetaData cellSetMetaData,QueryAxis queryAxis){
  if (queryAxis == null) {
    queryAxis=new QueryAxis(false,null,AxisOrdinal.StandardAxisOrdinal.SLICER,QueryAxis.SubtotalVisibility.Undefined);
  }
  this.queryAxis=queryAxis;
  this.cellSetMetaData=cellSetMetaData;
  for (  Id id : queryAxis.getDimensionProperties()) {
    final String[] names=id.toStringArray();
    Property olap4jProperty=null;
    if (names.length == 1) {
      olap4jProperty=Util.lookup(Property.StandardMemberProperty.class,names[0]);
      if (olap4jProperty == null) {
        olap4jProperty=MondrianOlap4jProperty.MEMBER_EXTENSIONS.get(names[0]);
      }
    }
    if (olap4jProperty == null) {
      final UnresolvedFunCall call=(UnresolvedFunCall)Util.lookup(cellSetMetaData.query,id.getSegments(),true);
      olap4jProperty=new MondrianOlap4jProperty(Util.lookupProperty(((LevelExpr)call.getArg(0)).getLevel(),call.getFunName()));
    }
    propertyList.add(olap4jProperty);
  }
}
Program: 50967
Project: 50967
Buggy source:
public NamedList<Property> getCellProperties(){
  final ArrayNamedListImpl<Property> list=new ArrayNamedListImpl<Property>(){
    protected String getName(    Property property){
      return property.getName();
    }
  }
;
  for (  Property.StandardCellProperty property : Property.StandardCellProperty.values()) {
    if (query.hasCellProperty(property.getName())) {
      list.add(property);
    }
  }
  return list;
}

Fixed version (ground truth):
public NamedList<Property> getCellProperties(){
  final ArrayNamedListImpl<Property> list=new ArrayNamedListImpl<Property>(){
    protected String getName(    Property property){
      return property.getName();
    }
  }
;
  for (  Property property : Property.StandardCellProperty.values()) {
    if (query.hasCellProperty(property.getName())) {
      list.add(property);
    }
  }
  for (  Property property : MondrianOlap4jProperty.CELL_EXTENSIONS.values()) {
    if (query.hasCellProperty(property.getName())) {
      list.add(property);
    }
  }
  return list;
}
Program: 50968
Project: 50968
Buggy source:
/** 
 * Creates an exception with a given cause.
 * @param msg Message
 * @param cause Causing exception
 * @return New exception
 */
OlapException createException(String msg,Throwable cause){
  return new OlapException(msg,cause);
}

Fixed version (ground truth):
/** 
 * Creates an exception with a given cause.
 * @param msg Message
 * @param cause Causing exception
 * @return New exception
 */
OlapException createException(String msg,Throwable cause){
}
Program: 50969
Project: 50969
Buggy source:
/** 
 * Tests performance of a larger schema with a large number of result cells. Runs in 186 seconds without nonAllPositions array in RolapEvaluator. Runs in 14 seconds when RolapEvaluator.getProperty uses getNonAllMembers. The performance boost gets more significant as the schema size grows.
 */
public void testBigResultsWithBigSchemaPerforms(){
  if (!LOGGER.isDebugEnabled()) {
    return;
  }
  TestContext testContext=TestContext.instance().createSubstitutingCube("String_Node_Str",extraGenders(1000),null);
  String mdx="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";
  long start=System.currentTimeMillis();
  testContext.executeQuery(mdx);
  printDuration("String_Node_Str",start);
}

Fixed version (ground truth):
/** 
 * Tests performance of a larger schema with a large number of result cells. Runs in 186 seconds without nonAllPositions array in RolapEvaluator. Runs in 14 seconds when RolapEvaluator.getProperty uses getNonAllMembers. The performance boost gets more significant as the schema size grows.
 */
public void testBigResultsWithBigSchemaPerforms(){
  if (!LOGGER.isDebugEnabled()) {
    return;
  }
  TestContext testContext=TestContext.instance().createSubstitutingCube("String_Node_Str",TestContext.repeatString(1000,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"),null);
  String mdx="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";
  long start=System.currentTimeMillis();
  testContext.executeQuery(mdx);
  printDuration("String_Node_Str",start);
}
Program: 50970
Project: 50970
Buggy source:
public Object getValue(){
  final Object value=lockBox.map.get(moniker);
  if (value == null) {
    throw new RuntimeException("String_Node_Str" + moniker + "String_Node_Str");
  }
  return unwrap(value);
}

Fixed version (ground truth):
public Object getValue(){
  final Object value=lockBox.map.get(this);
  if (value == null) {
    throw new RuntimeException("String_Node_Str" + moniker + "String_Node_Str");
  }
  return unwrap(value);
}
Program: 50971
Project: 50971
Buggy source:
/** 
 * Retrieves an entry using its string moniker. Returns null if there is no entry with that moniker. <p>Successive calls for the same moniker do not necessarily return the same   {@code Entry} object, but those entries'{@link LockBox.Entry#getValue()} will nevertheless return the samevalue.</p>
 * @param moniker Moniker of the lock box entry
 * @return Entry, or null if there is no entry with this moniker
 */
public synchronized Entry get(String moniker){
  if (map.containsKey(moniker)) {
    return new LockBoxEntryImpl(this,moniker);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Retrieves an entry using its string moniker. Returns null if there is no entry with that moniker. <p>Successive calls for the same moniker do not necessarily return the same   {@code Entry} object, but those entries'{@link LockBox.Entry#getValue()} will nevertheless return the samevalue.</p>
 * @param moniker Moniker of the lock box entry
 * @return Entry, or null if there is no entry with this moniker
 */
public synchronized Entry get(String moniker){
  for (  LockBoxEntryImpl entry : map.keySet()) {
    if (entry.moniker.equals(moniker)) {
      return entry;
    }
  }
  return null;
}
Program: 50972
Project: 50972
Buggy source:
/** 
 * Removes an entry from the lock box. <p>It is safe to call this method multiple times.
 * @param entry Entry to deregister
 * @return Whether the object was removed
 */
public synchronized boolean deregister(Entry entry){
  return map.remove(entry.getMoniker()) != null;
}

Fixed version (ground truth):
/** 
 * Removes an entry from the lock box. <p>It is safe to call this method multiple times.
 * @param entry Entry to deregister
 * @return Whether the object was removed
 */
public synchronized boolean deregister(Entry entry){
  return map.remove(entry) != null;
}
Program: 50973
Project: 50973
Buggy source:
public boolean isRegistered(){
  return lockBox.map.containsKey(moniker);
}

Fixed version (ground truth):
public boolean isRegistered(){
  return lockBox.map.containsKey(this);
}
Program: 50974
Project: 50974
Buggy source:
/** 
 * Adds an object to the lock box, and returns a key for it. <p>The object may be null. The same object may be registered multiple times; each time it is registered, a new entry with a new string moniker is generated.
 * @param o Object to register. May be null.
 * @return Entry containing the object's string key and the object itself
 */
public synchronized Entry register(Object o){
  String moniker=generateMoniker();
  final LockBoxEntryImpl entry=new LockBoxEntryImpl(this,moniker);
  map.put(moniker,wrap(o));
  return entry;
}

Fixed version (ground truth):
/** 
 * Adds an object to the lock box, and returns a key for it. <p>The object may be null. The same object may be registered multiple times; each time it is registered, a new entry with a new string moniker is generated.
 * @param o Object to register. May be null.
 * @return Entry containing the object's string key and the object itself
 */
public synchronized Entry register(Object o){
  String moniker=generateMoniker();
  final LockBoxEntryImpl entry=new LockBoxEntryImpl(this,moniker);
  map.put(entry,wrap(o));
  return entry;
}
Program: 50977
Project: 50977
Buggy source:
LoadBatchResponse(List<CellRequest> cellRequests,List<SegmentHeader> cacheSegments,List<RollupInfo> rollups,Map<List,SegmentBuilder.SegmentConverter> converterMap,List<Future<Map<Segment,SegmentWithData>>> sqlSegmentMapFutures){
  this.cellRequests=cellRequests;
  this.sqlSegmentMapFutures=sqlSegmentMapFutures;
  this.cacheSegments=cacheSegments;
  this.rollups=rollups;
  this.converterMap=converterMap;
}

Fixed version (ground truth):
LoadBatchResponse(List<CellRequest> cellRequests,List<SegmentHeader> cacheSegments,List<RollupInfo> rollups,Map<List,SegmentBuilder.SegmentConverter> converterMap,List<Future<Map<Segment,SegmentWithData>>> sqlSegmentMapFutures,Map<SegmentHeader,Future<SegmentBody>> futures){
  this.cellRequests=cellRequests;
  this.sqlSegmentMapFutures=sqlSegmentMapFutures;
  this.cacheSegments=cacheSegments;
  this.rollups=rollups;
  this.converterMap=converterMap;
  this.futures=futures;
}
Program: 50979
Project: 50979
Buggy source:
private SegmentBody loadSegmentFromCache(Map<SegmentHeader,SegmentBody> headerBodies,SegmentHeader header){
  SegmentBody body=headerBodies.get(header);
  if (body != null) {
    return body;
  }
  body=cacheMgr.compositeCache.get(header);
  if (body != null) {
    headerBodies.put(header,body);
  }
  return body;
}

Fixed version (ground truth):
private SegmentBody loadSegmentFromCache(Map<SegmentHeader,SegmentBody> headerBodies,SegmentHeader header){
  SegmentBody body=headerBodies.get(header);
  if (body != null) {
    return body;
  }
  body=cacheMgr.compositeCache.get(header);
  if (body == null) {
    cacheMgr.remove(header);
    return null;
  }
  headerBodies.put(header,body);
  return body;
}
Program: 50980
Project: 50980
Buggy source:
public PeekResponse call(){
  final RolapStar.Measure measure=request.getMeasure();
  final RolapStar star=measure.getStar();
  final RolapSchema schema=star.getSchema();
  final AggregationKey key=new AggregationKey(request);
  final List<SegmentHeader> headers=segmentIndex.locate(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),request.getMappedCellValues(),AggregationKey.getCompoundPredicateStringList(star,key.getCompoundPredicateList()));
  final Map<SegmentHeader,Future<SegmentBody>> headerMap=new HashMap<SegmentHeader,Future<SegmentBody>>();
  final Map<List,SegmentBuilder.SegmentConverter> converterMap=new HashMap<List,SegmentBuilder.SegmentConverter>();
  for (  SegmentHeader header : headers) {
    converterMap.put(SegmentCacheIndexImpl.makeConverterKey(header),getConverter(header));
    headerMap.put(header,segmentIndex.getFuture(header));
  }
  return new PeekResponse(headerMap,converterMap);
}

Fixed version (ground truth):
public PeekResponse call(){
  final RolapStar.Measure measure=request.getMeasure();
  final RolapStar star=measure.getStar();
  final RolapSchema schema=star.getSchema();
  final AggregationKey key=new AggregationKey(request);
  final List<SegmentHeader> headers=segmentIndex.locate(schema.getName(),schema.getChecksum(),measure.getCubeName(),measure.getName(),star.getFactTable().getAlias(),request.getConstrainedColumnsBitKey(),request.getMappedCellValues(),AggregationKey.getCompoundPredicateStringList(star,key.getCompoundPredicateList()));
  final Map<SegmentHeader,Future<SegmentBody>> headerMap=new HashMap<SegmentHeader,Future<SegmentBody>>();
  final Map<List,SegmentBuilder.SegmentConverter> converterMap=new HashMap<List,SegmentBuilder.SegmentConverter>();
  for (  SegmentHeader header : headers) {
    final Future<SegmentBody> bodyFuture=segmentIndex.getFuture(header);
    if (bodyFuture != null) {
      converterMap.put(SegmentCacheIndexImpl.makeConverterKey(header),getConverter(header));
      headerMap.put(header,bodyFuture);
    }
  }
  return new PeekResponse(headerMap,converterMap);
}
Program: 50982
Project: 50982
Buggy source:
/** 
 * Adds a header to the index.
 * @param header Segment header
 * @param bodyFuture Future that will be informed when the segment has
 * @param converter Segment converter
 */
void add(SegmentHeader header,SlotFuture<SegmentBody> bodyFuture,SegmentBuilder.SegmentConverter converter);

Fixed version (ground truth):
/** 
 * Adds a header to the index. <p>If   {@code loading} is true, there must follow a call to{@link #loadSucceeded} or {@link #loadFailed}.</p>
 * @param header Segment header
 * @param loading Whether segment is pending a load from SQL
 * @param converter Segment converter
 */
void add(SegmentHeader header,boolean loading,SegmentBuilder.SegmentConverter converter);
Program: 50983
Project: 50983
Buggy source:
public T get(int index){
switch (index) {
case 0:
    return t0;
case 1:
  return t1;
case 2:
return t2;
default :
throw new IndexOutOfBoundsException("String_Node_Str" + index);
}
}

Fixed version (ground truth):
Usage get();
Program: 50984
Project: 50984
Buggy source:
/** 
 * Creates a DynamicContentFinder.
 * @param dataSourcesConfigUrl URL of repository
 */
public DynamicContentFinder(String dataSourcesConfigUrl){
  super(dataSourcesConfigUrl);
  reloadDataSources();
  timer=new Timer("String_Node_Str",true);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      reloadDataSources();
    }
  }
,MondrianProperties.instance().XmlaSchemaRefreshInterval.get(),MondrianProperties.instance().XmlaSchemaRefreshInterval.get());
}

Fixed version (ground truth):
/** 
 * Creates a DynamicContentFinder.
 * @param dataSourcesConfigUrl URL of repository
 */
public DynamicContentFinder(String dataSourcesConfigUrl){
  super(dataSourcesConfigUrl);
  reloadDataSources();
  timer=Util.newTimer("String_Node_Str",true);
  timer.scheduleAtFixedRate(new TimerTask(){
    public void run(){
      reloadDataSources();
    }
  }
,MondrianProperties.instance().XmlaSchemaRefreshInterval.get(),MondrianProperties.instance().XmlaSchemaRefreshInterval.get());
}
Program: 50985
Project: 50985
Buggy source:
<T>void threadLocalRemove(ThreadLocal<T> threadLocal);

Fixed version (ground truth):
/** 
 * Removes a thread local from the current thread. <p>From JDK 1.5 onwards, calls   {@link ThreadLocal#remove()}; before that, no-ops.</p>
 * @param threadLocal Thread local
 * @param < T > Type
 */
<T>void threadLocalRemove(ThreadLocal<T> threadLocal);
Program: 50986
Project: 50986
Buggy source:
public List<Member> slice(final int column){
  return new AbstractList<Member>(){
    @Override public Member get(    int index){
      return list.get(column).get(index);
    }
    @Override public int size(){
      return list.get(column).size();
    }
    public Member set(    int index,    Member element){
      return list.get(column).set(index,element);
    }
  }
;
}

Fixed version (ground truth):
public List<Member> slice(final int column){
  return new AbstractList<Member>(){
    @Override public Member get(    int index){
      return list.get(index).get(column);
    }
    @Override public int size(){
      return list.size();
    }
    public Member set(    int index,    Member element){
      return list.get(index).set(column,element);
    }
  }
;
}
Program: 50987
Project: 50987
Buggy source:
private int getMemberCount(RolapLevel level,DataSource dataSource){
  boolean[] mustCount=new boolean[1];
  String sql=makeLevelMemberCountSql(level,dataSource,mustCount);
  final SqlStatement stmt=RolapUtil.executeQuery(dataSource,sql,new Locus(Locus.peek().execution,"String_Node_Str","String_Node_Str" + level));
  try {
    ResultSet resultSet=stmt.getResultSet();
    int count;
    if (!mustCount[0]) {
      Util.assertTrue(resultSet.next());
      ++stmt.rowCount;
      count=resultSet.getInt(1);
    }
 else {
      ResultSetMetaData rmd=resultSet.getMetaData();
      int nColumns=rmd.getColumnCount();
      String[] colStrings=new String[nColumns];
      count=0;
      while (resultSet.next()) {
        ++stmt.rowCount;
        boolean isEqual=true;
        for (int i=0; i < nColumns; i++) {
          String colStr=resultSet.getString(i + 1);
          if (!colStr.equals(colStrings[i])) {
            isEqual=false;
          }
          colStrings[i]=colStr;
        }
        if (!isEqual) {
          count++;
        }
      }
    }
    return count;
  }
 catch (  SQLException e) {
    throw stmt.handle(e);
  }
 finally {
    stmt.close();
  }
}

Fixed version (ground truth):
private int getMemberCount(RolapLevel level,DataSource dataSource){
  boolean[] mustCount=new boolean[1];
  String sql=makeLevelMemberCountSql(level,dataSource,mustCount);
  final SqlStatement stmt=RolapUtil.executeQuery(dataSource,sql,new Locus(Locus.peek().execution,"String_Node_Str","String_Node_Str" + level));
  try {
    ResultSet resultSet=stmt.getResultSet();
    int count;
    if (!mustCount[0]) {
      Util.assertTrue(resultSet.next());
      ++stmt.rowCount;
      count=resultSet.getInt(1);
    }
 else {
      ResultSetMetaData rmd=resultSet.getMetaData();
      int nColumns=rmd.getColumnCount();
      String[] colStrings=new String[nColumns];
      count=0;
      while (resultSet.next()) {
        ++stmt.rowCount;
        boolean isEqual=true;
        for (int i=0; i < nColumns; i++) {
          String colStr=resultSet.getString(i + 1);
          if (!Util.equals(colStr,colStrings[i])) {
            isEqual=false;
          }
          colStrings[i]=colStr;
        }
        if (!isEqual) {
          count++;
        }
      }
    }
    return count;
  }
 catch (  SQLException e) {
    throw stmt.handle(e);
  }
 finally {
    stmt.close();
  }
}
Program: 50990
Project: 50990
Buggy source:
public boolean allowsCountDistinct(){
  return false;
}

Fixed version (ground truth):
public boolean allowsCountDistinct(){
  return true;
}
Program: 50991
Project: 50991
Buggy source:
public boolean allowsFromQuery(){
  return true;
}

Fixed version (ground truth):
public boolean allowsFromQuery(){
  return false;
}
Program: 50992
Project: 50992
Buggy source:
protected String dialectize(Dialect.DatabaseProduct d,String sql){
  sql=sql.replaceAll("String_Node_Str","String_Node_Str");
switch (d) {
case ORACLE:
    return sql.replaceAll("String_Node_Str","String_Node_Str");
case TERADATA:
  return sql.replaceAll("String_Node_Str","String_Node_Str");
case DERBY:
return sql.replaceAll("String_Node_Str","String_Node_Str");
case ACCESS:
return sql.replaceAll("String_Node_Str","String_Node_Str");
default :
return sql;
}
}

Fixed version (ground truth):
protected String dialectize(Dialect.DatabaseProduct d,String sql){
  sql=sql.replaceAll("String_Node_Str","String_Node_Str");
switch (d) {
case ORACLE:
    return sql.replaceAll("String_Node_Str","String_Node_Str");
case GREENPLUM:
case POSTGRESQL:
case TERADATA:
  return sql.replaceAll("String_Node_Str","String_Node_Str");
case DERBY:
return sql.replaceAll("String_Node_Str","String_Node_Str");
case ACCESS:
return sql.replaceAll("String_Node_Str","String_Node_Str");
default :
return sql;
}
}
Program: 50993
Project: 50993
Buggy source:
public void testDoesDBSupportGroupingSets(){
  final Dialect dialect=getTestContext().getDialect();
  FastBatchingCellReader fbcr=new FastBatchingCellReader(salesCube){
    Dialect getDialect(){
      return dialect;
    }
  }
;
switch (dialect.getDatabaseProduct()) {
case ORACLE:
case TERADATA:
case DB2:
case DB2_AS400:
case DB2_OLD_AS400:
    assertTrue(fbcr.doesDBSupportGroupingSets());
  break;
default :
assertFalse(fbcr.doesDBSupportGroupingSets());
break;
}
}

Fixed version (ground truth):
public void testDoesDBSupportGroupingSets(){
  final Dialect dialect=getTestContext().getDialect();
  FastBatchingCellReader fbcr=new FastBatchingCellReader(salesCube){
    Dialect getDialect(){
      return dialect;
    }
  }
;
switch (dialect.getDatabaseProduct()) {
case ORACLE:
case TERADATA:
case DB2:
case DB2_AS400:
case DB2_OLD_AS400:
case GREENPLUM:
    assertTrue(fbcr.doesDBSupportGroupingSets());
  break;
default :
assertFalse(fbcr.doesDBSupportGroupingSets());
break;
}
}
Program: 50996
Project: 50996
Buggy source:
public void close(){
  if (closed) {
    return;
  }
  this.closed=true;
  final ProfileHandler profileHandler=olap4jStatement.getProfileHandler();
  if (profileHandler != null) {
    final StringWriter stringWriter=new StringWriter();
    final PrintWriter printWriter=new PrintWriter(stringWriter);
    olap4jStatement.getQuery().explain(printWriter);
    printWriter.close();
    profileHandler.explain(stringWriter.toString(),getQueryTiming());
  }
  this.result.close();
}

Fixed version (ground truth):
public void close(){
  if (closed) {
    return;
  }
  this.closed=true;
  final ProfileHandler profileHandler=olap4jStatement.getProfileHandler();
  if (profileHandler != null) {
    final StringWriter stringWriter=new StringWriter();
    final PrintWriter printWriter=new PrintWriter(stringWriter);
    olap4jStatement.getQuery().explain(printWriter);
    printWriter.close();
    profileHandler.explain(stringWriter.toString(),getQueryTiming());
  }
  if (this.result != null) {
    this.result.close();
  }
}
Program: 50997
Project: 50997
Buggy source:
private synchronized static void initCache(){
  final String cacheName=MondrianProperties.instance().SegmentCache.get();
  if (cacheName != null) {
    setCache(cacheName);
  }
  if (segmentCache == null) {
    final List<Class<SegmentCache>> implementors=serviceDiscovery.getImplementor();
    if (implementors.size() > 0) {
      setCache(implementors.get(0).getName());
    }
  }
}

Fixed version (ground truth):
private synchronized static void initCache(){
  boolean segmentCacheFound=false;
  final String cacheName=MondrianProperties.instance().SegmentCache.get();
  if (cacheName != null) {
    segmentCacheFound=true;
    setCache(cacheName);
  }
  if (segmentCache == null) {
    final List<Class<SegmentCache>> implementors=serviceDiscovery.getImplementor();
    if (implementors.size() > 0) {
      segmentCacheFound=true;
      setCache(implementors.get(0).getName());
    }
  }
  if (!segmentCacheFound) {
    setCache(null);
  }
}
Program: 50999
Project: 50999
Buggy source:
/** 
 * Creates a MondrianOlap4jDriver.
 */
MondrianOlap4jDriver(){
  this.factory=createFactory();
}

Fixed version (ground truth):
/** 
 * Creates a MondrianOlap4jDriver.
 */
public MondrianOlap4jDriver(){
  this.factory=createFactory();
}
Program: 51000
Project: 51000
Buggy source:
/** 
 * Flushes a segment from the cache. Returns true or false if the operation succeeds. <p>To adjust timeout values, set the  {@link MondrianProperties#SegmentCacheWriteTimeout} property.
 * @param header A region to flush from the segment cache.
 */
public static void flush(ConstrainedColumn[] region){
  initCache();
  final SegmentCache cache=getSegmentCache();
  if (cache != null) {
    try {
      final boolean result=cache.flush(region).get(MondrianProperties.instance().SegmentCacheWriteTimeout.get(),TimeUnit.MILLISECONDS);
      if (!result) {
        LOGGER.error(MondrianResource.instance().SegmentCacheFailedToDeleteSegment.baseMessage);
        throw MondrianResource.instance().SegmentCacheFailedToDeleteSegment.ex();
      }
    }
 catch (    TimeoutException e) {
      LOGGER.error(MondrianResource.instance().SegmentCacheReadTimeout.baseMessage,e);
      throw MondrianResource.instance().SegmentCacheReadTimeout.ex(e);
    }
catch (    Throwable t) {
      LOGGER.error(MondrianResource.instance().SegmentCacheFailedToDeleteSegment.baseMessage,t);
      throw MondrianResource.instance().SegmentCacheFailedToDeleteSegment.ex(t);
    }
  }
}

Fixed version (ground truth):
/** 
 * Flushes a segment from the cache. Returns true or false if the operation succeeds. <p>To adjust timeout values, set the  {@link MondrianProperties#SegmentCacheWriteTimeout} property.
 * @param region A region to flush from the segment cache.
 */
public static void flush(ConstrainedColumn[] region){
  initCache();
  final SegmentCache cache=getSegmentCache();
  if (cache != null) {
    try {
      final boolean result=cache.flush(region).get(MondrianProperties.instance().SegmentCacheWriteTimeout.get(),TimeUnit.MILLISECONDS);
      if (!result) {
        LOGGER.error(MondrianResource.instance().SegmentCacheFailedToDeleteSegment.baseMessage);
        throw MondrianResource.instance().SegmentCacheFailedToDeleteSegment.ex();
      }
    }
 catch (    TimeoutException e) {
      LOGGER.error(MondrianResource.instance().SegmentCacheReadTimeout.baseMessage,e);
      throw MondrianResource.instance().SegmentCacheReadTimeout.ex(e);
    }
catch (    Throwable t) {
      LOGGER.error(MondrianResource.instance().SegmentCacheFailedToDeleteSegment.baseMessage,t);
      throw MondrianResource.instance().SegmentCacheFailedToDeleteSegment.ex(t);
    }
  }
}
Program: 51001
Project: 51001
Buggy source:
/** 
 * Base constructor for segment headers.
 * @see #forSegment(Segment)
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns,String[] compoundPredicates,String rolapStarFactTableName,BitKey constrainedColsBitKey){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.compoundPredicates=compoundPredicates;
  this.rolapStarFactTableName=rolapStarFactTableName;
  this.constrainedColsBitKey=constrainedColsBitKey;
  this.arity=constrainedColumns.length;
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : this.constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  for (  String col : this.compoundPredicates) {
    hash=Util.hash(hash,col);
  }
  this.hashCode=hash;
}

Fixed version (ground truth):
/** 
 * Base constructor for segment headers.
 * @param schemaName The name of the schema which thisheader belongs to.
 * @param cubeName The name of the cube this segment belongs to.
 * @param measureName The name of the measure which definesthis header.
 * @param constrainedColumns An array of constrained columnsobjects which define the predicated of this segment header.
 */
public SegmentHeader(String schemaName,String cubeName,String measureName,ConstrainedColumn[] constrainedColumns,String[] compoundPredicates,String rolapStarFactTableName,BitKey constrainedColsBitKey){
  this.constrainedColumns=constrainedColumns;
  this.schemaName=schemaName;
  this.cubeName=cubeName;
  this.measureName=measureName;
  this.compoundPredicates=compoundPredicates;
  this.rolapStarFactTableName=rolapStarFactTableName;
  this.constrainedColsBitKey=constrainedColsBitKey;
  this.arity=constrainedColumns.length;
  int hash=42;
  hash=Util.hash(hash,schemaName);
  hash=Util.hash(hash,cubeName);
  hash=Util.hash(hash,measureName);
  for (  ConstrainedColumn col : this.constrainedColumns) {
    hash=Util.hash(hash,col.columnExpression);
    for (    Object val : col.values) {
      hash=Util.hash(hash,val);
    }
  }
  for (  String col : this.compoundPredicates) {
    hash=Util.hash(hash,col);
  }
  this.hashCode=hash;
}
Program: 51002
Project: 51002
Buggy source:
@Override public void commit(){
  for (  RolapMember member : members) {
    member=stripMember(member);
    final MemberCache memberCache=getMemberCache(member);
    final Object cacheKey=memberCache.makeKey(member.getParentMember(),member.getKey());
    final RolapMember cacheMember=memberCache.getMember(cacheKey);
    if (cacheMember == null) {
      return;
    }
    for (    Map.Entry<String,Object> entry : propertyValues.entrySet()) {
      cacheMember.setProperty(entry.getKey(),entry.getValue());
    }
  }
}

Fixed version (ground truth):
public void commit(){
  for (  RolapMember member : members) {
    member=stripMember(member);
    final MemberCache memberCache=getMemberCache(member);
    final Object cacheKey=memberCache.makeKey(member.getParentMember(),member.getKey());
    final RolapMember cacheMember=memberCache.getMember(cacheKey);
    if (cacheMember == null) {
      return;
    }
    for (    Map.Entry<String,Object> entry : propertyValues.entrySet()) {
      cacheMember.setProperty(entry.getKey(),entry.getValue());
    }
  }
}
Program: 51004
Project: 51004
Buggy source:
@Override public Boolean call() throws Exception {
  final MemberCache memberCache=getMemberCache(member);
  final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
  List<RolapMember> childrenList=memberCache.getChildrenFromCache(parent,memberConstraint);
  if (childrenList == null) {
    final List<RolapMember> constrainedList=new ArrayList<RolapMember>();
    constrainedList.add(member);
    memberCache.putChildren(parent,memberConstraint,constrainedList);
  }
  childrenList=memberCache.getChildrenFromCache(parent,DefaultMemberChildrenConstraint.instance());
  if (childrenList == null) {
    final List<RolapMember> unconstrainedList=new ArrayList<RolapMember>();
    unconstrainedList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),unconstrainedList);
  }
 else {
    childrenList.add(member);
    memberCache.putChildren(parent,DefaultMemberChildrenConstraint.instance(),childrenList);
  }
  final Object memberKey=memberCache.makeKey(member.getParentMember(),member.getKey());
  memberCache.putMember(memberKey,member);
  return true;
}

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

Fixed version (ground truth):
private Callable<Boolean> deleteMember(final RolapMember member,final RolapMember previousParent,List<CellRegion> cellRegionList){
  cellRegionList.add(createMemberRegion(member,true));
  return new Callable<Boolean>(){
    public Boolean call() throws Exception {
      final MemberCache memberCache=getMemberCache(member);
      final MemberChildrenConstraint memberConstraint=new ChildByNameConstraint(new Id.Segment(member.getName(),Quoting.QUOTED));
      List<RolapMember> childrenList=memberCache.getChildrenFromCache(previousParent,DefaultMemberChildrenConstraint.instance());
      if (childrenList != null) {
        childrenList.remove(member);
        memberCache.putChildren(previousParent,DefaultMemberChildrenConstraint.instance(),childrenList);
      }
      memberCache.putChildren(previousParent,memberConstraint,null);
      final Object key=memberCache.makeKey(previousParent,member.getKey());
      memberCache.removeMember(key);
      return true;
    }
  }
;
}