nus-yam/ex-repair huggingface dataset:
Program: 15502
Project: 15502
Buggy source:
@Override public final void leave(final Cluster parent,final Callback.Completion transitionCallback){
  Callback.Completion cb=new Callback.Completion(){
    @Override public void fire(){
      transitionCallback.fire();
    }
    @Override public void fireException(    Throwable t){
      if (t instanceof FailedRequestException) {
        if (Cluster.this.getState().hasPublicAddressing() && PublicAddressStateCallback.class.isAssignableFrom(msgClass)) {
          transitionCallback.fire();
        }
 else {
          transitionCallback.fireException(t);
        }
      }
 else {
        LOG.trace(t,t);
        transitionCallback.fireException(t);
      }
    }
  }
;
  try {
    if (ClusterLogMessageCallback.class.isAssignableFrom(msgClass)) {
      Callbacks.newRequest(this.factory.newInstance()).then(cb).execute(parent.getServiceEndpoint(),com.eucalyptus.component.id.Cluster.getLogClientPipeline()).getResponse().get();
    }
 else {
      Callbacks.newRequest(this.factory.newInstance()).then(cb).sendSync(parent.getServiceEndpoint());
    }
  }
 catch (  ExecutionException e) {
    if (e.getCause() instanceof FailedRequestException) {
      LOG.error(e.getCause().getMessage());
    }
 else     if (e.getCause() instanceof ConnectionException || e.getCause() instanceof IOException) {
    }
 else {
      LOG.error(e,e);
    }
  }
catch (  InterruptedException e) {
    LOG.error(e,e);
  }
}

Fixed version (ground truth):
@Override public final void leave(final Cluster parent,final Callback.Completion transitionCallback){
  Callback.Completion cb=new Callback.Completion(){
    @Override public void fire(){
      transitionCallback.fire();
    }
    @Override public void fireException(    Throwable t){
      if (t instanceof FailedRequestException) {
        if (Cluster.this.getState().hasPublicAddressing() && PublicAddressStateCallback.class.isAssignableFrom(msgClass)) {
          transitionCallback.fire();
        }
 else {
          transitionCallback.fireException(t);
        }
      }
 else {
        LOG.trace(t,t);
        transitionCallback.fireException(t);
      }
    }
  }
;
  try {
    if (ClusterLogMessageCallback.class.isAssignableFrom(msgClass)) {
      Callbacks.newRequest(this.factory.newInstance()).then(cb).execute(parent.getServiceEndpoint(),com.eucalyptus.component.id.ClusterController.getLogClientPipeline()).getResponse().get();
    }
 else {
      Callbacks.newRequest(this.factory.newInstance()).then(cb).sendSync(parent.getServiceEndpoint());
    }
  }
 catch (  ExecutionException e) {
    if (e.getCause() instanceof FailedRequestException) {
      LOG.error(e.getCause().getMessage());
    }
 else     if (e.getCause() instanceof ConnectionException || e.getCause() instanceof IOException) {
    }
 else {
      LOG.error(e,e);
    }
  }
catch (  InterruptedException e) {
    LOG.error(e,e);
  }
}
Program: 15504
Project: 15504
Buggy source:
public ServiceEndpoint getServiceEndpoint(){
  return Components.lookup(com.eucalyptus.component.id.Cluster.class).lookupService(this.configuration).getEndpoint();
}

Fixed version (ground truth):
public ServiceEndpoint getServiceEndpoint(){
  return Components.lookup(com.eucalyptus.component.id.ClusterController.class).lookupService(this.configuration).getEndpoint();
}
Program: 15506
Project: 15506
Buggy source:
@Override public Component getComponent(){
  return Components.lookup(com.eucalyptus.component.id.Cluster.class);
}

Fixed version (ground truth):
@Override public Component getComponent(){
  return Components.lookup(com.eucalyptus.component.id.ClusterController.class);
}
Program: 15507
Project: 15507
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Any.class);
    }
  }
;
}
Program: 15508
Project: 15508
Buggy source:
public List<Class<ComponentId>> serviceDependencies(){
  return Lists.newArrayList();
}

Fixed version (ground truth):
public List<Class<? extends ComponentId>> serviceDependencies(){
  return Lists.newArrayList();
}
Program: 15509
Project: 15509
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Any.class);
    }
  }
;
}
Program: 15510
Project: 15510
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Any.class);
    }
  }
;
}
Program: 15511
Project: 15511
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Eucalyptus.class);
    }
  }
;
}
Program: 15512
Project: 15512
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Eucalyptus.class);
      this.add(Any.class);
    }
  }
;
}
Program: 15513
Project: 15513
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Eucalyptus.class);
    }
  }
;
}
Program: 15514
Project: 15514
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Eucalyptus.class);
    }
  }
;
}
Program: 15515
Project: 15515
Buggy source:
@Override public List<Class<ComponentId>> serviceDependencies(){
  return deps;
}

Fixed version (ground truth):
@Override public List<Class<? extends ComponentId>> serviceDependencies(){
  return new ArrayList(){
{
      this.add(Eucalyptus.class);
    }
  }
;
}
Program: 15516
Project: 15516
Buggy source:
public DeregisterImageResponseType deregister(DeregisterImageType request) throws EucalyptusCloudException {
  DeregisterImageResponseType reply=request.getReply();
  Context ctx=Contexts.lookup();
  try {
    ImageInfo imgInfo=EntityWrapper.get(ImageInfo.class).lookupAndClose(Images.exampleWithImageId(request.getImageId()));
    if (Lookups.checkPrivilege(request,PolicySpec.EC2_RESOURCE_IMAGE,request.getImageId(),imgInfo.getFullName())) {
      Images.deregisterImage(imgInfo.getDisplayName());
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str");
    }
    return reply;
  }
 catch (  NoSuchImageException ex) {
    LOG.trace(ex);
    reply.set_return(false);
    return reply;
  }
catch (  NoSuchElementException ex) {
    LOG.trace(ex);
    reply.set_return(false);
    return reply;
  }
}

Fixed version (ground truth):
public DeregisterImageResponseType deregister(DeregisterImageType request) throws EucalyptusCloudException {
  DeregisterImageResponseType reply=request.getReply();
  Context ctx=Contexts.lookup();
  try {
    ImageInfo imgInfo=EntityWrapper.get(ImageInfo.class).lookupAndClose(Images.exampleWithImageId(request.getImageId()));
    if (Lookups.checkPrivilege(request,PolicySpec.EC2_RESOURCE_IMAGE,request.getImageId(),Accounts.lookupUserFullNameById(imgInfo.getOwnerUserId()))) {
      Images.deregisterImage(imgInfo.getDisplayName());
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str");
    }
    return reply;
  }
 catch (  NoSuchImageException ex) {
    LOG.trace(ex);
    reply.set_return(false);
    return reply;
  }
catch (  NoSuchElementException ex) {
    LOG.trace(ex);
    reply.set_return(false);
    return reply;
  }
}
Program: 15518
Project: 15518
Buggy source:
@Override public boolean equals(Object o){
  if (o instanceof NumberFormatKey) {
    NumberFormatKey fk=(NumberFormatKey)o;
    return fk.pattern.equals(pattern) && fk.locale.equals(locale);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o instanceof CacheKey) {
    CacheKey fk=(CacheKey)o;
    return fk.pattern.equals(pattern) && fk.locale.equals(locale);
  }
  return false;
}
Program: 15519
Project: 15519
Buggy source:
/** 
 * Creates an   {@link IOException} that has a cause exception.
 */
private IOException newIOException(String message,Throwable cause){
  if (cause == null) {
    return new IOException(message);
  }
  IOException ioe;
  if (INIT_CAUSE != null) {
    ioe=new IOException(message + "String_Node_Str");
    try {
      INIT_CAUSE.invoke(ioe,cause);
    }
 catch (    RuntimeException ex) {
      throw ex;
    }
catch (    Exception ex) {
      throw new UndeclaredThrowableException(ex);
    }
  }
 else {
    ioe=new IOException(message + "String_Node_Str" + cause.getClass().getName()+ "String_Node_Str"+ cause.getMessage());
  }
  return ioe;
}

Fixed version (ground truth):
/** 
 * Creates an   {@link IOException} that has a cause exception.
 */
private IOException newIOException(String message,Throwable cause){
  if (cause == null) {
    return new IOException(message);
  }
  IOException ioe;
  if (INIT_CAUSE != null) {
    ioe=new IOException(message);
    try {
      INIT_CAUSE.invoke(ioe,cause);
    }
 catch (    RuntimeException ex) {
      throw ex;
    }
catch (    Exception ex) {
      throw new UndeclaredThrowableException(ex);
    }
  }
 else {
    ioe=new IOException(message + "String_Node_Str" + cause.getClass().getName()+ "String_Node_Str"+ cause.getMessage());
  }
  return ioe;
}
Program: 15521
Project: 15521
Buggy source:
private ParseException(String description,String templateName,int lineNumber,int columnNumber,int endLineNumber,int endColumnNumber,Throwable cause){
  super(description);
  this.description=description;
  this.templateName=templateName;
  this.lineNumber=lineNumber;
  this.columnNumber=columnNumber;
  this.endLineNumber=endLineNumber;
  this.endColumnNumber=endColumnNumber;
}

Fixed version (ground truth):
private ParseException(String description,String templateName,int lineNumber,int columnNumber,int endLineNumber,int endColumnNumber,Throwable cause){
  super(description);
  try {
    this.initCause(cause);
  }
 catch (  Exception e) {
  }
  this.description=description;
  this.templateName=templateName;
  this.lineNumber=lineNumber;
  this.columnNumber=columnNumber;
  this.endLineNumber=endLineNumber;
  this.endColumnNumber=endColumnNumber;
}
Program: 15522
Project: 15522
Buggy source:
public ConditionalTemplateConfigurerFactory(TemplateSourceMatcher matcher,TemplateConfigurer templateConfigurer){
  this.matcher=matcher;
  this.templateConfigurer=templateConfigurer;
  this.templateConfigurerFactories=null;
}

Fixed version (ground truth):
public ConditionalTemplateConfigurerFactory(TemplateSourceMatcher matcher,TemplateConfigurer templateConfigurer){
  this.matcher=matcher;
  this.templateConfigurer=templateConfigurer;
  this.templateConfigurerFactory=null;
}
Program: 15523
Project: 15523
Buggy source:
@Override public TemplateConfigurer get(String sourceName,Object templateSource) throws IOException, TemplateConfigurerFactoryException {
  if (matcher.matches(sourceName,templateSource)) {
    if (templateConfigurerFactories != null) {
      return templateConfigurerFactories.get(sourceName,templateSource);
    }
 else {
      return templateConfigurer;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public TemplateConfigurer get(String sourceName,Object templateSource) throws IOException, TemplateConfigurerFactoryException {
  if (matcher.matches(sourceName,templateSource)) {
    if (templateConfigurerFactory != null) {
      return templateConfigurerFactory.get(sourceName,templateSource);
    }
 else {
      return templateConfigurer;
    }
  }
 else {
    return null;
  }
}
Program: 15524
Project: 15524
Buggy source:
@Override public TemplateConfigurer get(String sourceName,Object templateSource) throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer mergedTC=null;
  TemplateConfigurer resultTC=null;
  for (  TemplateConfigurerFactory tcf : templateConfigurerFactories) {
    TemplateConfigurer tc=tcf.get(sourceName,templateSource);
    if (tc != null) {
      if (resultTC == null) {
        resultTC=tc;
      }
 else {
        if (mergedTC == null) {
          mergedTC=new TemplateConfigurer();
          mergedTC.merge(resultTC);
          resultTC=mergedTC;
        }
        mergedTC.merge(tc);
      }
    }
  }
  return resultTC;
}

Fixed version (ground truth):
@Override public TemplateConfigurer get(String sourceName,Object templateSource) throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer mergedTC=null;
  TemplateConfigurer resultTC=null;
  for (  TemplateConfigurerFactory tcf : templateConfigurerFactories) {
    TemplateConfigurer tc=tcf.get(sourceName,templateSource);
    if (tc != null) {
      if (resultTC == null) {
        resultTC=tc;
      }
 else {
        if (mergedTC == null) {
          Configuration cfg=getConfiguration();
          if (cfg == null) {
            throw new IllegalStateException("String_Node_Str");
          }
          mergedTC=new TemplateConfigurer();
          mergedTC.setParentConfiguration(cfg);
          mergedTC.merge(resultTC);
          resultTC=mergedTC;
        }
        mergedTC.merge(tc);
      }
    }
  }
  return resultTC;
}
Program: 15526
Project: 15526
Buggy source:
public Configuration getParentConfiguration(){
  return (Configuration)getParent();
}

Fixed version (ground truth):
/** 
 * Returns the parent   {@link Configuration}, or   {@code null} if none was associated yet.
 */
public Configuration getParentConfiguration(){
  return parentConfigurationSet ? (Configuration)getParent() : null;
}
Program: 15527
Project: 15527
Buggy source:
/** 
 * Sets a   {@link TemplateConfigurerFactory} that will configure individual templates where their settings differfrom those coming from the common  {@link Configuration} object. 
 * @since 2.3.24
 */
public void setTemplateConfigurers(TemplateConfigurerFactory templateConfigurers){
  if (cache.getTemplateConfigurers() != templateConfigurers) {
    recreateTemplateCacheWith(cache.getTemplateLoader(),cache.getCacheStorage(),cache.getTemplateLookupStrategy(),cache.getTemplateNameFormat(),templateConfigurers);
  }
}

Fixed version (ground truth):
/** 
 * Sets a   {@link TemplateConfigurerFactory} that will configure individual templates where their settings differfrom those coming from the common  {@link Configuration} object. 
 * @since 2.3.24
 */
public void setTemplateConfigurers(TemplateConfigurerFactory templateConfigurers){
  if (cache.getTemplateConfigurers() != templateConfigurers) {
    templateConfigurers.setConfiguration(this);
    recreateTemplateCacheWith(cache.getTemplateLoader(),cache.getCacheStorage(),cache.getTemplateLookupStrategy(),cache.getTemplateNameFormat(),templateConfigurers);
  }
}
Program: 15528
Project: 15528
Buggy source:
@Test public void testFirstMatch() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc1=newTemplateConfigurer(1);
  TemplateConfigurer tc2=newTemplateConfigurer(2);
  TemplateConfigurer tc3=newTemplateConfigurer(3);
  FirstMatchTemplateConfigurerFactory tcf=new FirstMatchTemplateConfigurerFactory(new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc1),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc2),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc3));
  try {
    assertNotApplicable(tcf,"String_Node_Str");
  }
 catch (  TemplateConfigurerFactoryException e) {
    assertThat(e.getMessage(),Matchers.containsString("String_Node_Str"));
  }
  tcf.setNoMatchErrorDetails("String_Node_Str");
  try {
    assertNotApplicable(tcf,"String_Node_Str");
  }
 catch (  TemplateConfigurerFactoryException e) {
    assertThat(e.getMessage(),Matchers.containsString("String_Node_Str"));
  }
  tcf.setAllowNoMatch(true);
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc3);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertNotApplicable(new FirstMatchTemplateConfigurerFactory().allowNoMatch(true),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testFirstMatch() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc1=newTemplateConfigurer(1);
  TemplateConfigurer tc2=newTemplateConfigurer(2);
  TemplateConfigurer tc3=newTemplateConfigurer(3);
  FirstMatchTemplateConfigurerFactory tcf=new FirstMatchTemplateConfigurerFactory(new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc1),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc2),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc3));
  tcf.setConfiguration(cfg);
  try {
    assertNotApplicable(tcf,"String_Node_Str");
  }
 catch (  TemplateConfigurerFactoryException e) {
    assertThat(e.getMessage(),containsString("String_Node_Str"));
  }
  tcf.setNoMatchErrorDetails("String_Node_Str");
  try {
    assertNotApplicable(tcf,"String_Node_Str");
  }
 catch (  TemplateConfigurerFactoryException e) {
    assertThat(e.getMessage(),containsString("String_Node_Str"));
  }
  tcf.setAllowNoMatch(true);
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc3);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertNotApplicable(new FirstMatchTemplateConfigurerFactory().allowNoMatch(true),"String_Node_Str");
}
Program: 15529
Project: 15529
Buggy source:
@Test public void testMerging() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc1=newTemplateConfigurer(1);
  TemplateConfigurer tc2=newTemplateConfigurer(2);
  TemplateConfigurer tc3=newTemplateConfigurer(3);
  TemplateConfigurerFactory tcf=new MergingTemplateConfigurerFactory(new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc1),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc2),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc3));
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc3);
  assertApplicable(tcf,"String_Node_Str",tc1,tc2);
  assertApplicable(tcf,"String_Node_Str",tc1,tc3);
  assertApplicable(tcf,"String_Node_Str",tc2,tc3);
  assertApplicable(tcf,"String_Node_Str",tc1,tc2,tc3);
  assertNotApplicable(new MergingTemplateConfigurerFactory(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testMerging() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc1=newTemplateConfigurer(1);
  TemplateConfigurer tc2=newTemplateConfigurer(2);
  TemplateConfigurer tc3=newTemplateConfigurer(3);
  TemplateConfigurerFactory tcf=new MergingTemplateConfigurerFactory(new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc1),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc2),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc3));
  tcf.setConfiguration(cfg);
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc1);
  assertApplicable(tcf,"String_Node_Str",tc2);
  assertApplicable(tcf,"String_Node_Str",tc3);
  assertApplicable(tcf,"String_Node_Str",tc1,tc2);
  assertApplicable(tcf,"String_Node_Str",tc1,tc3);
  assertApplicable(tcf,"String_Node_Str",tc2,tc3);
  assertApplicable(tcf,"String_Node_Str",tc1,tc2,tc3);
  assertNotApplicable(new MergingTemplateConfigurerFactory(),"String_Node_Str");
}
Program: 15530
Project: 15530
Buggy source:
private void assertApplicable(TemplateConfigurerFactory tcf,String sourceName,TemplateConfigurer... expectedTCs) throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer mergedTC=tcf.get(sourceName,"String_Node_Str");
  List<String> mergedTCAttNames=Arrays.asList(mergedTC.getCustomAttributeNames());
  for (  TemplateConfigurer expectedTC : expectedTCs) {
    Integer tcId=(Integer)expectedTC.getCustomAttribute("String_Node_Str");
    if (tcId == null) {
      fail("String_Node_Str");
    }
    if (!mergedTCAttNames.contains("String_Node_Str" + tcId)) {
      fail("String_Node_Str" + tcId + "String_Node_Str");
    }
  }
  for (  String attName : mergedTCAttNames) {
    if (!containsCustomAttr(attName,expectedTCs)) {
      fail("String_Node_Str" + attName);
    }
  }
  assertEquals(expectedTCs[expectedTCs.length - 1].getCustomAttribute("String_Node_Str"),mergedTC.getCustomAttribute("String_Node_Str"));
}

Fixed version (ground truth):
private void assertApplicable(TemplateConfigurerFactory tcf,String sourceName,TemplateConfigurer... expectedTCs) throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer mergedTC=tcf.get(sourceName,"String_Node_Str");
  assertNotNull("String_Node_Str",mergedTC.getParentConfiguration());
  List<String> mergedTCAttNames=Arrays.asList(mergedTC.getCustomAttributeNames());
  for (  TemplateConfigurer expectedTC : expectedTCs) {
    Integer tcId=(Integer)expectedTC.getCustomAttribute("String_Node_Str");
    if (tcId == null) {
      fail("String_Node_Str");
    }
    if (!mergedTCAttNames.contains("String_Node_Str" + tcId)) {
      fail("String_Node_Str" + tcId + "String_Node_Str");
    }
  }
  for (  String attName : mergedTCAttNames) {
    if (!containsCustomAttr(attName,expectedTCs)) {
      fail("String_Node_Str" + attName);
    }
  }
  assertEquals(expectedTCs[expectedTCs.length - 1].getCustomAttribute("String_Node_Str"),mergedTC.getCustomAttribute("String_Node_Str"));
}
Program: 15531
Project: 15531
Buggy source:
@Test public void testCondition2() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc=newTemplateConfigurer(1);
  TemplateConfigurerFactory tcf=new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc));
  assertNotApplicable(tcf,"String_Node_Str");
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc);
}

Fixed version (ground truth):
@Test public void testCondition2() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc=newTemplateConfigurer(1);
  TemplateConfigurerFactory tcf=new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc));
  tcf.setConfiguration(cfg);
  assertNotApplicable(tcf,"String_Node_Str");
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc);
}
Program: 15532
Project: 15532
Buggy source:
@Test public void testCondition1() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc=newTemplateConfigurer(1);
  TemplateConfigurerFactory tcf=new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc);
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc);
}

Fixed version (ground truth):
@Test public void testCondition1() throws IOException, TemplateConfigurerFactoryException {
  TemplateConfigurer tc=newTemplateConfigurer(1);
  TemplateConfigurerFactory tcf=new ConditionalTemplateConfigurerFactory(new FileNameGlobMatcher("String_Node_Str"),tc);
  tcf.setConfiguration(cfg);
  assertNotApplicable(tcf,"String_Node_Str");
  assertApplicable(tcf,"String_Node_Str",tc);
}
Program: 15534
Project: 15534
Buggy source:
protected String dump(boolean canonical){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append(expression.getCanonicalForm());
  sb.append("String_Node_Str");
  if (!canonical && expression != escapedExpression) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
protected String dump(boolean canonical,boolean inStringLiteral){
  StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  final String exprCF=expression.getCanonicalForm();
  sb.append(inStringLiteral ? StringUtil.FTLStringLiteralEnc(exprCF,'"') : exprCF);
  sb.append("String_Node_Str");
  if (!canonical && expression != escapedExpression) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 15535
Project: 15535
Buggy source:
protected String dump(boolean canonical){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  buf.append(expression.getCanonicalForm());
  if (hasFormat) {
    buf.append("String_Node_Str");
    buf.append("String_Node_Str");
    buf.append(minFracDigits);
    buf.append("String_Node_Str");
    buf.append(maxFracDigits);
  }
  buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
protected String dump(boolean canonical,boolean inStringLiteral){
  StringBuffer buf=new StringBuffer("String_Node_Str");
  final String exprCF=expression.getCanonicalForm();
  buf.append(inStringLiteral ? StringUtil.FTLStringLiteralEnc(exprCF,'"') : exprCF);
  if (hasFormat) {
    buf.append("String_Node_Str");
    buf.append("String_Node_Str");
    buf.append(minFracDigits);
    buf.append("String_Node_Str");
    buf.append(maxFracDigits);
  }
  buf.append("String_Node_Str");
  return buf.toString();
}
Program: 15536
Project: 15536
Buggy source:
public String getCanonicalForm(){
  return StringUtil.ftlQuote(value);
}

Fixed version (ground truth):
public String getCanonicalForm(){
  if (dynamicValue == null) {
    return StringUtil.ftlQuote(value);
  }
 else {
    StringBuffer sb=new StringBuffer();
    sb.append('"');
    for (Enumeration childrenEnum=dynamicValue.children(); childrenEnum.hasMoreElements(); ) {
      TemplateElement child=(TemplateElement)childrenEnum.nextElement();
      if (child instanceof Interpolation) {
        sb.append(((Interpolation)child).getCanonicalFormInStringLiteral());
      }
 else {
        sb.append(StringUtil.FTLStringLiteralEnc(child.getCanonicalForm(),'"'));
      }
    }
    sb.append('"');
    return sb.toString();
  }
}
Program: 15537
Project: 15537
Buggy source:
private static char[] createEscapes(){
  char[] escapes=new char['\\' + 1];
  for (int i=0; i < 32; ++i) {
    escapes[i]=1;
  }
  escapes['\\']='\\';
  escapes['\'']='\'';
  escapes['"']='"';
  escapes['<']='l';
  escapes['>']='g';
  escapes['&']='a';
  escapes['\b']='b';
  escapes['\t']='t';
  escapes['\n']='n';
  escapes['\f']='f';
  escapes['\r']='r';
  escapes['$']='$';
  return escapes;
}

Fixed version (ground truth):
private static char[] createEscapes(){
  char[] escapes=new char['\\' + 1];
  for (int i=0; i < 32; ++i) {
    escapes[i]=1;
  }
  escapes['\\']='\\';
  escapes['\'']='\'';
  escapes['"']='"';
  escapes['<']='l';
  escapes['>']='g';
  escapes['&']='a';
  escapes['\b']='b';
  escapes['\t']='t';
  escapes['\n']='n';
  escapes['\f']='f';
  escapes['\r']='r';
  return escapes;
}
Program: 15539
Project: 15539
Buggy source:
void setNamespaceExp(Expression namespaceExp){
  this.namespaceExp=namespaceExp;
  for (int i=0; i < nestedElements.size(); i++) {
    ((Assignment)nestedElements.get(i)).setNamespaceExp(namespaceExp);
  }
}

Fixed version (ground truth):
void setNamespaceExp(Expression namespaceExp){
  this.namespaceExp=namespaceExp;
  int ln=getRegulatedChildCount();
  for (int i=0; i < ln; i++) {
    ((Assignment)getRegulatedChild(i)).setNamespaceExp(namespaceExp);
  }
}
Program: 15540
Project: 15540
Buggy source:
void addAssignment(Assignment ass){
  nestedElements.add(ass);
}

Fixed version (ground truth):
void addAssignment(Assignment assignment){
  addRegulatedChild(assignment);
}
Program: 15541
Project: 15541
Buggy source:
AssignmentInstruction(int scope){
  this.scope=scope;
  nestedElements=new ArrayList(1);
}

Fixed version (ground truth):
AssignmentInstruction(int scope){
  this.scope=scope;
  setRegulatedChildBufferCapacity(1);
}
Program: 15542
Project: 15542
Buggy source:
protected String dump(boolean canonical){
  StringBuffer buf=new StringBuffer();
  if (canonical)   buf.append('<');
  buf.append(Assignment.getDirectiveName(scope));
  if (canonical) {
    buf.append(' ');
    for (int i=0; i < nestedElements.size(); i++) {
      Assignment ass=(Assignment)nestedElements.get(i);
      buf.append(ass.getCanonicalForm());
      if (i < nestedElements.size() - 1) {
        buf.append("String_Node_Str");
      }
    }
  }
 else {
    buf.append("String_Node_Str");
  }
  if (namespaceExp != null) {
    buf.append("String_Node_Str");
    buf.append(namespaceExp.getCanonicalForm());
  }
  if (canonical)   buf.append("String_Node_Str");
  return buf.toString();
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  StringBuffer buf=new StringBuffer();
  if (canonical)   buf.append('<');
  buf.append(Assignment.getDirectiveName(scope));
  if (canonical) {
    buf.append(' ');
    int ln=getRegulatedChildCount();
    for (int i=0; i < ln; i++) {
      if (i != 0) {
        buf.append("String_Node_Str");
      }
      Assignment assignment=(Assignment)getRegulatedChild(i);
      buf.append(assignment.getCanonicalForm());
    }
  }
 else {
    buf.append("String_Node_Str");
  }
  if (namespaceExp != null) {
    buf.append("String_Node_Str");
    buf.append(namespaceExp.getCanonicalForm());
  }
  if (canonical)   buf.append("String_Node_Str");
  return buf.toString();
}
Program: 15543
Project: 15543
Buggy source:
void accept(Environment env) throws TemplateException, IOException {
  for (int i=0; i < nestedElements.size(); i++) {
    Assignment ass=(Assignment)nestedElements.get(i);
    env.visit(ass);
  }
}

Fixed version (ground truth):
void accept(Environment env) throws TemplateException, IOException {
  int ln=getRegulatedChildCount();
  for (int i=0; i < ln; i++) {
    Assignment assignment=(Assignment)getRegulatedChild(i);
    env.visit(assignment);
  }
}
Program: 15544
Project: 15544
Buggy source:
AttemptBlock(TemplateElement attemptBlock,RecoveryBlock recoveryBlock){
  this.attemptBlock=attemptBlock;
  this.recoveryBlock=recoveryBlock;
  nestedElements=new ArrayList(2);
  nestedElements.add(attemptBlock);
  nestedElements.add(recoveryBlock);
}

Fixed version (ground truth):
AttemptBlock(TemplateElement attemptBlock,RecoveryBlock recoveryBlock){
  this.attemptBlock=attemptBlock;
  this.recoveryBlock=recoveryBlock;
  setRegulatedChildBufferCapacity(2);
  addRegulatedChild(attemptBlock);
  addRegulatedChild(recoveryBlock);
}
Program: 15545
Project: 15545
Buggy source:
TemplateElement postParseCleanup(boolean stripWhitespace) throws ParseException {
  if (nestedElements.size() == 1) {
    ConditionalBlock cblock=(ConditionalBlock)nestedElements.get(0);
    cblock.isLonelyIf=true;
    cblock.setLocation(getTemplate(),cblock,this);
    return cblock.postParseCleanup(stripWhitespace);
  }
 else {
    return super.postParseCleanup(stripWhitespace);
  }
}

Fixed version (ground truth):
TemplateElement postParseCleanup(boolean stripWhitespace) throws ParseException {
  if (getRegulatedChildCount() == 1) {
    ConditionalBlock cblock=(ConditionalBlock)getRegulatedChild(0);
    cblock.isLonelyIf=true;
    cblock.setLocation(getTemplate(),cblock,this);
    return cblock.postParseCleanup(stripWhitespace);
  }
 else {
    return super.postParseCleanup(stripWhitespace);
  }
}
Program: 15546
Project: 15546
Buggy source:
void addBlock(ConditionalBlock block){
  nestedElements.add(block);
}

Fixed version (ground truth):
void addBlock(ConditionalBlock block){
  addRegulatedChild(block);
}
Program: 15547
Project: 15547
Buggy source:
IfBlock(ConditionalBlock block){
  nestedElements=new ArrayList();
  addBlock(block);
}

Fixed version (ground truth):
IfBlock(ConditionalBlock block){
  setRegulatedChildBufferCapacity(1);
  addBlock(block);
}
Program: 15548
Project: 15548
Buggy source:
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    for (int i=0; i < nestedElements.size(); i++) {
      ConditionalBlock cblock=(ConditionalBlock)nestedElements.get(i);
      buf.append(cblock.dump(canonical));
    }
    buf.append("String_Node_Str");
    return buf.toString();
  }
 else {
    return getNodeTypeSymbol();
  }
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    int ln=getRegulatedChildCount();
    for (int i=0; i < ln; i++) {
      ConditionalBlock cblock=(ConditionalBlock)getRegulatedChild(i);
      buf.append(cblock.dump(canonical));
    }
    buf.append("String_Node_Str");
    return buf.toString();
  }
 else {
    return getNodeTypeSymbol();
  }
}
Program: 15549
Project: 15549
Buggy source:
void accept(Environment env) throws TemplateException, IOException {
  for (int i=0; i < nestedElements.size(); i++) {
    ConditionalBlock cblock=(ConditionalBlock)nestedElements.get(i);
    Expression condition=cblock.condition;
    env.replaceElementStackTop(cblock);
    if (condition == null || condition.evalToBoolean(env)) {
      if (cblock.nestedBlock != null) {
        env.visitByHiddingParent(cblock.nestedBlock);
      }
      return;
    }
  }
}

Fixed version (ground truth):
void accept(Environment env) throws TemplateException, IOException {
  int ln=getRegulatedChildCount();
  for (int i=0; i < ln; i++) {
    ConditionalBlock cblock=(ConditionalBlock)getRegulatedChild(i);
    Expression condition=cblock.condition;
    env.replaceElementStackTop(cblock);
    if (condition == null || condition.evalToBoolean(env)) {
      if (cblock.nestedBlock != null) {
        env.visitByHiddingParent(cblock.nestedBlock);
      }
      return;
    }
  }
}
Program: 15550
Project: 15550
Buggy source:
public ListElseContainer(IteratorBlock listPart,ElseOfList elsePart){
  nestedElements=new ArrayList(2);
  nestedElements.add(listPart);
  nestedElements.add(elsePart);
  this.listPart=listPart;
  this.elsePart=elsePart;
}

Fixed version (ground truth):
public ListElseContainer(IteratorBlock listPart,ElseOfList elsePart){
  setRegulatedChildBufferCapacity(2);
  addRegulatedChild(listPart);
  addRegulatedChild(elsePart);
  this.listPart=listPart;
  this.elsePart=elsePart;
}
Program: 15551
Project: 15551
Buggy source:
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    for (int i=0; i < nestedElements.size(); i++) {
      TemplateElement element=(TemplateElement)nestedElements.get(i);
      buf.append(element.dump(canonical));
    }
    buf.append("String_Node_Str");
    return buf.toString();
  }
 else {
    return getNodeTypeSymbol();
  }
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    int ln=getRegulatedChildCount();
    for (int i=0; i < ln; i++) {
      TemplateElement element=getRegulatedChild(i);
      buf.append(element.dump(canonical));
    }
    buf.append("String_Node_Str");
    return buf.toString();
  }
 else {
    return getNodeTypeSymbol();
  }
}
Program: 15552
Project: 15552
Buggy source:
TemplateElement postParseCleanup(boolean stripWhitespace) throws ParseException {
  super.postParseCleanup(stripWhitespace);
  if (nestedElements.size() == 1) {
    return (TemplateElement)nestedElements.get(0);
  }
  return this;
}

Fixed version (ground truth):
TemplateElement postParseCleanup(boolean stripWhitespace) throws ParseException {
  super.postParseCleanup(stripWhitespace);
  return getRegulatedChildCount() == 1 ? getRegulatedChild(0) : this;
}
Program: 15553
Project: 15553
Buggy source:
/** 
 * Processes the contents of the internal <tt>TemplateElement</tt> list, and outputs the resulting text.
 */
void accept(Environment env) throws TemplateException, IOException {
  for (int i=0; i < nestedElements.size(); i++) {
    TemplateElement element=(TemplateElement)nestedElements.get(i);
    env.visit(element);
  }
}

Fixed version (ground truth):
/** 
 * Processes the contents of the internal <tt>TemplateElement</tt> list, and outputs the resulting text.
 */
void accept(Environment env) throws TemplateException, IOException {
  int ln=getRegulatedChildCount();
  for (int i=0; i < ln; i++) {
    env.visit(getRegulatedChild(i));
  }
}
Program: 15554
Project: 15554
Buggy source:
MixedContent(){
  nestedElements=new ArrayList();
}

Fixed version (ground truth):
MixedContent(){
}
Program: 15555
Project: 15555
Buggy source:
boolean isIgnorable(){
  return nestedElements == null || nestedElements.size() == 0;
}

Fixed version (ground truth):
boolean isIgnorable(){
  return getRegulatedChildCount() == 0;
}
Program: 15556
Project: 15556
Buggy source:
protected boolean isOutputCacheable(){
  for (Enumeration children=children(); children.hasMoreElements(); ) {
    if (!((TemplateElement)children.nextElement()).isOutputCacheable()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean isOutputCacheable(){
  int ln=getRegulatedChildCount();
  for (int i=0; i < ln; i++) {
    if (!getRegulatedChild(i).isOutputCacheable()) {
      return false;
    }
  }
  return true;
}
Program: 15557
Project: 15557
Buggy source:
void addElement(int index,TemplateElement element){
  nestedElements.add(index,element);
}

Fixed version (ground truth):
void addElement(int index,TemplateElement element){
  addRegulatedChild(index,element);
}
Program: 15558
Project: 15558
Buggy source:
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    for (int i=0; i < nestedElements.size(); i++) {
      TemplateElement element=(TemplateElement)nestedElements.get(i);
      buf.append(element.getCanonicalForm());
    }
    return buf.toString();
  }
 else {
    if (parent == null) {
      return "String_Node_Str";
    }
    return getNodeTypeSymbol();
  }
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer buf=new StringBuffer();
    int ln=getRegulatedChildCount();
    for (int i=0; i < ln; i++) {
      buf.append(getRegulatedChild(i).getCanonicalForm());
    }
    return buf.toString();
  }
 else {
    if (parent == null) {
      return "String_Node_Str";
    }
    return getNodeTypeSymbol();
  }
}
Program: 15559
Project: 15559
Buggy source:
/** 
 * @param searched the expression to be tested.
 */
SwitchBlock(Expression searched){
  this.searched=searched;
  nestedElements=new LinkedList();
}

Fixed version (ground truth):
/** 
 * @param searched the expression to be tested.
 */
SwitchBlock(Expression searched){
  this.searched=searched;
  setRegulatedChildBufferCapacity(4);
}
Program: 15560
Project: 15560
Buggy source:
/** 
 * @param cas a Case element.
 */
void addCase(Case cas){
  if (cas.condition == null) {
    defaultCase=cas;
  }
  nestedElements.add(cas);
}

Fixed version (ground truth):
/** 
 * @param cas a Case element.
 */
void addCase(Case cas){
  if (cas.condition == null) {
    defaultCase=cas;
  }
  addRegulatedChild(cas);
}
Program: 15561
Project: 15561
Buggy source:
protected String dump(boolean canonical){
  StringBuffer buf=new StringBuffer();
  if (canonical)   buf.append('<');
  buf.append(getNodeTypeSymbol());
  buf.append(' ');
  buf.append(searched.getCanonicalForm());
  if (canonical) {
    buf.append('>');
    for (int i=0; i < nestedElements.size(); i++) {
      Case cas=(Case)nestedElements.get(i);
      buf.append(cas.getCanonicalForm());
    }
    buf.append("String_Node_Str").append(getNodeTypeSymbol()).append('>');
  }
  return buf.toString();
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  StringBuffer buf=new StringBuffer();
  if (canonical)   buf.append('<');
  buf.append(getNodeTypeSymbol());
  buf.append(' ');
  buf.append(searched.getCanonicalForm());
  if (canonical) {
    buf.append('>');
    int ln=getRegulatedChildCount();
    for (int i=0; i < ln; i++) {
      Case cas=(Case)getRegulatedChild(i);
      buf.append(cas.getCanonicalForm());
    }
    buf.append("String_Node_Str").append(getNodeTypeSymbol()).append('>');
  }
  return buf.toString();
}
Program: 15562
Project: 15562
Buggy source:
void accept(Environment env) throws TemplateException, IOException {
  boolean processedCase=false;
  Iterator iterator=nestedElements.iterator();
  try {
    while (iterator.hasNext()) {
      Case cas=(Case)iterator.next();
      boolean processCase=false;
      if (processedCase) {
        processCase=true;
      }
 else       if (cas.condition != null) {
        processCase=EvalUtil.compare(searched,EvalUtil.CMP_OP_EQUALS,"String_Node_Str",cas.condition,cas.condition,env);
      }
      if (processCase) {
        env.visitByHiddingParent(cas);
        processedCase=true;
      }
    }
    if (!processedCase && defaultCase != null) {
      env.visitByHiddingParent(defaultCase);
    }
  }
 catch (  BreakInstruction.Break br) {
  }
}

Fixed version (ground truth):
void accept(Environment env) throws TemplateException, IOException {
  boolean processedCase=false;
  int ln=getRegulatedChildCount();
  try {
    for (int i=0; i < ln; i++) {
      Case cas=(Case)getRegulatedChild(i);
      boolean processCase=false;
      if (processedCase) {
        processCase=true;
      }
 else       if (cas.condition != null) {
        processCase=EvalUtil.compare(searched,EvalUtil.CMP_OP_EQUALS,"String_Node_Str",cas.condition,cas.condition,env);
      }
      if (processCase) {
        env.visitByHiddingParent(cas);
        processedCase=true;
      }
    }
    if (!processedCase && defaultCase != null) {
      env.visitByHiddingParent(defaultCase);
    }
  }
 catch (  BreakInstruction.Break br) {
  }
}
Program: 15564
Project: 15564
Buggy source:
/** 
 * Creates a template loader that will use the specified servlet context to load the resources. It will use the specified base path, which is interpreted relatively to the context root (does not mater if you start it with "/" or not). Path components should be separated by forward slashes independently of the separator  character used by the underlying operating system.
 * @param servletContext the servlet context whose{@link ServletContext#getResource(String)} will be used to load thetemplates.
 * @param subdirPath the base path to template resources.
 */
public WebappTemplateLoader(ServletContext servletContext,String subdirPath){
  if (servletContext == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (subdirPath == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  subdirPath=subdirPath.replace('\\','/');
  if (!subdirPath.endsWith("String_Node_Str")) {
    subdirPath+="String_Node_Str";
  }
  if (!subdirPath.startsWith("String_Node_Str")) {
    subdirPath="String_Node_Str" + subdirPath;
  }
  this.subdirPath=subdirPath;
  this.servletContext=servletContext;
}

Fixed version (ground truth):
/** 
 * Creates a template loader that will use the specified servlet context to load the resources. It will use the specified base path, which is interpreted relatively to the context root (does not mater if you start it with "/" or not). Path components should be separated by forward slashes independently of the separator character used by the underlying operating system.
 * @param servletContext the servlet context whose  {@link ServletContext#getResource(String)} will be used to load thetemplates.
 * @param subdirPath the base path to template resources.
 */
public WebappTemplateLoader(ServletContext servletContext,String subdirPath){
  if (servletContext == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (subdirPath == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  subdirPath=subdirPath.replace('\\','/');
  if (!subdirPath.endsWith("String_Node_Str")) {
    subdirPath+="String_Node_Str";
  }
  if (!subdirPath.startsWith("String_Node_Str")) {
    subdirPath="String_Node_Str" + subdirPath;
  }
  this.subdirPath=subdirPath;
  this.servletContext=servletContext;
}
Program: 15565
Project: 15565
Buggy source:
public Object findTemplateSource(String name) throws IOException {
  String fullPath=subdirPath + name;
  try {
    String realPath=servletContext.getRealPath(fullPath);
    if (realPath != null) {
      File file=new File(realPath);
      if (!file.isFile()) {
        return null;
      }
      if (file.canRead()) {
        return file;
      }
    }
  }
 catch (  SecurityException e) {
    ;
  }
  URL url=null;
  try {
    url=servletContext.getResource(fullPath);
  }
 catch (  MalformedURLException e) {
    LOG.warn("String_Node_Str" + StringUtil.jQuoteNoXSS(fullPath),e);
    return null;
  }
  return url == null ? null : new URLTemplateSource(url,getURLConnectionUsesCaches());
}

Fixed version (ground truth):
public Object findTemplateSource(String name) throws IOException {
  String fullPath=subdirPath + name;
  if (attemptFileAccess) {
    try {
      String realPath=servletContext.getRealPath(fullPath);
      if (realPath != null) {
        File file=new File(realPath);
        if (file.canRead() && file.isFile()) {
          return file;
        }
      }
    }
 catch (    SecurityException e) {
      ;
    }
  }
  URL url=null;
  try {
    url=servletContext.getResource(fullPath);
  }
 catch (  MalformedURLException e) {
    LOG.warn("String_Node_Str" + StringUtil.jQuoteNoXSS(fullPath),e);
    return null;
  }
  return url == null ? null : new URLTemplateSource(url,getURLConnectionUsesCaches());
}
Program: 15566
Project: 15566
Buggy source:
private static Object[] unexpectedTypeErrorDescription(String expectedTypesDesc,String blamedAssignmentTargetVarName,TemplateModel model){
  return new Object[]{"String_Node_Str",new _DelayedAOrAn(expectedTypesDesc),"String_Node_Str",(blamedAssignmentTargetVarName == null ? (Object)"String_Node_Str" : new Object[]{"String_Node_Str",new _DelayedJQuote(blamedAssignmentTargetVarName)}),"String_Node_Str",new _DelayedAOrAn(new _DelayedFTLTypeDescription(model)),(blamedAssignmentTargetVarName == null ? "String_Node_Str" : "String_Node_Str")};
}

Fixed version (ground truth):
private static Object[] unexpectedTypeErrorDescription(String expectedTypesDesc,Expression blamed,String blamedAssignmentTargetVarName,TemplateModel model){
  return new Object[]{"String_Node_Str",new _DelayedAOrAn(expectedTypesDesc),"String_Node_Str",(blamedAssignmentTargetVarName == null ? (Object)(blamed != null ? "String_Node_Str" : "String_Node_Str") : new Object[]{"String_Node_Str",new _DelayedJQuote(blamedAssignmentTargetVarName)}),"String_Node_Str",new _DelayedAOrAn(new _DelayedFTLTypeDescription(model)),(blamedAssignmentTargetVarName == null ? "String_Node_Str" : "String_Node_Str")};
}