nus-yam/ex-repair huggingface dataset:
Program: 10975
Project: 10975
Buggy source:
@After public void tearDown() throws InterruptedException, TimeoutException {
  focus.tearDown();
  CallManager.restartPool();
  BundleContext ctx=JigasiBundleActivator.osgiContext;
  ServiceReference[] refs=ServiceUtils.getServiceReferences(ctx,ProtocolProviderService.class);
  for (  ServiceReference ref : refs) {
    ProtocolProviderService protoService=(ProtocolProviderService)ctx.getService(ref);
    if (ProtocolNames.JABBER.equals(protoService.getProtocolName())) {
      throw new RuntimeException(protoService + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@After public void tearDown() throws InterruptedException, TimeoutException {
  focus.tearDown();
  CallManager.restartPool();
  BundleContext ctx=JigasiBundleActivator.osgiContext;
  Collection<ServiceReference<ProtocolProviderService>> refs=ServiceUtils.getServiceReferences(ctx,ProtocolProviderService.class);
  for (  ServiceReference ref : refs) {
    ProtocolProviderService protoService=(ProtocolProviderService)ctx.getService(ref);
    if (ProtocolNames.JABBER.equals(protoService.getProtocolName())) {
      throw new RuntimeException(protoService + "String_Node_Str");
    }
  }
}
Program: 10976
Project: 10976
Buggy source:
public boolean compatibleWith(Version that){
  if (that == null)   return false;
  String[] thisParts=this.version.split("String_Node_Str");
  String[] thatParts=that.version.split("String_Node_Str");
  int length=Math.max(thisParts.length,thatParts.length);
  for (int i=0; i < length; i++) {
    int thisPart=i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;
    int thatPart=i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;
switch (i) {
case 0:
{
        if (thisPart != thatPart)         return false;
      }
case 1:
{
      if (thisPart < thatPart)       return false;
    }
case 2:
{
  }
}
}
return true;
}

Fixed version (ground truth):
public boolean compatibleWith(Version that){
  if (that == null)   return false;
  String[] thisParts=this.version.split("String_Node_Str");
  String[] thatParts=that.version.split("String_Node_Str");
  int length=Math.max(thisParts.length,thatParts.length);
  for (int i=0; i < length; i++) {
    int thisPart=i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;
    int thatPart=i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;
switch (i) {
case 0:
{
        if (thisPart != thatPart)         return false;
      }
    break;
case 1:
{
    if (thisPart < thatPart)     return false;
  }
break;
case 2:
{
}
break;
}
}
return true;
}
Program: 10977
Project: 10977
Buggy source:
private static void setup(){
  modelManager=new ModelManager();
  libraryManager=new LibraryManager(modelManager);
  libraryManager.getLibrarySourceLoader().registerProvider(new TestLibrarySourceProvider());
  try {
    ucumService=new UcumEssenceService(UcumEssenceService.class.getResourceAsStream("String_Node_Str"));
  }
 catch (  UcumException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void setup(){
  modelManager=new ModelManager();
  libraryManager=new LibraryManager(modelManager);
  libraryManager.getLibrarySourceLoader().registerProvider(new TestLibrarySourceProvider());
  try {
    ucumService=new UcumEssenceService(UcumEssenceService.class.getResourceAsStream("String_Node_Str"));
    XmlPullParserFactory factory=XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME),null);
    factory.setNamespaceAware(true);
  }
 catch (  UcumException e) {
    e.printStackTrace();
  }
catch (  XmlPullParserException e) {
    e.printStackTrace();
  }
}
Program: 10978
Project: 10978
Buggy source:
@Override public Object visitWithClause(@NotNull cqlParser.WithClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWith();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}

Fixed version (ground truth):
@Override public Object visitWithClause(@NotNull cqlParser.WithClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addRelatedQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWith();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}
Program: 10980
Project: 10980
Buggy source:
@Override public Object visitWithoutClause(@NotNull cqlParser.WithoutClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWithout();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}

Fixed version (ground truth):
@Override public Object visitWithoutClause(@NotNull cqlParser.WithoutClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addRelatedQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWithout();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}
Program: 10981
Project: 10981
Buggy source:
private AliasedQuerySource enterQueryContext(Expression target){
  QueryContext queryContext=new QueryContext();
  queryContext.setIsImplicit(true);
  List<AliasedQuerySource> sources=new ArrayList<>();
  AliasedQuerySource source=of.createAliasedQuerySource().withExpression(target).withAlias("String_Node_Str");
  source.setResultType(target.getResultType());
  sources.add(source);
  queryContext.addQuerySources(sources);
  builder.pushQueryContext(queryContext);
  return source;
}

Fixed version (ground truth):
private AliasedQuerySource enterQueryContext(Expression target){
  QueryContext queryContext=new QueryContext();
  queryContext.setIsImplicit(true);
  List<AliasedQuerySource> sources=new ArrayList<>();
  AliasedQuerySource source=of.createAliasedQuerySource().withExpression(target).withAlias("String_Node_Str");
  source.setResultType(target.getResultType());
  sources.add(source);
  queryContext.addPrimaryQuerySources(sources);
  builder.pushQueryContext(queryContext);
  return source;
}
Program: 10982
Project: 10982
Buggy source:
public void addInclude(IncludeDef includeDef){
  if (library.getIdentifier() == null || library.getIdentifier().getId() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (library.getIncludes() == null) {
    library.setIncludes(of.createLibraryIncludes());
  }
  library.getIncludes().getDef().add(includeDef);
  translatedLibrary.add(includeDef);
  VersionedIdentifier libraryIdentifier=new VersionedIdentifier().withId(includeDef.getPath()).withVersion(includeDef.getVersion());
  TranslatedLibrary referencedLibrary=libraryManager.resolveLibrary(libraryIdentifier,errors);
  libraries.put(includeDef.getLocalIdentifier(),referencedLibrary);
  loadConversionMap(referencedLibrary);
}

Fixed version (ground truth):
public void addInclude(IncludeDef includeDef){
  if (library.getIdentifier() == null || library.getIdentifier().getId() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (library.getIncludes() == null) {
    library.setIncludes(of.createLibraryIncludes());
  }
  library.getIncludes().getDef().add(includeDef);
  translatedLibrary.add(includeDef);
  VersionedIdentifier libraryIdentifier=new VersionedIdentifier().withId(includeDef.getPath()).withVersion(includeDef.getVersion());
  ArrayList<CqlTranslatorException> errors=new ArrayList<CqlTranslatorException>();
  TranslatedLibrary referencedLibrary=libraryManager.resolveLibrary(libraryIdentifier,errors);
  for (  CqlTranslatorException error : errors) {
    this.addException(error);
  }
  libraries.put(includeDef.getLocalIdentifier(),referencedLibrary);
  loadConversionMap(referencedLibrary);
}
Program: 10983
Project: 10983
Buggy source:
public TranslatedLibrary resolveLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  if (libraryIdentifier == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (libraryIdentifier.getId() == null || libraryIdentifier.getId().equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  TranslatedLibrary library=libraries.get(libraryIdentifier.getId());
  if (library != null && libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(library.getIdentifier().getVersion())) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),library.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
 else {
    library=translateLibrary(libraryIdentifier,errors);
    libraries.put(libraryIdentifier.getId(),library);
  }
  return library;
}

Fixed version (ground truth):
public TranslatedLibrary resolveLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  if (libraryIdentifier == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (libraryIdentifier.getId() == null || libraryIdentifier.getId().equals("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  TranslatedLibrary library=libraries.get(libraryIdentifier.getId());
  if (library != null && libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(library.getIdentifier().getVersion())) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),library.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
 else {
    library=translateLibrary(libraryIdentifier,errors);
    if (!HasErrors(errors)) {
      libraries.put(libraryIdentifier.getId(),library);
    }
  }
  return library;
}
Program: 10984
Project: 10984
Buggy source:
private TranslatedLibrary translateLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  InputStream librarySource=null;
  try {
    librarySource=librarySourceLoader.getLibrarySource(libraryIdentifier);
  }
 catch (  Exception e) {
    throw new CqlTranslatorIncludeException(e.getMessage(),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
  if (librarySource == null) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
  try {
    CqlTranslator translator=CqlTranslator.fromStream(librarySource,modelManager,this);
    if (errors != null) {
      errors.addAll(translator.getErrors());
    }
    TranslatedLibrary result=translator.getTranslatedLibrary();
    if (libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(result.getIdentifier().getVersion())) {
      throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),result.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
    }
    return result;
  }
 catch (  IOException e) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
}

Fixed version (ground truth):
private TranslatedLibrary translateLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  InputStream librarySource=null;
  try {
    librarySource=librarySourceLoader.getLibrarySource(libraryIdentifier);
  }
 catch (  Exception e) {
    throw new CqlTranslatorIncludeException(e.getMessage(),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
  if (librarySource == null) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
  try {
    CqlTranslator translator=CqlTranslator.fromStream(librarySource,modelManager,this);
    if (errors != null) {
      errors.addAll(translator.getExceptions());
    }
    TranslatedLibrary result=translator.getTranslatedLibrary();
    if (libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(result.getIdentifier().getVersion())) {
      throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),result.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
    }
    return result;
  }
 catch (  IOException e) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
}
Program: 10985
Project: 10985
Buggy source:
@Override public Object visitWithClause(@NotNull cqlParser.WithClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWith();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}

Fixed version (ground truth):
@Override public Object visitWithClause(@NotNull cqlParser.WithClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addRelatedQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWith();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}
Program: 10987
Project: 10987
Buggy source:
@Override public Object visitWithoutClause(@NotNull cqlParser.WithoutClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWithout();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}

Fixed version (ground truth):
@Override public Object visitWithoutClause(@NotNull cqlParser.WithoutClauseContext ctx){
  AliasedQuerySource aqs=(AliasedQuerySource)visit(ctx.aliasedQuerySource());
  libraryBuilder.peekQueryContext().addRelatedQuerySource(aqs);
  try {
    Expression expression=(Expression)visit(ctx.expression());
    DataTypes.verifyType(expression.getResultType(),libraryBuilder.resolveTypeName("String_Node_Str","String_Node_Str"));
    RelationshipClause result=of.createWithout();
    result.withExpression(aqs.getExpression()).withAlias(aqs.getAlias()).withSuchThat(expression);
    result.setResultType(aqs.getResultType());
    return result;
  }
  finally {
    libraryBuilder.peekQueryContext().removeQuerySource(aqs);
  }
}
Program: 10988
Project: 10988
Buggy source:
private AliasedQuerySource enterQueryContext(Expression target){
  QueryContext queryContext=new QueryContext();
  queryContext.setIsImplicit(true);
  List<AliasedQuerySource> sources=new ArrayList<>();
  AliasedQuerySource source=of.createAliasedQuerySource().withExpression(target).withAlias("String_Node_Str");
  source.setResultType(target.getResultType());
  sources.add(source);
  queryContext.addQuerySources(sources);
  builder.pushQueryContext(queryContext);
  return source;
}

Fixed version (ground truth):
private AliasedQuerySource enterQueryContext(Expression target){
  QueryContext queryContext=new QueryContext();
  queryContext.setIsImplicit(true);
  List<AliasedQuerySource> sources=new ArrayList<>();
  AliasedQuerySource source=of.createAliasedQuerySource().withExpression(target).withAlias("String_Node_Str");
  source.setResultType(target.getResultType());
  sources.add(source);
  queryContext.addPrimaryQuerySources(sources);
  builder.pushQueryContext(queryContext);
  return source;
}
Program: 10990
Project: 10990
Buggy source:
public Conversion findChoiceConversion(ChoiceType fromType,DataType toType,OperatorMap operatorMap){
  DataType selectedChoice=null;
  Conversion result=null;
  for (  DataType choice : fromType.getTypes()) {
    Conversion choiceConversion=findConversion(choice,toType,true,operatorMap);
    if (choiceConversion != null) {
      if (selectedChoice != null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",selectedChoice.toString(),fromType.toString(),toType.toString()));
      }
 else {
        selectedChoice=choice;
        result=new Conversion(fromType,toType,choiceConversion);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public Conversion findChoiceConversion(ChoiceType fromType,DataType toType,OperatorMap operatorMap){
  Conversion result=null;
  for (  DataType choice : fromType.getTypes()) {
    Conversion choiceConversion=findConversion(choice,toType,true,operatorMap);
    if (choiceConversion != null) {
      if (result == null) {
        result=new Conversion(fromType,toType,choiceConversion);
      }
 else {
        result.addAlternativeConversion(choiceConversion);
      }
    }
  }
  return result;
}
Program: 10991
Project: 10991
Buggy source:
public static Cql2ElmVisitor visitFile(String fileName,boolean inClassPath) throws IOException {
  InputStream is=inClassPath ? TestUtils.class.getResourceAsStream(fileName) : new FileInputStream(fileName);
  TokenStream tokens=parseANTLRInputStream(new ANTLRInputStream(is));
  ParseTree tree=parseTokenStream(tokens);
  Cql2ElmVisitor visitor=createElmTranslatorVisitor(tokens,tree);
  visitor.visit(tree);
  return visitor;
}

Fixed version (ground truth):
public static Object visitFile(String fileName) throws IOException {
  File file=new File(URLDecoder.decode(Cql2ElmVisitorTest.class.getResource(fileName).getFile(),"String_Node_Str"));
  CqlTranslator translator=CqlTranslator.fromFile(file,getModelManager(),getLibraryManager());
  ensureValid(translator);
  return translator.toObject();
}
Program: 10992
Project: 10992
Buggy source:
public static Object visitData(String cqlData,boolean enableAnnotations,boolean enableDateRangeOptimization){
  List<CqlTranslator.Options> options=new ArrayList<>();
  if (enableAnnotations) {
    options.add(CqlTranslator.Options.EnableAnnotations);
  }
  if (enableDateRangeOptimization) {
    options.add(CqlTranslator.Options.EnableDateRangeOptimization);
  }
  ModelManager modelManager=new ModelManager();
  CqlTranslator translator=CqlTranslator.fromText(cqlData,modelManager,new LibraryManager(modelManager),options.toArray(new CqlTranslator.Options[options.size()]));
  ensureValid(translator);
  return translator.toObject();
}

Fixed version (ground truth):
public static Object visitData(String cqlData,boolean enableAnnotations,boolean enableDateRangeOptimization){
  List<CqlTranslator.Options> options=new ArrayList<>();
  if (enableAnnotations) {
    options.add(CqlTranslator.Options.EnableAnnotations);
  }
  if (enableDateRangeOptimization) {
    options.add(CqlTranslator.Options.EnableDateRangeOptimization);
  }
  CqlTranslator translator=CqlTranslator.fromText(cqlData,getModelManager(),getLibraryManager(),options.toArray(new CqlTranslator.Options[options.size()]));
  ensureValid(translator);
  return translator.toObject();
}
Program: 10993
Project: 10993
Buggy source:
public static Library visitLibrary(String cqlLibrary){
  ModelManager modelManager=new ModelManager();
  CqlTranslator translator=CqlTranslator.fromText(cqlLibrary,modelManager,new LibraryManager(modelManager));
  ensureValid(translator);
  return translator.toELM();
}

Fixed version (ground truth):
public static Library visitLibrary(String cqlLibrary){
  CqlTranslator translator=CqlTranslator.fromText(cqlLibrary,getModelManager(),getLibraryManager());
  ensureValid(translator);
  return translator.toELM();
}
Program: 10996
Project: 10996
Buggy source:
private void runSemanticTest(String testFileName,int expectedErrors) throws IOException {
  File translationTestFile=new File(URLDecoder.decode(Cql2ElmVisitorTest.class.getResource(testFileName).getFile(),"String_Node_Str"));
  ModelManager modelManager=new ModelManager();
  CqlTranslator translator=CqlTranslator.fromFile(translationTestFile,modelManager,new LibraryManager(modelManager));
  for (  CqlTranslatorException error : translator.getErrors()) {
    System.err.println(String.format("String_Node_Str",error.getLocator().getStartLine(),error.getLocator().getStartChar(),error.getMessage()));
  }
  assertThat(translator.getErrors().size(),is(expectedErrors));
}

Fixed version (ground truth):
private void runSemanticTest(String testFileName,int expectedErrors) throws IOException {
  TestUtils.runSemanticTest(testFileName,expectedErrors);
}
Program: 10997
Project: 10997
Buggy source:
public void addInclude(IncludeDef includeDef){
  if (library.getIdentifier() == null || library.getIdentifier().getId() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (library.getIncludes() == null) {
    library.setIncludes(of.createLibraryIncludes());
  }
  library.getIncludes().getDef().add(includeDef);
  translatedLibrary.add(includeDef);
  VersionedIdentifier libraryIdentifier=new VersionedIdentifier().withId(includeDef.getPath()).withVersion(includeDef.getVersion());
  TranslatedLibrary referencedLibrary=libraryManager.resolveLibrary(libraryIdentifier,errors);
  libraries.put(includeDef.getLocalIdentifier(),referencedLibrary);
  loadConversionMap(referencedLibrary);
}

Fixed version (ground truth):
public void addInclude(IncludeDef includeDef){
  if (library.getIdentifier() == null || library.getIdentifier().getId() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (library.getIncludes() == null) {
    library.setIncludes(of.createLibraryIncludes());
  }
  library.getIncludes().getDef().add(includeDef);
  translatedLibrary.add(includeDef);
  VersionedIdentifier libraryIdentifier=new VersionedIdentifier().withId(includeDef.getPath()).withVersion(includeDef.getVersion());
  ArrayList<CqlTranslatorException> errors=new ArrayList<CqlTranslatorException>();
  TranslatedLibrary referencedLibrary=libraryManager.resolveLibrary(libraryIdentifier,errors);
  for (  CqlTranslatorException error : errors) {
    this.addException(error);
  }
  libraries.put(includeDef.getLocalIdentifier(),referencedLibrary);
  loadConversionMap(referencedLibrary);
}
Program: 10998
Project: 10998
Buggy source:
private TranslatedLibrary translateLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  InputStream librarySource=null;
  try {
    librarySource=librarySourceLoader.getLibrarySource(libraryIdentifier);
  }
 catch (  Exception e) {
    throw new CqlTranslatorIncludeException(e.getMessage(),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
  if (librarySource == null) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
  try {
    CqlTranslator translator=CqlTranslator.fromStream(librarySource,modelManager,this);
    if (errors != null) {
      errors.addAll(translator.getErrors());
    }
    TranslatedLibrary result=translator.getTranslatedLibrary();
    if (libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(result.getIdentifier().getVersion())) {
      throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),result.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
    }
    return result;
  }
 catch (  IOException e) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
}

Fixed version (ground truth):
private TranslatedLibrary translateLibrary(VersionedIdentifier libraryIdentifier,List<CqlTranslatorException> errors){
  InputStream librarySource=null;
  try {
    librarySource=librarySourceLoader.getLibrarySource(libraryIdentifier);
  }
 catch (  Exception e) {
    throw new CqlTranslatorIncludeException(e.getMessage(),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
  if (librarySource == null) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
  }
  try {
    CqlTranslator translator=CqlTranslator.fromStream(librarySource,modelManager,this);
    if (errors != null) {
      errors.addAll(translator.getExceptions());
    }
    TranslatedLibrary result=translator.getTranslatedLibrary();
    if (libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(result.getIdentifier().getVersion())) {
      throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion(),result.getIdentifier().getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion());
    }
    return result;
  }
 catch (  IOException e) {
    throw new CqlTranslatorIncludeException(String.format("String_Node_Str",libraryIdentifier.getId(),libraryIdentifier.getVersion()),libraryIdentifier.getId(),libraryIdentifier.getVersion(),e);
  }
}
Program: 11000
Project: 11000
Buggy source:
private Expression promoteListExpression(Expression expression,Conversion conversion){
  if (conversion.getConversion() != null) {
    expression=convertExpression(expression,conversion.getConversion());
  }
  if (expression.getResultType().equals(resolveTypeName("String_Node_Str","String_Node_Str"))) {
    reportWarning("String_Node_Str",expression);
  }
  ToList toList=of.createToList().withOperand(expression);
  toList.setResultType(new ListType(expression.getResultType()));
  return toList;
}

Fixed version (ground truth):
private Expression promoteListExpression(Expression expression,Conversion conversion){
  if (conversion.getConversion() != null) {
    expression=convertExpression(expression,conversion.getConversion());
  }
  if (expression.getResultType().equals(resolveTypeName("String_Node_Str","String_Node_Str"))) {
    reportWarning("String_Node_Str",expression);
  }
  return resolveToList(expression);
}
Program: 11001
Project: 11001
Buggy source:
@Override public void syntaxError(Recognizer<?,?> recognizer,Object offendingSymbol,int line,int charPositionInLine,String msg,RecognitionException e){
  if (!((Token)offendingSymbol).getText().trim().isEmpty()) {
    result.addError(new Exception(String.format("String_Node_Str",line,charPositionInLine,msg)));
  }
}

Fixed version (ground truth):
@Override public void syntaxError(Recognizer<?,?> recognizer,Object offendingSymbol,int line,int charPositionInLine,String msg,RecognitionException e){
  if (!((Token)offendingSymbol).getText().trim().isEmpty()) {
    errors.add(new Exception(String.format("String_Node_Str",line,charPositionInLine,msg)));
  }
}
Program: 11002
Project: 11002
Buggy source:
public static String getInputStreamAsString(InputStream is){
  input=new BufferedReader(new InputStreamReader(is)).lines().collect(Collectors.joining("String_Node_Str"));
  return input;
}

Fixed version (ground truth):
public static String getInputStreamAsString(InputStream is){
  return new BufferedReader(new InputStreamReader(is)).lines().collect(Collectors.joining("String_Node_Str"));
}
Program: 11003
Project: 11003
Buggy source:
@Override public Object visitTerminal(TerminalNode node){
  appendTerminal(node.getText());
  return super.visitTerminal(node);
}

Fixed version (ground truth):
@Override public Object visitTerminal(TerminalNode node){
  checkForComment(node);
  appendTerminal(node.getText());
  return super.visitTerminal(node);
}
Program: 11004
Project: 11004
Buggy source:
public static String getFormattedOutput(InputStream is) throws IOException {
  ANTLRInputStream in=new ANTLRInputStream(is);
  cqlLexer lexer=new cqlLexer(in);
  CommonTokenStream tokens=new CommonTokenStream(lexer);
  tokens.fill();
  CommentListener listener=new CommentListener(tokens);
  listener.rewriteTokens();
  cqlParser parser=new cqlParser(listener.tokens);
  parser.addErrorListener(new SyntaxErrorListener());
  parser.setBuildParseTree(true);
  ParserRuleContext tree=parser.library();
  CqlFormatterVisitor formatter=new CqlFormatterVisitor();
  String output=(String)formatter.visit(tree);
  if (!((SyntaxErrorListener)parser.getErrorListeners().get(1)).result.errors.isEmpty()) {
    CqlFormatterVisitor.endResult.setCql(input);
    CqlFormatterVisitor.endResult.setErrors(((SyntaxErrorListener)parser.getErrorListeners().get(1)).result.errors);
    return CqlFormatterVisitor.endResult.inputInError();
  }
  return listener.refineOutput(output);
}

Fixed version (ground truth):
public static String getFormattedOutput(InputStream is) throws IOException {
  ANTLRInputStream in=new ANTLRInputStream(is);
  cqlLexer lexer=new cqlLexer(in);
  CommonTokenStream tokens=new CommonTokenStream(lexer);
  tokens.fill();
  populateComments(tokens);
  cqlParser parser=new cqlParser(tokens);
  parser.addErrorListener(new SyntaxErrorListener());
  parser.setBuildParseTree(true);
  ParserRuleContext tree=parser.library();
  if (((SyntaxErrorListener)parser.getErrorListeners().get(1)).errors.size() > 0) {
    return ((SyntaxErrorListener)parser.getErrorListeners().get(1)).errors.toString() + "String_Node_Str" + in.toString();
  }
  CqlFormatterVisitor formatter=new CqlFormatterVisitor();
  String output=(String)formatter.visit(tree);
  if (comments.size() > 0) {
    StringBuilder eofComments=new StringBuilder().append("String_Node_Str");
    for (    Token comment : comments) {
      eofComments.append(comment.getText()).append("String_Node_Str");
    }
    comments.clear();
    output+=eofComments.toString();
  }
  return output;
}
Program: 11005
Project: 11005
Buggy source:
@Override public Object visitChildren(RuleNode node){
  Object result=defaultResult();
  int n=node.getChildCount();
  for (int i=0; i < n; i++) {
    if (!shouldVisitNextChild(node,result)) {
      break;
    }
    ParseTree c=node.getChild(i);
    if (c instanceof ErrorNodeImpl) {
      c=new TerminalNodeImpl(((ErrorNodeImpl)c).getSymbol());
    }
    if ((node instanceof cqlParser.TupleSelectorContext || node instanceof cqlParser.TupleTypeSpecifierContext) && c instanceof TerminalNodeImpl) {
      if (((TerminalNodeImpl)c).getSymbol().getText().equals("String_Node_Str")) {
        decreaseIndentLevel();
        newLine();
      }
    }
    Object childResult=c.accept(this);
    result=aggregateResult(result,childResult);
  }
  return result;
}

Fixed version (ground truth):
@Override public Object visitChildren(RuleNode node){
  Object result=defaultResult();
  int n=node.getChildCount();
  for (int i=0; i < n; i++) {
    if (!shouldVisitNextChild(node,result)) {
      break;
    }
    ParseTree c=node.getChild(i);
    if ((node instanceof cqlParser.TupleSelectorContext || node instanceof cqlParser.TupleTypeSpecifierContext) && c instanceof TerminalNodeImpl) {
      if (((TerminalNodeImpl)c).getSymbol().getText().equals("String_Node_Str")) {
        decreaseIndentLevel();
        newLine();
      }
    }
    Object childResult=c.accept(this);
    result=aggregateResult(result,childResult);
  }
  return result;
}
Program: 11006
Project: 11006
Buggy source:
@Test public void TestFormatterSpecific() throws IOException {
  runTest("String_Node_Str");
  try {
    runTest("String_Node_Str");
  }
 catch (  AssertionError ae) {
  }
}

Fixed version (ground truth):
@Test public void TestFormatterSpecific() throws IOException {
  try {
    runTest("String_Node_Str");
  }
 catch (  AssertionError ae) {
  }
  try {
    runTest("String_Node_Str");
  }
 catch (  AssertionError ae) {
  }
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  runTest("String_Node_Str");
  try {
    runTest("String_Node_Str");
  }
 catch (  AssertionError ae) {
  }
}
Program: 11007
Project: 11007
Buggy source:
@Override public Object visitOverlapsIntervalOperatorPhrase(@NotNull cqlParser.OverlapsIntervalOperatorPhraseContext ctx){
  String operatorName=null;
  BinaryExpression operator;
  String dateTimePrecision=ctx.dateTimePrecisionSpecifier() != null ? ctx.dateTimePrecisionSpecifier().dateTimePrecision().getText() : null;
  if (ctx.getChildCount() == (1 + dateTimePrecision == null ? 0 : 1)) {
    operator=dateTimePrecision != null ? of.createOverlaps().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlaps();
    operatorName="String_Node_Str";
  }
 else {
    if ("String_Node_Str".equals(ctx.getChild(1).getText())) {
      operator=dateTimePrecision != null ? of.createOverlapsBefore().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlapsBefore();
      operatorName="String_Node_Str";
    }
 else {
      operator=dateTimePrecision != null ? of.createOverlapsAfter().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlapsAfter();
      operatorName="String_Node_Str";
    }
  }
  operator.withOperand(timingOperators.peek().getLeft(),timingOperators.peek().getRight());
  libraryBuilder.resolveBinaryCall("String_Node_Str",operatorName,operator);
  return operator;
}

Fixed version (ground truth):
@Override public Object visitOverlapsIntervalOperatorPhrase(@NotNull cqlParser.OverlapsIntervalOperatorPhraseContext ctx){
  String operatorName=null;
  BinaryExpression operator;
  String dateTimePrecision=ctx.dateTimePrecisionSpecifier() != null ? ctx.dateTimePrecisionSpecifier().dateTimePrecision().getText() : null;
  if (ctx.getChildCount() == (1 + (dateTimePrecision == null ? 0 : 1))) {
    operator=dateTimePrecision != null ? of.createOverlaps().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlaps();
    operatorName="String_Node_Str";
  }
 else {
    if ("String_Node_Str".equals(ctx.getChild(1).getText())) {
      operator=dateTimePrecision != null ? of.createOverlapsBefore().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlapsBefore();
      operatorName="String_Node_Str";
    }
 else {
      operator=dateTimePrecision != null ? of.createOverlapsAfter().withPrecision(parseDateTimePrecision(dateTimePrecision)) : of.createOverlapsAfter();
      operatorName="String_Node_Str";
    }
  }
  operator.withOperand(timingOperators.peek().getLeft(),timingOperators.peek().getRight());
  libraryBuilder.resolveBinaryCall("String_Node_Str",operatorName,operator);
  return operator;
}
Program: 11010
Project: 11010
Buggy source:
private Expression resolveFunction(String libraryName,String functionName,cqlParser.ParamListContext paramList){
  List<Expression> expressions=new ArrayList<Expression>();
  if (paramList != null && paramList.expression() != null) {
    for (    cqlParser.ExpressionContext expressionContext : paramList.expression()) {
      expressions.add((Expression)visit(expressionContext));
    }
  }
  boolean checkForward=libraryName == null || libraryName.equals("String_Node_Str") || libraryName.equals(this.libraryInfo.getLibraryName());
  Expression result=libraryBuilder.resolveFunction(libraryName,functionName,expressions,!checkForward);
  if (result == null) {
    libraryBuilder.pushExpressionDefinition(functionName);
    try {
      Iterable<FunctionDefinitionInfo> functionInfos=libraryInfo.resolveFunctionReference(functionName);
      if (functionInfos != null) {
        Stack<Chunk> saveChunks=chunks;
        chunks=new Stack<Chunk>();
        try {
          for (          FunctionDefinitionInfo functionInfo : functionInfos) {
            String saveContext=currentContext;
            currentContext=functionInfo.getContext();
            try {
              internalVisitFunctionDefinition(functionInfo.getDefinition());
            }
  finally {
              currentContext=saveContext;
            }
          }
        }
  finally {
          chunks=saveChunks;
        }
      }
      result=libraryBuilder.resolveFunction(libraryName,functionName,expressions,true);
    }
  finally {
      libraryBuilder.popExpressionDefinition();
    }
  }
  return result;
}

Fixed version (ground truth):
private Expression resolveFunction(String libraryName,String functionName,cqlParser.ParamListContext paramList){
  List<Expression> expressions=new ArrayList<Expression>();
  if (paramList != null && paramList.expression() != null) {
    for (    cqlParser.ExpressionContext expressionContext : paramList.expression()) {
      expressions.add((Expression)visit(expressionContext));
    }
  }
  boolean checkForward=libraryName == null || libraryName.equals("String_Node_Str") || libraryName.equals(this.libraryInfo.getLibraryName());
  Expression result=libraryBuilder.resolveFunction(libraryName,functionName,expressions,!checkForward);
  if (result == null) {
    Iterable<FunctionDefinitionInfo> functionInfos=libraryInfo.resolveFunctionReference(functionName);
    if (functionInfos != null) {
      Stack<Chunk> saveChunks=chunks;
      chunks=new Stack<Chunk>();
      try {
        for (        FunctionDefinitionInfo functionInfo : functionInfos) {
          String saveContext=currentContext;
          currentContext=functionInfo.getContext();
          try {
            internalVisitFunctionDefinition(functionInfo.getDefinition());
          }
  finally {
            currentContext=saveContext;
          }
        }
      }
  finally {
        chunks=saveChunks;
      }
    }
    result=libraryBuilder.resolveFunction(libraryName,functionName,expressions,true);
  }
  return result;
}
Program: 11011
Project: 11011
Buggy source:
public ExpressionDef internalVisitExpressionDefinition(@NotNull cqlParser.ExpressionDefinitionContext ctx){
  String identifier=parseString(ctx.identifier());
  ExpressionDef def=libraryBuilder.resolveExpressionRef(identifier);
  if (def == null) {
    libraryBuilder.pushExpressionDefinition(identifier);
    libraryBuilder.pushExpressionContext(currentContext);
    try {
      def=of.createExpressionDef().withAccessLevel(parseAccessModifier(ctx.accessModifier())).withName(identifier).withContext(currentContext).withExpression((Expression)visit(ctx.expression()));
      def.setResultType(def.getExpression().getResultType());
      libraryBuilder.addExpression(def);
    }
  finally {
      libraryBuilder.popExpressionDefinition();
      libraryBuilder.popExpressionContext();
    }
  }
  return def;
}

Fixed version (ground truth):
public ExpressionDef internalVisitExpressionDefinition(@NotNull cqlParser.ExpressionDefinitionContext ctx){
  String identifier=parseString(ctx.identifier());
  ExpressionDef def=libraryBuilder.resolveExpressionRef(identifier);
  if (def == null) {
    libraryBuilder.pushExpressionContext(currentContext);
    try {
      libraryBuilder.pushExpressionDefinition(identifier);
      try {
        def=of.createExpressionDef().withAccessLevel(parseAccessModifier(ctx.accessModifier())).withName(identifier).withContext(currentContext).withExpression((Expression)visit(ctx.expression()));
        def.setResultType(def.getExpression().getResultType());
        libraryBuilder.addExpression(def);
      }
  finally {
        libraryBuilder.popExpressionDefinition();
      }
    }
  finally {
      libraryBuilder.popExpressionContext();
    }
  }
  return def;
}
Program: 11013
Project: 11013
Buggy source:
private OperandRef resolveOperandRef(String identifier){
  if (currentFunctionDef != null) {
    for (    OperandDef operand : currentFunctionDef.getOperand()) {
      if (operand.getName().equals(identifier)) {
        return (OperandRef)of.createOperandRef().withName(identifier).withResultType(operand.getResultType());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private OperandRef resolveOperandRef(String identifier){
  if (!functionDefs.empty()) {
    for (    OperandDef operand : functionDefs.peek().getOperand()) {
      if (operand.getName().equals(identifier)) {
        return (OperandRef)of.createOperandRef().withName(identifier).withResultType(operand.getResultType());
      }
    }
  }
  return null;
}
Program: 11014
Project: 11014
Buggy source:
public Expression popExpressionTarget(){
  return targets.pop();
}

Fixed version (ground truth):
public Expression popExpressionTarget(){
  return getScope().getTargets().pop();
}
Program: 11015
Project: 11015
Buggy source:
public boolean inQueryContext(){
  return queries.size() > 0;
}

Fixed version (ground truth):
public boolean inQueryContext(){
  return hasScope() && getScope().getQueries().size() > 0;
}
Program: 11016
Project: 11016
Buggy source:
private LetClause resolveQueryLet(String identifier){
  for (  QueryContext query : queries) {
    LetClause let=query.resolveLet(identifier);
    if (let != null) {
      return let;
    }
  }
  return null;
}

Fixed version (ground truth):
private LetClause resolveQueryLet(String identifier){
  if (inQueryContext()) {
    for (int i=getScope().getQueries().size() - 1; i >= 0; i--) {
      LetClause let=getScope().getQueries().get(i).resolveLet(identifier);
      if (let != null) {
        return let;
      }
    }
  }
  return null;
}
Program: 11017
Project: 11017
Buggy source:
public void pushQueryContext(QueryContext context){
  queries.push(context);
}

Fixed version (ground truth):
public void pushQueryContext(QueryContext context){
  getScope().getQueries().push(context);
}
Program: 11018
Project: 11018
Buggy source:
public void pushExpressionTarget(Expression target){
  targets.push(target);
}

Fixed version (ground truth):
public void pushExpressionTarget(Expression target){
  getScope().getTargets().push(target);
}
Program: 11019
Project: 11019
Buggy source:
public void endFunctionDef(){
  currentFunctionDef=null;
}

Fixed version (ground truth):
public void endFunctionDef(){
  functionDefs.pop();
}
Program: 11020
Project: 11020
Buggy source:
public boolean hasExpressionTarget(){
  return !targets.isEmpty();
}

Fixed version (ground truth):
public boolean hasExpressionTarget(){
  return hasScope() && !getScope().getTargets().isEmpty();
}
Program: 11021
Project: 11021
Buggy source:
private IdentifierRef resolveQueryResultElement(String identifier){
  if (queries.size() > 0) {
    QueryContext query=queries.peek();
    if (query.inSortClause() && !query.isSingular()) {
      DataType sortColumnType=resolveProperty(query.getResultElementType(),identifier,false);
      if (sortColumnType != null) {
        IdentifierRef result=new IdentifierRef().withName(identifier);
        result.setResultType(sortColumnType);
        return result;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private IdentifierRef resolveQueryResultElement(String identifier){
  if (inQueryContext()) {
    QueryContext query=peekQueryContext();
    if (query.inSortClause() && !query.isSingular()) {
      DataType sortColumnType=resolveProperty(query.getResultElementType(),identifier,false);
      if (sortColumnType != null) {
        IdentifierRef result=new IdentifierRef().withName(identifier);
        result.setResultType(sortColumnType);
        return result;
      }
    }
  }
  return null;
}
Program: 11022
Project: 11022
Buggy source:
private DataType getExpressionDefResultType(ExpressionDef expressionDef){
  if (currentExpressionContext().equals(expressionDef.getContext())) {
    return expressionDef.getResultType();
  }
  if (inPatientContext()) {
    return expressionDef.getResultType();
  }
  if (inPopulationContext()) {
    if (!queries.empty() && queries.peek().inSourceClause()) {
      queries.peek().referencePatientContext();
    }
    DataType resultType=expressionDef.getResultType();
    if (!(resultType instanceof ListType)) {
      return new ListType(resultType);
    }
 else {
      return resultType;
    }
  }
  throw new IllegalArgumentException(String.format("String_Node_Str",currentExpressionContext(),expressionDef.getContext()));
}

Fixed version (ground truth):
private DataType getExpressionDefResultType(ExpressionDef expressionDef){
  if (currentExpressionContext().equals(expressionDef.getContext())) {
    return expressionDef.getResultType();
  }
  if (inPatientContext()) {
    return expressionDef.getResultType();
  }
  if (inPopulationContext()) {
    if (inQueryContext() && getScope().getQueries().peek().inSourceClause()) {
      getScope().getQueries().peek().referencePatientContext();
    }
    DataType resultType=expressionDef.getResultType();
    if (!(resultType instanceof ListType)) {
      return new ListType(resultType);
    }
 else {
      return resultType;
    }
  }
  throw new IllegalArgumentException(String.format("String_Node_Str",currentExpressionContext(),expressionDef.getContext()));
}
Program: 11023
Project: 11023
Buggy source:
public QueryContext popQueryContext(){
  return queries.pop();
}

Fixed version (ground truth):
public QueryContext popQueryContext(){
  return getScope().getQueries().pop();
}
Program: 11024
Project: 11024
Buggy source:
public void beginFunctionDef(FunctionDef functionDef){
  currentFunctionDef=functionDef;
}

Fixed version (ground truth):
public void beginFunctionDef(FunctionDef functionDef){
  functionDefs.push(functionDef);
}
Program: 11025
Project: 11025
Buggy source:
public QueryContext peekQueryContext(){
  return queries.peek();
}

Fixed version (ground truth):
public QueryContext peekQueryContext(){
  return getScope().getQueries().peek();
}