nus-yam/ex-repair huggingface dataset:
Program: 51081
Project: 51081
Buggy source:
/** 
 * Gets content via Apache VFS. File must exist and have content
 * @param url String
 * @return Apache VFS FileObject for further processing
 * @throws FileSystemException
 */
public static FileObject readVirtualFile(String url) throws FileSystemException {
  FileSystemManager fsManager=VFS.getManager();
  if (fsManager == null) {
    throw newError("String_Node_Str");
  }
  if (url.startsWith("String_Node_Str")) {
    url=url.substring("String_Node_Str".length());
  }
  if (url.startsWith("String_Node_Str")) {
    url=url.substring("String_Node_Str".length());
  }
  File userDir=new File("String_Node_Str").getAbsoluteFile();
  FileObject file=fsManager.resolveFile(userDir,url);
  if (!file.isReadable()) {
    throw newError("String_Node_Str" + url);
  }
  FileContent fileContent=file.getContent();
  if (fileContent == null) {
    throw newError("String_Node_Str" + url);
  }
  return file;
}

Fixed version (ground truth):
/** 
 * Gets content via Apache VFS. File must exist and have content
 * @param url String
 * @return Apache VFS FileContent for further processing
 * @throws FileSystemException
 */
public static FileContent readVirtualFile(String url) throws FileSystemException {
  FileSystemManager fsManager=VFS.getManager();
  if (fsManager == null) {
    throw newError("String_Node_Str");
  }
  if (url.startsWith("String_Node_Str")) {
    url=url.substring("String_Node_Str".length());
  }
  if (url.startsWith("String_Node_Str")) {
    url=url.substring("String_Node_Str".length());
  }
  File userDir=new File("String_Node_Str").getAbsoluteFile();
  FileObject file=fsManager.resolveFile(userDir,url);
  if (!file.getName().getURI().equals(url)) {
    fsManager.getFilesCache().removeFile(file.getFileSystem(),file.getName());
    file=fsManager.resolveFile(userDir,url);
  }
  if (!file.isReadable()) {
    throw newError("String_Node_Str" + url);
  }
  FileContent fileContent=file.getContent();
  if (fileContent == null) {
    throw newError("String_Node_Str" + url);
  }
  return fileContent;
}
Program: 51082
Project: 51082
Buggy source:
/** 
 * {@inheritDoc}<p>FilterDynamicSchemaProcessor's implementation of this method reads from the URL supplied (that is, it does not perform URL translation) and passes it through the   {@link #filter} method.
 */
public String processSchema(String schemaUrl,Util.PropertyList connectInfo) throws Exception {
  FileObject file=Util.readVirtualFile(schemaUrl);
  FileContent fileContent=file.getContent();
  return filter(schemaUrl,connectInfo,fileContent.getInputStream());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p>FilterDynamicSchemaProcessor's implementation of this method reads from the URL supplied (that is, it does not perform URL translation) and passes it through the   {@link #filter} method.
 */
public String processSchema(String schemaUrl,Util.PropertyList connectInfo) throws Exception {
  FileContent fileContent=Util.readVirtualFile(schemaUrl);
  return filter(schemaUrl,connectInfo,fileContent.getInputStream());
}
Program: 51083
Project: 51083
Buggy source:
protected Calc compileCall(final ResolvedFunCall call,ExpCompiler compiler,ResultStyle resultStyle){
  final Calc ncalc=compiler.compileAs(call.getArg(0),null,Collections.singletonList(resultStyle));
  final Calc calc=call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1),true) : new ValueCalc(call);
  if (ncalc instanceof ListCalc) {
    return genListCalc(call,ncalc,calc);
  }
 else {
    return genIterCalc(call,ncalc,calc);
  }
}

Fixed version (ground truth):
protected Calc compileCall(final ResolvedFunCall call,ExpCompiler compiler,ResultStyle resultStyle){
  final Calc ncalc=compiler.compileIter(call.getArg(0));
  if (ncalc == null) {
    return null;
  }
  final Calc calc=call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1),true) : new ValueCalc(call);
  if (ncalc instanceof ListCalc) {
    return genListCalc(call,ncalc,calc);
  }
 else {
    return genIterCalc(call,ncalc,calc);
  }
}
Program: 51084
Project: 51084
Buggy source:
protected Calc afterCompile(Exp exp,Calc calc,boolean mutable){
  Dimension[] dimensions=getIndependentDimensions(calc);
  calc=super.afterCompile(exp,calc,mutable);
  if (calc.getType() instanceof SetType) {
    return new DteScalarCalcImpl(calc,dimensions,Util.unparse(exp));
  }
 else {
    return new DteIterCalcImpl(calc,dimensions,mutable,Util.unparse(exp));
  }
}

Fixed version (ground truth):
protected Calc afterCompile(Exp exp,Calc calc,boolean mutable){
  Dimension[] dimensions=getIndependentDimensions(calc);
  calc=super.afterCompile(exp,calc,mutable);
  if (calc.getType() instanceof SetType) {
    return new DteIterCalcImpl(calc,dimensions,mutable,Util.unparse(exp));
  }
 else {
    return new DteScalarCalcImpl(calc,dimensions,Util.unparse(exp));
  }
}
Program: 51085
Project: 51085
Buggy source:
private boolean equals(Object o1,Object o2){
  if (o1 == null) {
    return o2 == null;
  }
  if (o2 == null) {
    return false;
  }
  if (o1 instanceof Object[]) {
    if (o2 instanceof Object[]) {
      Object[] a1=(Object[])o1;
      Object[] a2=(Object[])o2;
      if (a1.length == a2.length) {
        for (int i=0; i < a1.length; i++) {
          if (!equals(a1[i],a2[i])) {
            return false;
          }
        }
        return true;
      }
    }
    return false;
  }
  if (o1 instanceof List) {
    return o2 instanceof List && equals(((List)o1).toArray(),((List)o2).toArray());
  }
  return o1.equals(o2);
}

Fixed version (ground truth):
private boolean equals(Object o1,Object o2){
  if (o1 == null) {
    return o2 == null;
  }
  if (o2 == null) {
    return false;
  }
  if (o1 instanceof Object[]) {
    if (o2 instanceof Object[]) {
      Object[] a1=(Object[])o1;
      Object[] a2=(Object[])o2;
      if (a1.length == a2.length) {
        for (int i=0; i < a1.length; i++) {
          if (!equals(a1[i],a2[i])) {
            return false;
          }
        }
        return true;
      }
    }
    return false;
  }
  if (o1 instanceof List) {
    return o2 instanceof List && equals(((List)o1).toArray(),((List)o2).toArray());
  }
  if (o1 instanceof Iterable) {
    if (o2 instanceof Iterable) {
      return equals(toList((Iterable)o1),toList((Iterable)o2));
    }
 else {
      return false;
    }
  }
  return o1.equals(o2);
}
Program: 51086
Project: 51086
Buggy source:
public Object getValue(){
  return ci.value;
}

Fixed version (ground truth):
public Object getValue(){
  if (ci.value == Util.nullValue) {
    return null;
  }
  return ci.value;
}
Program: 51087
Project: 51087
Buggy source:
RolapCell(RolapResult result,int[] pos,RolapResult.CellInfo ci){
  this.result=result;
  this.pos=pos;
  this.ci=ci;
}

Fixed version (ground truth):
/** 
 * Creates a RolapCell.
 * @param result Result cell belongs to
 * @param pos Coordinates of cell
 * @param ci Cell information, containing value et cetera
 */
RolapCell(RolapResult result,int[] pos,RolapResult.CellInfo ci){
  this.result=result;
  this.pos=pos;
  this.ci=ci;
}
Program: 51088
Project: 51088
Buggy source:
public void testServiceDiscovery(){
  final ServiceDiscovery<Driver> serviceDiscovery=ServiceDiscovery.forClass(Driver.class);
  final List<Class<Driver>> list=serviceDiscovery.getImplementor();
  assertFalse(list.isEmpty());
  List<String> expectedClassNames=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str"));
  for (  Class<Driver> driverClass : list) {
    expectedClassNames.remove(driverClass.getName());
  }
  assertTrue(expectedClassNames.toString(),expectedClassNames.isEmpty());
}

Fixed version (ground truth):
/** 
 * Tests   {@link mondrian.util.ServiceDiscovery}.
 */
public void testServiceDiscovery(){
  final ServiceDiscovery<Driver> serviceDiscovery=ServiceDiscovery.forClass(Driver.class);
  final List<Class<Driver>> list=serviceDiscovery.getImplementor();
  assertFalse(list.isEmpty());
  List<String> expectedClassNames=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str"));
  for (  Class<Driver> driverClass : list) {
    expectedClassNames.remove(driverClass.getName());
  }
  assertTrue(expectedClassNames.toString(),expectedClassNames.isEmpty());
}
Program: 51089
Project: 51089
Buggy source:
/** 
 * Executes a query.
 * @param queryString Query string
 */
public Result executeQuery(String queryString){
  Connection connection=getConnection();
  queryString=upgradeQuery(queryString);
  Query query=connection.parseQuery(queryString);
  return connection.execute(query);
}

Fixed version (ground truth):
/** 
 * Executes a query.
 * @param queryString Query string
 */
public Result executeQuery(String queryString){
  Connection connection=getConnection();
  queryString=upgradeQuery(queryString);
  Query query=connection.parseQuery(queryString);
  final Result result=connection.execute(query);
  if (MondrianProperties.instance().TestExpDependencies.booleanValue()) {
    assertResultValid(result);
  }
  return result;
}
Program: 51090
Project: 51090
Buggy source:
protected HierarchyBase(Dimension dimension,String subName,boolean hasAll){
  this.dimension=dimension;
  this.hasAll=hasAll;
  this.caption=dimension.getCaption();
  String name=dimension.getName();
  if (MondrianProperties.instance().SsasCompatibleNaming.get()) {
    if (subName == null) {
      subName=name;
    }
    this.subName=subName;
    this.name=subName;
    this.uniqueName=subName.equals(name) ? dimension.getUniqueName() : Util.makeFqName(dimension,this.name);
  }
 else {
    this.subName=subName;
    if (this.subName != null && !this.subName.equals(name)) {
      this.name=name + "String_Node_Str" + subName;
      this.uniqueName=Util.makeFqName(this.name);
    }
 else {
      this.name=name;
      this.uniqueName=dimension.getUniqueName();
    }
  }
}

Fixed version (ground truth):
protected HierarchyBase(Dimension dimension,String subName,boolean hasAll){
  this.dimension=dimension;
  this.hasAll=hasAll;
  this.caption=dimension.getCaption();
  String name=dimension.getName();
  if (MondrianProperties.instance().SsasCompatibleNaming.get()) {
    if (subName == null) {
      subName=name;
    }
    this.subName=subName;
    this.name=subName;
    this.uniqueName=subName.equals(name) ? dimension.getUniqueName() : Util.makeFqName(dimension,this.name);
  }
 else {
    this.subName=subName;
    if (this.subName != null) {
      this.name=name + "String_Node_Str" + subName;
      if (this.subName.equals(name)) {
        this.uniqueName=dimension.getUniqueName();
      }
 else {
        this.uniqueName=Util.makeFqName(this.name);
      }
    }
 else {
      this.name=name;
      this.uniqueName=dimension.getUniqueName();
    }
  }
}
Program: 51091
Project: 51091
Buggy source:
private static String toJavaString(String s){
  s=Util.replace(s,"String_Node_Str","String_Node_Str");
  s=LineBreakPattern.matcher(s).replaceAll(lineBreak2);
  s=TabPattern.matcher(s).replaceAll("String_Node_Str");
  s="String_Node_Str" + s + "String_Node_Str";
  String spurious="String_Node_Str" + nl + "String_Node_Str";
  if (s.endsWith(spurious)) {
    s=s.substring(0,s.length() - spurious.length());
  }
  if (s.indexOf(lineBreak3) >= 0) {
    s="String_Node_Str" + nl + s+ "String_Node_Str";
  }
  return s;
}

Fixed version (ground truth):
private static String toJavaString(String s){
  s=Util.replace(s,"String_Node_Str","String_Node_Str");
  s=LineBreakPattern.matcher(s).replaceAll(lineBreak2);
  s=TabPattern.matcher(s).replaceAll("String_Node_Str");
  s="String_Node_Str" + s + "String_Node_Str";
  String spurious=nl + indent + "String_Node_Str";
  if (s.endsWith(spurious)) {
    s=s.substring(0,s.length() - spurious.length());
  }
  if (s.indexOf(lineBreak3) >= 0) {
    s="String_Node_Str" + nl + indent+ s+ "String_Node_Str";
  }
  return s;
}
Program: 51092
Project: 51092
Buggy source:
/** 
 * Tests whether the database is valid. Allows tests that depend on optional databases to figure out whether to proceed.
 * @return whether a database is present and correct
 */
public boolean databaseIsValid(){
  try {
    Connection connection=getConnection();
    connection.close();
    return true;
  }
 catch (  RuntimeException e) {
    Util.discard(e);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Tests whether the database is valid. Allows tests that depend on optional databases to figure out whether to proceed.
 * @return whether a database is present and correct
 */
public boolean databaseIsValid(){
  try {
    Connection connection=getConnection();
    String cubeName=getDefaultCubeName();
    if (cubeName.indexOf(' ') >= 0) {
      cubeName=Util.quoteMdxIdentifier(cubeName);
    }
    Query query=connection.parseQuery("String_Node_Str" + cubeName);
    Result result=connection.execute(query);
    Util.discard(result);
    connection.close();
    return true;
  }
 catch (  RuntimeException e) {
    Util.discard(e);
    return false;
  }
}
Program: 51093
Project: 51093
Buggy source:
/** 
 * Massages the actual result of executing a query to handle differences in unique names betweeen old and new behavior. <p>Even though the new naming is not enabled by default, reference logs should be in terms of the new naming.
 * @see mondrian.olap.MondrianProperties#SsasCompatibleNaming
 * @param actual Actual result
 * @return Expected result massaged for backwards compatibility
 */
public String upgradeActual(String actual){
  if (!MondrianProperties.instance().SsasCompatibleNaming.get()) {
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
  }
  return actual;
}

Fixed version (ground truth):
/** 
 * Massages the actual result of executing a query to handle differences in unique names betweeen old and new behavior. <p>Even though the new naming is not enabled by default, reference logs should be in terms of the new naming.
 * @see mondrian.olap.MondrianProperties#SsasCompatibleNaming
 * @param actual Actual result
 * @return Expected result massaged for backwards compatibility
 */
public String upgradeActual(String actual){
  if (!MondrianProperties.instance().SsasCompatibleNaming.get()) {
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
    actual=Util.replace(actual,"String_Node_Str","String_Node_Str");
  }
  return actual;
}
Program: 51094
Project: 51094
Buggy source:
public List evaluateList(final Evaluator evaluator){
  this.result=new ConcatenableList();
  for (  VoidCalc voidCalc : voidCalcs) {
    voidCalc.evaluateVoid(evaluator);
  }
  try {
    if (result.get(0) instanceof Member) {
      if (!((Member)result.get(0)).getDimension().isHighCardinality()) {
        result.toArray();
      }
    }
  }
 catch (  IndexOutOfBoundsException iooe) {
  }
catch (  NullPointerException npe) {
  }
  return result;
}

Fixed version (ground truth):
public List evaluateList(final Evaluator evaluator){
  this.result=new ConcatenableList();
  for (  VoidCalc voidCalc : voidCalcs) {
    voidCalc.evaluateVoid(evaluator);
  }
  if (!isItemZeroHighCardDim(result)) {
    result.toArray();
  }
  return result;
}
Program: 51095
Project: 51095
Buggy source:
public Object getPropertyValue(String propertyName,boolean matchCase){
  if (Util.equal(propertyName,Property.CONTRIBUTING_CHILDREN.name,matchCase)) {
    List<RolapMember> list=new ArrayList<RolapMember>();
    list.add(dataMember);
    RolapHierarchy hierarchy=getHierarchy();
    hierarchy.getMemberReader().getMemberChildren(dataMember,list);
    return list;
  }
 else {
    return super.getPropertyValue(propertyName,matchCase);
  }
}

Fixed version (ground truth):
public Object getPropertyValue(String propertyName,boolean matchCase){
  if (Util.equal(propertyName,Property.CONTRIBUTING_CHILDREN.name,matchCase)) {
    List<RolapMember> list=new ArrayList<RolapMember>();
    list.add(dataMember);
    RolapHierarchy hierarchy=getHierarchy();
    if (hierarchy instanceof RolapCubeHierarchy) {
      hierarchy=((RolapCubeHierarchy)hierarchy).getRolapHierarchy();
    }
    hierarchy.getMemberReader().getMemberChildren(dataMember,list);
    return list;
  }
 else {
    return super.getPropertyValue(propertyName,matchCase);
  }
}
Program: 51096
Project: 51096
Buggy source:
/** 
 * Locates the base cube level for a particular virtual level. If not found, return null. This may be converted to a map lookup or cached in some way in the future to increase performance with cubes that have large numbers of hierarchies and levels
 * @param level virtual level
 * @return base cube level if found
 */
public RolapCubeLevel findBaseCubeLevel(RolapLevel level){
  for (int i=0; i < getDimensions().length; i++) {
    Dimension dimension=getDimensions()[i];
    if (dimension.getName().equals(level.getDimension().getName())) {
      for (int j=0; j < dimension.getHierarchies().length; j++) {
        Hierarchy hier=dimension.getHierarchies()[j];
        if (hier.getName().equals(level.getHierarchy().getName())) {
          for (int k=0; k < hier.getLevels().length; k++) {
            Level lvl=hier.getLevels()[k];
            if (lvl.getName().equals(level.getName())) {
              return (RolapCubeLevel)lvl;
            }
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Locates the base cube level for a particular virtual level. If not found, return null. This may be converted to a map lookup or cached in some way in the future to increase performance with cubes that have large numbers of hierarchies and levels
 * @param level virtual level
 * @return base cube level if found
 */
public RolapCubeLevel findBaseCubeLevel(RolapLevel level){
  String levelDimName=level.getDimension().getName();
  String levelHierName=level.getHierarchy().getName();
  boolean isClosure=false;
  String closDimName=null;
  String closHierName=null;
  if (levelDimName.endsWith("String_Node_Str")) {
    isClosure=true;
    closDimName=levelDimName.substring(0,levelDimName.length() - 8);
    closHierName=levelHierName.substring(0,levelHierName.length() - 8);
  }
  for (int i=0; i < getDimensions().length; i++) {
    Dimension dimension=getDimensions()[i];
    if (dimension.getName().equals(levelDimName) || (isClosure && dimension.getName().equals(closDimName))) {
      for (int j=0; j < dimension.getHierarchies().length; j++) {
        Hierarchy hier=dimension.getHierarchies()[j];
        if (hier.getName().equals(levelHierName) || (isClosure && hier.getName().equals(closHierName))) {
          if (isClosure) {
            return (RolapCubeLevel)((RolapCubeLevel)hier.getLevels()[1]).getClosedPeer();
          }
          for (int k=0; k < hier.getLevels().length; k++) {
            Level lvl=hier.getLevels()[k];
            if (lvl.getName().equals(level.getName())) {
              return (RolapCubeLevel)lvl;
            }
          }
        }
      }
    }
  }
  return null;
}
Program: 51097
Project: 51097
Buggy source:
void init(MondrianDef.CubeDimension xmlDimension){
  if (isAll()) {
    this.levelReader=new AllLevelReaderImpl();
  }
 else   if (getLevelType() == LevelType.Null) {
    this.levelReader=new NullLevelReader();
  }
 else   if (rolapLevel.xmlClosure != null) {
    RolapDimension dimension=(RolapDimension)rolapLevel.getClosedPeer().getHierarchy().getDimension();
    RolapCubeDimension cubeDimension=new RolapCubeDimension(getCube(),dimension,xmlDimension,getDimension().getName() + "String_Node_Str",getHierarchy().getDimension().getOrdinal(),getHierarchy().getDimension().isHighCardinality());
    getCube().createUsage((RolapCubeHierarchy)cubeDimension.getHierarchies()[0],xmlDimension);
    cubeDimension.init(xmlDimension);
    getCube().registerDimension(cubeDimension);
    RolapCubeLevel closedPeer=(RolapCubeLevel)cubeDimension.getHierarchies()[0].getLevels()[1];
    this.levelReader=new ParentChildLevelReaderImpl(closedPeer);
  }
 else {
    this.levelReader=new RegularLevelReader();
  }
}

Fixed version (ground truth):
void init(MondrianDef.CubeDimension xmlDimension){
  if (isAll()) {
    this.levelReader=new AllLevelReaderImpl();
  }
 else   if (getLevelType() == LevelType.Null) {
    this.levelReader=new NullLevelReader();
  }
 else   if (rolapLevel.xmlClosure != null) {
    RolapDimension dimension=(RolapDimension)rolapLevel.getClosedPeer().getHierarchy().getDimension();
    RolapCubeDimension cubeDimension=new RolapCubeDimension(getCube(),dimension,xmlDimension,getDimension().getName() + "String_Node_Str",getHierarchy().getDimension().getOrdinal(),getHierarchy().getDimension().isHighCardinality());
    if (!getCube().isVirtual()) {
      getCube().createUsage((RolapCubeHierarchy)cubeDimension.getHierarchies()[0],xmlDimension);
    }
    cubeDimension.init(xmlDimension);
    getCube().registerDimension(cubeDimension);
    closedPeer=(RolapCubeLevel)cubeDimension.getHierarchies()[0].getLevels()[1];
    this.levelReader=new ParentChildLevelReaderImpl(closedPeer);
  }
 else {
    this.levelReader=new RegularLevelReader();
  }
}
Program: 51098
Project: 51098
Buggy source:
boolean hasClosedPeer(){
  return rolapLevel.hasClosedPeer();
}

Fixed version (ground truth):
boolean hasClosedPeer(){
  return closedPeer != null;
}
Program: 51099
Project: 51099
Buggy source:
public List<RolapMember> getMembersInLevel(final RolapLevel level,int startOrdinal,int endOrdinal,TupleConstraint constraint){
  List<RolapMember> members=null;
  boolean joinReq=(constraint instanceof SqlContextConstraint) && (((SqlContextConstraint)constraint).isJoinRequired() || constraint.getEvaluator().isNonEmpty());
  final List<RolapMember> list;
  if (!joinReq) {
    list=rolapHierarchy.getMemberReader().getMembersInLevel(((RolapCubeLevel)level).getRolapLevel(),startOrdinal,endOrdinal,constraint);
  }
 else {
    list=super.getMembersInLevel(level,startOrdinal,endOrdinal,constraint);
  }
  return new UnsupportedList<RolapMember>(){
    public RolapMember get(    final int index){
      return mutate(list.get(index));
    }
    public int size(){
      return list.size();
    }
    public Iterator<RolapMember> iterator(){
      final Iterator<RolapMember> it=list.iterator();
      return new Iterator<RolapMember>(){
        public boolean hasNext(){
          return it.hasNext();
        }
        public RolapMember next(){
          return mutate(it.next());
        }
        public void remove(){
          throw new UnsupportedOperationException();
        }
      }
;
    }
    private RolapMember mutate(    final RolapMember member){
      RolapCubeMember parent=null;
      if (member.getParentMember() != null) {
        parent=createAncestorMembers((RolapCubeLevel)level.getParentLevel(),member.getParentMember());
      }
      return lookupCubeMember(parent,member,(RolapCubeLevel)level);
    }
  }
;
}

Fixed version (ground truth):
public List<RolapMember> getMembersInLevel(final RolapLevel level,int startOrdinal,int endOrdinal,TupleConstraint constraint){
  List<RolapMember> members=null;
  boolean joinReq=(constraint instanceof SqlContextConstraint);
  final List<RolapMember> list;
  if (!joinReq) {
    list=rolapHierarchy.getMemberReader().getMembersInLevel(((RolapCubeLevel)level).getRolapLevel(),startOrdinal,endOrdinal,constraint);
  }
 else {
    list=super.getMembersInLevel(level,startOrdinal,endOrdinal,constraint);
  }
  return new UnsupportedList<RolapMember>(){
    public RolapMember get(    final int index){
      return mutate(list.get(index));
    }
    public int size(){
      return list.size();
    }
    public Iterator<RolapMember> iterator(){
      final Iterator<RolapMember> it=list.iterator();
      return new Iterator<RolapMember>(){
        public boolean hasNext(){
          return it.hasNext();
        }
        public RolapMember next(){
          return mutate(it.next());
        }
        public void remove(){
          throw new UnsupportedOperationException();
        }
      }
;
    }
    private RolapMember mutate(    final RolapMember member){
      RolapCubeMember parent=null;
      if (member.getParentMember() != null) {
        parent=createAncestorMembers((RolapCubeLevel)level.getParentLevel(),member.getParentMember());
      }
      return lookupCubeMember(parent,member,(RolapCubeLevel)level);
    }
  }
;
}
Program: 51100
Project: 51100
Buggy source:
public Object getCacheKey(){
  List<Object> key=new ArrayList<Object>();
  key.add(super.getCacheKey());
  if (orderByExpr != null) {
    key.add(orderByExpr.toString());
  }
  key.add(ascending);
  return key;
}

Fixed version (ground truth):
public Object getCacheKey(){
  List<Object> key=new ArrayList<Object>();
  key.add(super.getCacheKey());
  if (orderByExpr != null) {
    key.add(orderByExpr.toString());
  }
  key.add(ascending);
  key.add(count);
  return key;
}
Program: 51101
Project: 51101
Buggy source:
public TopCountConstraint(CrossJoinArg[] args,RolapEvaluator evaluator,Exp orderByExpr,boolean ascending){
  super(args,evaluator,true);
  this.orderByExpr=orderByExpr;
  this.ascending=ascending;
}

Fixed version (ground truth):
public TopCountConstraint(int count,CrossJoinArg[] args,RolapEvaluator evaluator,Exp orderByExpr,boolean ascending){
  super(args,evaluator,true);
  this.orderByExpr=orderByExpr;
  this.ascending=ascending;
  this.count=new Integer(count);
}
Program: 51102
Project: 51102
Buggy source:
NativeEvaluator createEvaluator(RolapEvaluator evaluator,FunDef fun,Exp[] args){
  boolean ascending;
  if (!isEnabled()) {
    return null;
  }
  if (!TopCountConstraint.isValidContext(evaluator)) {
    return null;
  }
  String funName=fun.getName();
  if ("String_Node_Str".equalsIgnoreCase(funName)) {
    ascending=false;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(funName)) {
    ascending=true;
  }
 else {
    return null;
  }
  if (args.length < 2 || args.length > 3) {
    return null;
  }
  CrossJoinArg[] cargs=checkCrossJoinArg(evaluator,args[0]);
  if (cargs == null) {
    return null;
  }
  if (isPreferInterpreter(cargs,false)) {
    return null;
  }
  if (!(args[1] instanceof Literal)) {
    return null;
  }
  int count=((Literal)args[1]).getIntValue();
  SchemaReader schemaReader=evaluator.getSchemaReader();
  DataSource ds=schemaReader.getDataSource();
  SqlQuery sqlQuery=SqlQuery.newQuery(ds,"String_Node_Str");
  RolapNativeSql sql=new RolapNativeSql(sqlQuery,null);
  Exp orderByExpr=null;
  if (args.length == 3) {
    orderByExpr=args[2];
    String orderBySQL=sql.generateTopCountOrderBy(args[2]);
    if (orderBySQL == null) {
      return null;
    }
  }
  LOGGER.debug("String_Node_Str");
  evaluator=overrideContext(evaluator,cargs,sql.getStoredMeasure());
  TupleConstraint constraint=new TopCountConstraint(cargs,evaluator,orderByExpr,ascending);
  SetEvaluator sev=new SetEvaluator(cargs,schemaReader,constraint);
  sev.setMaxRows(count);
  return sev;
}

Fixed version (ground truth):
NativeEvaluator createEvaluator(RolapEvaluator evaluator,FunDef fun,Exp[] args){
  boolean ascending;
  if (!isEnabled()) {
    return null;
  }
  if (!TopCountConstraint.isValidContext(evaluator)) {
    return null;
  }
  String funName=fun.getName();
  if ("String_Node_Str".equalsIgnoreCase(funName)) {
    ascending=false;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(funName)) {
    ascending=true;
  }
 else {
    return null;
  }
  if (args.length < 2 || args.length > 3) {
    return null;
  }
  CrossJoinArg[] cargs=checkCrossJoinArg(evaluator,args[0]);
  if (cargs == null) {
    return null;
  }
  if (isPreferInterpreter(cargs,false)) {
    return null;
  }
  if (!(args[1] instanceof Literal)) {
    return null;
  }
  int count=((Literal)args[1]).getIntValue();
  SchemaReader schemaReader=evaluator.getSchemaReader();
  DataSource ds=schemaReader.getDataSource();
  SqlQuery sqlQuery=SqlQuery.newQuery(ds,"String_Node_Str");
  RolapNativeSql sql=new RolapNativeSql(sqlQuery,null);
  Exp orderByExpr=null;
  if (args.length == 3) {
    orderByExpr=args[2];
    String orderBySQL=sql.generateTopCountOrderBy(args[2]);
    if (orderBySQL == null) {
      return null;
    }
  }
  LOGGER.debug("String_Node_Str");
  evaluator=overrideContext(evaluator,cargs,sql.getStoredMeasure());
  TupleConstraint constraint=new TopCountConstraint(count,cargs,evaluator,orderByExpr,ascending);
  SetEvaluator sev=new SetEvaluator(cargs,schemaReader,constraint);
  sev.setMaxRows(count);
  return sev;
}
Program: 51103
Project: 51103
Buggy source:
/** 
 * Creates a new Evaluator with the same context except for one member. Equivalent to  {@link #push(Member[]) push(new Member[] &#124;member&#125;)}. <p>You can retrieve this Evaluator by calling the new Evaluator's  {@link #pop()} method, but it is not necessary to call <code>pop</code>.
 * @param member Member to add to the context
 * @return Evaluator with each given member overriding the state of thecurrent Evaluator for its dimension
 */
Evaluator push(Member member);

Fixed version (ground truth):
/** 
 * Creates a new evaluator with the same state except nonEmpty property.
 */
Evaluator push(boolean nonEmpty);
Program: 51104
Project: 51104
Buggy source:
/** 
 * Evaluates the list of members or tuples used in computing the aggregate. If the measure for aggregation has to ignore unrelated dimensions this method will push unrelated dimension members to top level member. This behaviour is driven by the ignoreUnrelatedDimensions property on a base cube usage specified in the virtual cube.Keeps track of the number of iterations that will be required to iterate over the members or tuples needed to compute the aggregate within the current context. In doing so, also determines if the cross product of all iterations across all parent evaluation contexts will exceed the limit set in the properties file.
 * @param listCalc  calculator used to evaluate the member list
 * @param evaluator current evalutor
 * @return list of evaluated members or tuples
 */
protected static List evaluateCurrentList(ListCalc listCalc,Evaluator evaluator){
  List tuples=listCalc.evaluateList(evaluator);
  int currLen=tuples.size();
  crossProd(evaluator,currLen);
  return processUnrelatedDimensions(tuples,evaluator);
}

Fixed version (ground truth):
/** 
 * Evaluates the list of members or tuples used in computing the aggregate. If the measure for aggregation has to ignore unrelated dimensions this method will push unrelated dimension members to top level member. This behaviour is driven by the ignoreUnrelatedDimensions property on a base cube usage specified in the virtual cube.Keeps track of the number of iterations that will be required to iterate over the members or tuples needed to compute the aggregate within the current context. In doing so, also determines if the cross product of all iterations across all parent evaluation contexts will exceed the limit set in the properties file.
 * @param listCalc  calculator used to evaluate the member list
 * @param evaluator current evalutor
 * @return list of evaluated members or tuples
 */
protected static List evaluateCurrentList(ListCalc listCalc,Evaluator evaluator){
  List tuples=listCalc.evaluateList(evaluator.push(false));
  int currLen=tuples.size();
  crossProd(evaluator,currLen);
  return processUnrelatedDimensions(tuples,evaluator);
}
Program: 51105
Project: 51105
Buggy source:
protected Iterable evaluateCurrentIterable(IterCalc iterCalc,Evaluator evaluator){
  Iterable iter=iterCalc.evaluateIterable(evaluator);
  int currLen=0;
  crossProd(evaluator,currLen);
  return iter;
}

Fixed version (ground truth):
protected Iterable evaluateCurrentIterable(IterCalc iterCalc,Evaluator evaluator){
  Iterable iter=iterCalc.evaluateIterable(evaluator.push(false));
  int currLen=0;
  crossProd(evaluator,currLen);
  return iter;
}
Program: 51107
Project: 51107
Buggy source:
public double evaluateDouble(Evaluator evaluator){
  List memberList=evaluateCurrentList(listCalc,evaluator);
  return (Double)avg(evaluator.push(),memberList,calc);
}

Fixed version (ground truth):
public double evaluateDouble(Evaluator evaluator){
  List memberList=evaluateCurrentList(listCalc,evaluator);
  return (Double)avg(evaluator.push(false),memberList,calc);
}
Program: 51108
Project: 51108
Buggy source:
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc=call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=evaluateCurrentList(listCalc,evaluator);
      return (Double)avg(evaluator.push(),memberList,calc);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}

Fixed version (ground truth):
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc=call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=evaluateCurrentList(listCalc,evaluator);
      return (Double)avg(evaluator.push(false),memberList,calc);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}
Program: 51109
Project: 51109
Buggy source:
public double evaluateDouble(Evaluator evaluator){
  List memberList=evaluateCurrentList(listCalc,evaluator);
  return correlation(evaluator.push(),memberList,calc1,calc2);
}

Fixed version (ground truth):
public double evaluateDouble(Evaluator evaluator){
  List memberList=evaluateCurrentList(listCalc,evaluator);
  return correlation(evaluator.push(false),memberList,calc1,calc2);
}
Program: 51110
Project: 51110
Buggy source:
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc1=compiler.compileScalar(call.getArg(1),true);
  final Calc calc2=call.getArgCount() > 2 ? compiler.compileScalar(call.getArg(2),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc1,calc2}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=evaluateCurrentList(listCalc,evaluator);
      return correlation(evaluator.push(),memberList,calc1,calc2);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}

Fixed version (ground truth):
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc1=compiler.compileScalar(call.getArg(1),true);
  final Calc calc2=call.getArgCount() > 2 ? compiler.compileScalar(call.getArg(2),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc1,calc2}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=evaluateCurrentList(listCalc,evaluator);
      return correlation(evaluator.push(false),memberList,calc1,calc2);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}
Program: 51111
Project: 51111
Buggy source:
public int evaluateInteger(Evaluator evaluator){
  if (calc instanceof IterCalc) {
    IterCalc iterCalc=(IterCalc)calc;
    Iterable iterable=evaluateCurrentIterable(iterCalc,evaluator);
    return count(evaluator,iterable,includeEmpty);
  }
 else {
    ListCalc listCalc=(ListCalc)calc;
    List memberList=evaluateCurrentList(listCalc,evaluator);
    return count(evaluator,memberList,includeEmpty);
  }
}

Fixed version (ground truth):
public int evaluateInteger(Evaluator evaluator){
  evaluator=evaluator.push(false);
  if (calc instanceof IterCalc) {
    IterCalc iterCalc=(IterCalc)calc;
    Iterable iterable=evaluateCurrentIterable(iterCalc,evaluator);
    return count(evaluator,iterable,includeEmpty);
  }
 else {
    ListCalc listCalc=(ListCalc)calc;
    List memberList=evaluateCurrentList(listCalc,evaluator);
    return count(evaluator,memberList,includeEmpty);
  }
}
Program: 51112
Project: 51112
Buggy source:
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final Calc calc=compiler.compileAs(call.getArg(0),null,ResultStyle.ITERABLE_ANY);
  final boolean includeEmpty=call.getArgCount() < 2 || ((Literal)call.getArg(1)).getValue().equals("String_Node_Str");
  return new AbstractIntegerCalc(call,new Calc[]{calc}){
    public int evaluateInteger(    Evaluator evaluator){
      if (calc instanceof IterCalc) {
        IterCalc iterCalc=(IterCalc)calc;
        Iterable iterable=evaluateCurrentIterable(iterCalc,evaluator);
        return count(evaluator,iterable,includeEmpty);
      }
 else {
        ListCalc listCalc=(ListCalc)calc;
        List memberList=evaluateCurrentList(listCalc,evaluator);
        return count(evaluator,memberList,includeEmpty);
      }
    }
    public boolean dependsOn(    Dimension dimension){
      if (super.dependsOn(dimension)) {
        return true;
      }
      if (includeEmpty) {
        return false;
      }
      return !calc.getType().usesDimension(dimension,true);
    }
  }
;
}

Fixed version (ground truth):
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final Calc calc=compiler.compileAs(call.getArg(0),null,ResultStyle.ITERABLE_ANY);
  final boolean includeEmpty=call.getArgCount() < 2 || ((Literal)call.getArg(1)).getValue().equals("String_Node_Str");
  return new AbstractIntegerCalc(call,new Calc[]{calc}){
    public int evaluateInteger(    Evaluator evaluator){
      evaluator=evaluator.push(false);
      if (calc instanceof IterCalc) {
        IterCalc iterCalc=(IterCalc)calc;
        Iterable iterable=evaluateCurrentIterable(iterCalc,evaluator);
        return count(evaluator,iterable,includeEmpty);
      }
 else {
        ListCalc listCalc=(ListCalc)calc;
        List memberList=evaluateCurrentList(listCalc,evaluator);
        return count(evaluator,memberList,includeEmpty);
      }
    }
    public boolean dependsOn(    Dimension dimension){
      if (super.dependsOn(dimension)) {
        return true;
      }
      if (includeEmpty) {
        return false;
      }
      return !calc.getType().usesDimension(dimension,true);
    }
  }
;
}
Program: 51113
Project: 51113
Buggy source:
public double evaluateDouble(Evaluator evaluator){
  List memberList=listCalc.evaluateList(evaluator);
  return (Double)covariance(evaluator.push(),memberList,calc1,calc2,biased);
}

Fixed version (ground truth):
public double evaluateDouble(Evaluator evaluator){
  List memberList=listCalc.evaluateList(evaluator);
  return (Double)covariance(evaluator.push(false),memberList,calc1,calc2,biased);
}
Program: 51114
Project: 51114
Buggy source:
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc1=compiler.compileScalar(call.getArg(1),true);
  final Calc calc2=call.getArgCount() > 2 ? compiler.compileScalar(call.getArg(2),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc1,calc2}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=listCalc.evaluateList(evaluator);
      return (Double)covariance(evaluator.push(),memberList,calc1,calc2,biased);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}

Fixed version (ground truth):
public Calc compileCall(ResolvedFunCall call,ExpCompiler compiler){
  final ListCalc listCalc=compiler.compileList(call.getArg(0));
  final Calc calc1=compiler.compileScalar(call.getArg(1),true);
  final Calc calc2=call.getArgCount() > 2 ? compiler.compileScalar(call.getArg(2),true) : new ValueCalc(call);
  return new AbstractDoubleCalc(call,new Calc[]{listCalc,calc1,calc2}){
    public double evaluateDouble(    Evaluator evaluator){
      List memberList=listCalc.evaluateList(evaluator);
      return (Double)covariance(evaluator.push(false),memberList,calc1,calc2,biased);
    }
    public boolean dependsOn(    Dimension dimension){
      return anyDependsButFirst(getCalcs(),dimension);
    }
  }
;
}
Program: 51116
Project: 51116
Buggy source:
public List evaluateList(Evaluator evaluator){
  SchemaReader schemaReader=evaluator.getSchemaReader();
  NativeEvaluator nativeEvaluator=schemaReader.getNativeSetEvaluator(call.getFunDef(),call.getArgs(),evaluator,this);
  if (nativeEvaluator != null) {
    return (List)nativeEvaluator.execute(ResultStyle.LIST);
  }
  List<Member> list=listCalc.evaluateList(evaluator);
  int n=integerCalc.evaluateInteger(evaluator);
  if (n == FunUtil.IntegerNull || n <= 0) {
    return list;
  }
  Level level;
  if (levelCalc == null) {
    level=null;
  }
 else {
    level=levelCalc.evaluateLevel(evaluator);
  }
  List<Member> result=new ArrayList<Member>();
  for (  Member member : list) {
    result.add(member);
    if (level != null && member.getLevel() != level) {
      if (level.getDimension() != member.getDimension()) {
        throw newEvalException(DrilldownLevelTopBottomFunDef.this,"String_Node_Str" + level.getUniqueName() + "String_Node_Str"+ member.getUniqueName()+ "String_Node_Str");
      }
      continue;
    }
    List<Member> children=schemaReader.getMemberChildren(member);
    final List<Member> sortedChildren=sortMembers(evaluator.push(),children,children,orderCalc,top,true);
    int x=Math.min(n,sortedChildren.size());
    for (int i=0; i < x; i++) {
      result.add(sortedChildren.get(i));
    }
  }
  return result;
}

Fixed version (ground truth):
public List evaluateList(Evaluator evaluator){
  SchemaReader schemaReader=evaluator.getSchemaReader();
  NativeEvaluator nativeEvaluator=schemaReader.getNativeSetEvaluator(call.getFunDef(),call.getArgs(),evaluator,this);
  if (nativeEvaluator != null) {
    return (List)nativeEvaluator.execute(ResultStyle.LIST);
  }
  List<Member> list=listCalc.evaluateList(evaluator);
  int n=integerCalc.evaluateInteger(evaluator);
  if (n == FunUtil.IntegerNull || n <= 0) {
    return list;
  }
  Level level;
  if (levelCalc == null) {
    level=null;
  }
 else {
    level=levelCalc.evaluateLevel(evaluator);
  }
  List<Member> result=new ArrayList<Member>();
  for (  Member member : list) {
    result.add(member);
    if (level != null && member.getLevel() != level) {
      if (level.getDimension() != member.getDimension()) {
        throw newEvalException(DrilldownLevelTopBottomFunDef.this,"String_Node_Str" + level.getUniqueName() + "String_Node_Str"+ member.getUniqueName()+ "String_Node_Str");
      }
      continue;
    }
    List<Member> children=schemaReader.getMemberChildren(member);
    final List<Member> sortedChildren=sortMembers(evaluator.push(false),children,children,orderCalc,top,true);
    int x=Math.min(n,sortedChildren.size());
    for (int i=0; i < x; i++) {
      result.add(sortedChildren.get(i));
    }
  }
  return result;
}
Program: 51117
Project: 51117
Buggy source:
protected List makeList(Evaluator evaluator){
  Calc[] calcs=getCalcs();
  TupleListCalc lcalc=(TupleListCalc)calcs[0];
  BooleanCalc bcalc=(BooleanCalc)calcs[1];
  final Evaluator evaluator2=evaluator.push();
  List<Member[]> members=lcalc.evaluateTupleList(evaluator);
  List<Member[]> result=new ArrayList<Member[]>();
  for (int i=0, count=members.size(); i < count; i++) {
    Member[] member=members.get(i);
    evaluator2.setContext(member);
    if (bcalc.evaluateBoolean(evaluator2)) {
      result.add(member);
    }
  }
  return result;
}

Fixed version (ground truth):
protected List makeList(Evaluator evaluator){
  Calc[] calcs=getCalcs();
  TupleListCalc lcalc=(TupleListCalc)calcs[0];
  BooleanCalc bcalc=(BooleanCalc)calcs[1];
  final Evaluator evaluator2=evaluator.push(false);
  List<Member[]> members=lcalc.evaluateTupleList(evaluator);
  List<Member[]> result=new ArrayList<Member[]>();
  for (int i=0, count=members.size(); i < count; i++) {
    Member[] member=members.get(i);
    evaluator2.setContext(member);
    if (bcalc.evaluateBoolean(evaluator2)) {
      result.add(member);
    }
  }
  return result;
}
Program: 51118
Project: 51118
Buggy source:
protected Iterable<Member[]> makeIterable(Evaluator evaluator){
  Calc[] calcs=getCalcs();
  TupleIterCalc icalc=(TupleIterCalc)calcs[0];
  final BooleanCalc bcalc=(BooleanCalc)calcs[1];
  final Evaluator evaluator2=evaluator.push();
  final Iterable<Member[]> iter=icalc.evaluateTupleIterable(evaluator);
  return new Iterable<Member[]>(){
    public Iterator<Member[]> iterator(){
      return new Iterator<Member[]>(){
        Iterator<Member[]> it=iter.iterator();
        Member[] m=null;
        public boolean hasNext(){
          if (m != null) {
            return true;
          }
          if (!it.hasNext()) {
            return false;
          }
          this.m=it.next();
          evaluator2.setContext(this.m);
          while (!bcalc.evaluateBoolean(evaluator2)) {
            if (!it.hasNext()) {
              return false;
            }
            this.m=it.next();
            evaluator2.setContext(this.m);
          }
          return true;
        }
        public Member[] next(){
          try {
            return this.m;
          }
  finally {
            this.m=null;
          }
        }
        public void remove(){
          throw new UnsupportedOperationException("String_Node_Str");
        }
      }
;
    }
  }
;
}

Fixed version (ground truth):
protected Iterable<Member[]> makeIterable(Evaluator evaluator){
  Calc[] calcs=getCalcs();
  TupleIterCalc icalc=(TupleIterCalc)calcs[0];
  final BooleanCalc bcalc=(BooleanCalc)calcs[1];
  final Evaluator evaluator2=evaluator.push(false);
  final Iterable<Member[]> iter=icalc.evaluateTupleIterable(evaluator);
  return new Iterable<Member[]>(){
    public Iterator<Member[]> iterator(){
      return new Iterator<Member[]>(){
        Iterator<Member[]> it=iter.iterator();
        Member[] m=null;
        public boolean hasNext(){
          if (m != null) {
            return true;
          }
          if (!it.hasNext()) {
            return false;
          }
          this.m=it.next();
          evaluator2.setContext(this.m);
          while (!bcalc.evaluateBoolean(evaluator2)) {
            if (!it.hasNext()) {
              return false;
            }
            this.m=it.next();
            evaluator2.setContext(this.m);
          }
          return true;
        }
        public Member[] next(){
          try {
            return this.m;
          }
  finally {
            this.m=null;
          }
        }
        public void remove(){
          throw new UnsupportedOperationException("String_Node_Str");
        }
      }
;
    }
  }
;
}