Program: 86376
Project: 86376
Buggy source:
/** 
 * Parse an extension sub-packet and create a <tt>C</tt> instance. At the beginning of the method call, the xml parser will be positioned on the opening element of the packet extension and at the end of the method call it will be on the closing element of the packet extension.
 * @param parser an XML parser positioned at the packet's starting element.
 * @return a new packet extension instance.
 * @throws java.lang.Exception if an error occurs parsing the XML.
 */
public C parse(XmlPullParser parser,int initialDepth) throws Exception {
  C packetExtension=packetClass.newInstance();
  int attrCount=parser.getAttributeCount();
  for (int i=0; i < attrCount; i++) {
    packetExtension.setAttribute(parser.getAttributeName(i),parser.getAttributeValue(i));
  }
  boolean done=false;
  int eventType;
  String elementName;
  String namespace;
  while (!done) {
    eventType=parser.next();
    elementName=parser.getName();
    namespace=parser.getNamespace();
{
      logger.info("String_Node_Str" + elementName + "String_Node_Str"+ namespace+ "String_Node_Str"+ packetExtension.getClass().getSimpleName());
    }
    if (eventType == XmlPullParser.START_TAG) {
      ExtensionElementProvider provider;
      provider=ProviderManager.getExtensionProvider(elementName,namespace);
      ProviderManager.getExtensionProviders();
      if (provider == null) {
        logger.info("String_Node_Str" + elementName + "String_Node_Str"+ namespace);
      }
 else {
        Element childExtension=provider.parse(parser);
        packetExtension.addChildExtension(childExtension);
      }
    }
    if (eventType == XmlPullParser.END_TAG) {
      if (parser.getName().equals(packetExtension.getElementName())) {
        done=true;
      }
    }
    if (eventType == XmlPullParser.TEXT) {
      String text=parser.getText();
      packetExtension.setText(text);
    }
{
      logger.info("String_Node_Str" + elementName);
    }
  }
  return packetExtension;
}

Fixed version (ground truth):
/** 
 * Parse an extension sub-packet and create a <tt>C</tt> instance. At the beginning of the method call, the xml parser will be positioned on the opening element of the packet extension and at the end of the method call it will be on the closing element of the packet extension.
 * @param parser an XML parser positioned at the packet's starting element.
 * @return a new packet extension instance.
 * @throws java.lang.Exception if an error occurs parsing the XML.
 */
public C parse(XmlPullParser parser,int initialDepth) throws Exception {
  C packetExtension=packetClass.newInstance();
  int attrCount=parser.getAttributeCount();
  for (int i=0; i < attrCount; i++) {
    packetExtension.setAttribute(parser.getAttributeName(i),parser.getAttributeValue(i));
  }
  boolean done=false;
  int eventType;
  String elementName;
  String namespace;
  while (!done) {
    eventType=parser.next();
    elementName=parser.getName();
    namespace=parser.getNamespace();
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("String_Node_Str" + elementName + "String_Node_Str"+ namespace+ "String_Node_Str"+ packetExtension.getClass().getSimpleName()+ "String_Node_Str"+ parser.getDepth());
    }
    if (eventType == XmlPullParser.START_TAG) {
      ExtensionElementProvider provider;
      provider=ProviderManager.getExtensionProvider(elementName,namespace);
      ProviderManager.getExtensionProviders();
      if (provider == null) {
        logger.info("String_Node_Str" + elementName + "String_Node_Str"+ namespace);
      }
 else {
        Element childExtension=provider.parse(parser);
        packetExtension.addChildExtension(childExtension);
      }
    }
    if (eventType == XmlPullParser.END_TAG) {
      if (parser.getName().equals(packetExtension.getElementName())) {
        done=true;
      }
    }
    if (eventType == XmlPullParser.TEXT) {
      String text=parser.getText();
      packetExtension.setText(text);
    }
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("String_Node_Str" + elementName + "String_Node_Str"+ namespace+ "String_Node_Str"+ packetExtension.getClass().getSimpleName()+ "String_Node_Str"+ parser.getDepth());
    }
  }
  return packetExtension;
}