Program: 15609
Project: 15609
Buggy source:
public void endElement(String nsuri,String localName,String qName) throws TLDParsingException {
  if (!stack.peek().equals(qName)) {
    throw new TLDParsingException("String_Node_Str",locator);
  }
  if (stack.size() == 3) {
    if ("String_Node_Str".equals(qName)) {
      if ("String_Node_Str".equals(stack.get(1))) {
        tagName=buf.toString();
        buf=null;
      }
 else       if ("String_Node_Str".equals(stack.get(1))) {
        functionName=buf.toString();
        buf=null;
      }
    }
 else     if ("String_Node_Str".equals(qName) || "String_Node_Str".equals(qName)) {
      tagClassName=buf.toString();
      buf=null;
    }
 else     if ("String_Node_Str".equals(qName)) {
      listenerClassName=buf.toString();
      buf=null;
    }
 else     if ("String_Node_Str".equals(qName)) {
      functionClassName=buf.toString();
      buf=null;
    }
 else     if ("String_Node_Str".equals(qName)) {
      functionSignature=buf.toString();
      buf=null;
    }
  }
 else   if (stack.size() == 2) {
    if ("String_Node_Str".equals(qName)) {
      try {
        Class tagClass=ClassUtil.forName(tagClassName);
        TemplateModel impl;
        if (Tag.class.isAssignableFrom(tagClass)) {
          impl=new TagTransformModel(tagClass);
        }
 else {
          impl=new SimpleTagDirectiveModel(tagClass);
        }
        tagsAndFunctions.put(tagName,impl);
        tagName=null;
        tagClassName=null;
      }
 catch (      IntrospectionException e) {
        throw new TLDParsingException("String_Node_Str" + tagClassName,locator,e);
      }
catch (      ClassNotFoundException e) {
        throw new TLDParsingException("String_Node_Str" + tagClassName,locator,e);
      }
    }
 else     if ("String_Node_Str".equals(qName)) {
      try {
        listeners.add(ClassUtil.forName(listenerClassName).newInstance());
      }
 catch (      Exception e) {
        throw new TLDParsingException("String_Node_Str" + listenerClassName,locator,e);
      }
    }
 else     if ("String_Node_Str".equals(qName) && beansWrapper != null) {
      Class functionClass;
      try {
        functionClass=ClassUtil.forName(functionClassName);
      }
 catch (      ClassNotFoundException e) {
        throw new TLDParsingException("String_Node_Str" + StringUtil.jQuote(functionClassName) + "String_Node_Str"+ StringUtil.jQuote(functionName)+ "String_Node_Str",locator,e);
      }
      Method functionMethod;
      try {
        functionMethod=TaglibMethodUtil.getMethodByFunctionSignature(functionClass,functionSignature);
      }
 catch (      Exception e) {
        throw new TLDParsingException("String_Node_Str" + StringUtil.jQuote(functionSignature) + "String_Node_Str"+ StringUtil.jQuote(functionClass.getName())+ "String_Node_Str"+ StringUtil.jQuote(functionName)+ "String_Node_Str",locator,e);
      }
      int modifiers=functionMethod.getModifiers();
      if (!Modifier.isPublic(modifiers) || !Modifier.isStatic(modifiers)) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      tagsAndFunctions.put(functionName,beansWrapper.wrap(null,functionMethod));
    }
  }
  stack.pop();
}

Fixed version (ground truth):
public void endElement(String nsuri,String localName,String qName) throws TLDParsingException {
  if (!stack.peek().equals(qName)) {
    throw new TLDParsingException("String_Node_Str" + qName + "String_Node_Str",locator);
  }
  if (stack.size() == 3) {
    if (NAME.equals(qName)) {
      if (TAG.equals(stack.get(1))) {
        tagNameCData=cDataCollector.toString();
        cDataCollector=null;
      }
 else       if (FUNCTION.equals(stack.get(1))) {
        functionNameCData=cDataCollector.toString();
        cDataCollector=null;
      }
    }
 else     if (TAG_CLASS_LEGACY.equals(qName) || TAG_CLASS.equals(qName)) {
      tagClassCData=cDataCollector.toString();
      cDataCollector=null;
    }
 else     if (LISTENER_CLASS.equals(qName)) {
      listenerClassCData=cDataCollector.toString();
      cDataCollector=null;
    }
 else     if (FUNCTION_CLASS.equals(qName)) {
      functionClassCData=cDataCollector.toString();
      cDataCollector=null;
    }
 else     if (FUNCTION_SIGNATURE.equals(qName)) {
      functionSignatureCData=cDataCollector.toString();
      cDataCollector=null;
    }
  }
 else   if (stack.size() == 2) {
    if (TAG.equals(qName)) {
      checkChildElementNotNull(qName,NAME,tagNameCData);
      checkChildElementNotNull(qName,TAG_CLASS,tagClassCData);
      final Class tagClass=resoveClassFromTLD(tagClassCData,"String_Node_Str",tagNameCData);
      final TemplateModel impl;
      try {
        if (Tag.class.isAssignableFrom(tagClass)) {
          impl=new TagTransformModel(tagClass);
        }
 else {
          impl=new SimpleTagDirectiveModel(tagClass);
        }
      }
 catch (      IntrospectionException e) {
        throw new TLDParsingException("String_Node_Str" + tagClassCData,locator,e);
      }
      tagsAndFunctions.put(tagNameCData,impl);
      tagNameCData=null;
      tagClassCData=null;
    }
 else     if (FUNCTION.equals(qName) && beansWrapper != null) {
      checkChildElementNotNull(qName,FUNCTION_CLASS,functionClassCData);
      checkChildElementNotNull(qName,FUNCTION_SIGNATURE,functionSignatureCData);
      checkChildElementNotNull(qName,NAME,functionNameCData);
      final Class functionClass=resoveClassFromTLD(functionClassCData,"String_Node_Str",functionNameCData);
      final Method functionMethod;
      try {
        functionMethod=TaglibMethodUtil.getMethodByFunctionSignature(functionClass,functionSignatureCData);
      }
 catch (      Exception e) {
        throw new TLDParsingException("String_Node_Str" + StringUtil.jQuote(functionSignatureCData) + "String_Node_Str"+ StringUtil.jQuote(functionClass.getName())+ "String_Node_Str"+ StringUtil.jQuote(functionNameCData)+ "String_Node_Str",locator,e);
      }
      final int modifiers=functionMethod.getModifiers();
      if (!Modifier.isPublic(modifiers) || !Modifier.isStatic(modifiers)) {
        throw new TLDParsingException("String_Node_Str" + functionMethod,locator);
      }
      final TemplateMethodModelEx methodModel;
      try {
        methodModel=beansWrapper.wrap(null,functionMethod);
      }
 catch (      Exception e) {
        throw new TLDParsingException("String_Node_Str" + functionMethod,locator);
      }
      tagsAndFunctions.put(functionNameCData,methodModel);
      functionNameCData=null;
      functionClassCData=null;
      functionSignatureCData=null;
    }
 else     if (LISTENER.equals(qName)) {
      checkChildElementNotNull(qName,LISTENER_CLASS,listenerClassCData);
      final Class listenerClass=resoveClassFromTLD(listenerClassCData,LISTENER,null);
      final Object listener;
      try {
        listener=listenerClass.newInstance();
      }
 catch (      Exception e) {
        throw new TLDParsingException("String_Node_Str" + listenerClassCData,locator,e);
      }
      listeners.add(listener);
      listenerClassCData=null;
    }
  }
  stack.pop();
}