nus-yam/ex-repair huggingface dataset:
Program: 152654
Project: 152654
Buggy source:
private void fillErrorStanza(XMPPCoreStanza stanza,StanzaErrorType type,StanzaErrorCondition errorCondition,String errorText,String errorLang,XMLElement errorConditionElement,StanzaBuilder responseBuilder){
  responseBuilder.addPreparedElement(stanza);
  responseBuilder.startInnerElement("String_Node_Str").addAttribute("String_Node_Str",type.value());
  responseBuilder.startInnerElement(errorCondition.value());
  responseBuilder.addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS);
  responseBuilder.endInnerElement();
  if (errorText != null && errorLang != null) {
    responseBuilder.startInnerElement("String_Node_Str").addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).addAttribute("String_Node_Str",errorLang).addText(errorText);
  }
  if (errorConditionElement != null)   responseBuilder.addPreparedElement(errorConditionElement);
  responseBuilder.endInnerElement();
}

Fixed version (ground truth):
private void fillErrorStanza(XMPPCoreStanza stanza,StanzaErrorType type,StanzaErrorCondition errorCondition,String errorText,String errorLang,XMLElement errorConditionElement,StanzaBuilder responseBuilder){
  for (  XMLElement innerElement : stanza.getInnerElements()) {
    responseBuilder.addPreparedElement(innerElement);
  }
  responseBuilder.startInnerElement("String_Node_Str").addAttribute("String_Node_Str",type.value());
  responseBuilder.startInnerElement(errorCondition.value());
  responseBuilder.addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS);
  responseBuilder.endInnerElement();
  if (errorText != null && errorLang != null) {
    responseBuilder.startInnerElement("String_Node_Str").addNamespaceAttribute(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).addAttribute("String_Node_Str",errorLang).addText(errorText);
  }
  if (errorConditionElement != null)   responseBuilder.addPreparedElement(errorConditionElement);
  responseBuilder.endInnerElement();
}
Program: 152655
Project: 152655
Buggy source:
public void testSubscribeNoFrom() throws Exception {
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(null,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.RESULT.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement sub=response.getFirstInnerElement().getFirstInnerElement();
  assertEquals("String_Node_Str",sub.getName());
  assertEquals(testNode,sub.getAttributeValue("String_Node_Str"));
  assertEquals(client.getFullQualifiedName(),sub.getAttributeValue("String_Node_Str"));
  assertNotNull(sub.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",sub.getAttributeValue("String_Node_Str"));
}

Fixed version (ground truth):
public void testSubscribeNoFrom() throws Exception {
  DefaultSubscribeStanzaGenerator sg=(DefaultSubscribeStanzaGenerator)getDefaultStanzaGenerator();
  sg.overrideSubscriberJID(client.getFullQualifiedName());
  Stanza stanza=sg.getStanza(null,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.RESULT.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement sub=response.getFirstInnerElement().getFirstInnerElement();
  assertEquals("String_Node_Str",sub.getName());
  assertEquals(testNode,sub.getAttributeValue("String_Node_Str"));
  assertEquals(client.getFullQualifiedName(),sub.getAttributeValue("String_Node_Str"));
  assertNotNull(sub.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",sub.getAttributeValue("String_Node_Str"));
}
Program: 152656
Project: 152656
Buggy source:
/** 
 * tries to find the handler by trying 1. value of xmlElement's XMLNS attribute, if unique 2. xmlElements namespace, if the element name has a namespace prefix
 */
private StanzaHandler getHandlerForElement(Stanza stanza,XMLElement xmlElement){
  String namespace=xmlElement.getVerifier().getUniqueXMLNSValue();
  NamespaceHandlerDictionary namespaceHandlerDictionary=dictionaries.get(namespace);
  if (namespaceHandlerDictionary == null) {
    namespace=xmlElement.getNamespacePrefix();
    namespaceHandlerDictionary=dictionaries.get(namespace);
  }
  if (namespaceHandlerDictionary != null)   return namespaceHandlerDictionary.get(stanza);
  if (XMPPCoreStanza.getWrapper(stanza) != null)   return SERVICE_UNAVAILABLE_STANZA_ERROR_HANDLER;
  return null;
}

Fixed version (ground truth):
/** 
 * tries to find the handler by trying 1. value of xmlElement's XMLNS attribute, if unique 2. xmlElements namespace, if the element name has a namespace prefix
 */
private StanzaHandler getHandlerForElement(Stanza stanza,XMLElement xmlElement){
  String namespace=xmlElement.getNamespaceURI();
  NamespaceHandlerDictionary namespaceHandlerDictionary=dictionaries.get(namespace);
  if (namespaceHandlerDictionary == null) {
    namespace=xmlElement.getNamespacePrefix();
    namespaceHandlerDictionary=dictionaries.get(namespace);
  }
  if (namespaceHandlerDictionary != null)   return namespaceHandlerDictionary.get(stanza);
  if (XMPPCoreStanza.getWrapper(stanza) != null)   return SERVICE_UNAVAILABLE_STANZA_ERROR_HANDLER;
  return null;
}
Program: 152657
Project: 152657
Buggy source:
private XMLElement createElementOrStanza(String elementName,List<Attribute> attributes,String namespace,List<XMLFragment> innerFragments,boolean createStanza) throws DecodingException {
  int i=elementName.indexOf("String_Node_Str");
  if (i >= 1) {
    namespace=elementName.substring(i + 1);
    elementName=elementName.substring(0,i);
    if ("String_Node_Str".equals(namespace) || "String_Node_Str".equals(elementName))     throw new DecodingException("String_Node_Str" + namespace + "String_Node_Str"+ elementName);
  }
 else   if (i == 0) {
    throw new DecodingException("String_Node_Str");
  }
  if (createStanza)   return new Stanza(elementName,namespace,attributes,innerFragments);
 else   return new XMLElement(elementName,namespace,attributes,innerFragments);
}

Fixed version (ground truth):
private XMLElement createElementOrStanza(String elementName,List<Attribute> attributes,String namespacePrefix,List<XMLFragment> innerFragments,boolean createStanza) throws DecodingException {
  int i=elementName.indexOf("String_Node_Str");
  if (i >= 1) {
    namespacePrefix=elementName.substring(0,i);
    elementName=elementName.substring(i + 1);
    if ("String_Node_Str".equals(namespacePrefix) || "String_Node_Str".equals(elementName))     throw new DecodingException("String_Node_Str" + namespacePrefix + "String_Node_Str"+ elementName);
  }
 else   if (i == 0) {
    throw new DecodingException("String_Node_Str");
  }
  if (createStanza)   return new Stanza(elementName,namespacePrefix,attributes,innerFragments);
 else   return new XMLElement(elementName,namespacePrefix,attributes,innerFragments);
}
Program: 152658
Project: 152658
Buggy source:
public void testCreateDuplicate() throws Exception {
  String testNode="String_Node_Str";
  root.createNode(pubsubService,testNode);
  assertNotNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElements().get(1);
  XMLElement conflict=error.getFirstInnerElement();
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",conflict.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,conflict.getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testCreateDuplicate() throws Exception {
  String testNode="String_Node_Str";
  root.createNode(pubsubService,testNode);
  assertNotNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElements().get(1);
  XMLElement conflict=error.getFirstInnerElement();
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  assertEquals("String_Node_Str",conflict.getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,conflict.getNamespaceURI());
}
Program: 152659
Project: 152659
Buggy source:
public void testPublishNoSuchNode() throws Exception {
  DefaultPublishStanzaGenerator sg=new DefaultPublishStanzaGenerator();
  Entity pubsubWrongNode=EntityImpl.parse("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testPublishNoSuchNode() throws Exception {
  DefaultPublishStanzaGenerator sg=new DefaultPublishStanzaGenerator();
  Entity pubsubWrongNode=EntityImpl.parse("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152660
Project: 152660
Buggy source:
public void testPublishForbidden() throws Exception {
  DefaultPublishStanzaGenerator sg=new DefaultPublishStanzaGenerator();
  Entity yodaNotSubscribed=new EntityImpl("String_Node_Str","String_Node_Str","String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(yodaNotSubscribed,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testPublishForbidden() throws Exception {
  DefaultPublishStanzaGenerator sg=new DefaultPublishStanzaGenerator();
  Entity yodaNotSubscribed=new EntityImpl("String_Node_Str","String_Node_Str","String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(yodaNotSubscribed,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152661
Project: 152661
Buggy source:
public void testPublishWithSubscriber() throws BindException {
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Entity francisco=createUser("String_Node_Str");
  Entity bernardo=createUser("String_Node_Str");
  node.subscribe("String_Node_Str",francisco);
  node.subscribe("String_Node_Str",bernardo);
  node.subscribe("String_Node_Str",client);
  assertEquals(3,node.countSubscriptions());
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.RESULT.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement pubsub=response.getFirstInnerElement();
  XMLElement publish=pubsub.getFirstInnerElement();
  XMLElement item=publish.getFirstInnerElement();
  assertEquals("String_Node_Str",pubsub.getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB,pubsub.getVerifier().getUniqueXMLNSValue());
  assertEquals("String_Node_Str",publish.getName());
  assertEquals("String_Node_Str",item.getName());
  assertNotNull(item.getAttributeValue("String_Node_Str"));
  assertEquals(3,relay.getCountRelayed());
}

Fixed version (ground truth):
public void testPublishWithSubscriber() throws BindException {
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Entity francisco=createUser("String_Node_Str");
  Entity bernardo=createUser("String_Node_Str");
  node.subscribe("String_Node_Str",francisco);
  node.subscribe("String_Node_Str",bernardo);
  node.subscribe("String_Node_Str",client);
  assertEquals(3,node.countSubscriptions());
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.RESULT.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement pubsub=response.getFirstInnerElement();
  XMLElement publish=pubsub.getFirstInnerElement();
  XMLElement item=publish.getFirstInnerElement();
  assertEquals("String_Node_Str",pubsub.getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB,pubsub.getNamespaceURI());
  assertEquals("String_Node_Str",publish.getName());
  assertEquals("String_Node_Str",item.getName());
  assertNotNull(item.getAttributeValue("String_Node_Str"));
  assertEquals(3,relay.getCountRelayed());
}
Program: 152662
Project: 152662
Buggy source:
public void testSubscribeJIDMalformed(){
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str",testNode),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testSubscribeJIDMalformed(){
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str",testNode),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152663
Project: 152663
Buggy source:
public void testSubscribeNoSuchNode() throws Exception {
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  Entity pubsubWrongNode=EntityImpl.parse("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testSubscribeNoSuchNode() throws Exception {
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  Entity pubsubWrongNode=EntityImpl.parse("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152664
Project: 152664
Buggy source:
public void testSubscribeNonMatchingJIDs(){
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str",testNode),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testSubscribeNonMatchingJIDs(){
  DefaultSubscribeStanzaGenerator sg=new DefaultSubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str",testNode),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getNamespaceURI());
}
Program: 152665
Project: 152665
Buggy source:
public void testUnsubscribeJIDMalformed(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeJIDMalformed(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  sg.overrideSubscriberJID("String_Node_Str");
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152666
Project: 152666
Buggy source:
public void testUnsubscribeForbidden() throws Exception {
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  String yoda="String_Node_Str";
  sg.overrideSubscriberJID(yoda);
  node.subscribe("String_Node_Str",EntityImpl.parse(yoda));
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeForbidden() throws Exception {
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  String yoda="String_Node_Str";
  sg.overrideSubscriberJID(yoda);
  node.subscribe("String_Node_Str",EntityImpl.parse(yoda));
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152667
Project: 152667
Buggy source:
public void testUnsubscribeNoSuchSubscriber(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  assertFalse(node.isSubscribed(client));
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeNoSuchSubscriber(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  assertFalse(node.isSubscribed(client));
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals(0,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getNamespaceURI());
}
Program: 152668
Project: 152668
Buggy source:
public void testUnsubscribeNoSuchNode(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  Entity pubsubWrongNode=new EntityImpl(null,"String_Node_Str",null);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeNoSuchNode(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  Entity pubsubWrongNode=new EntityImpl(null,"String_Node_Str",null);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubWrongNode,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertFalse(node.isSubscribed(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152669
Project: 152669
Buggy source:
public void testUnsubscribeMultipleNoSubID(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  node.subscribe("String_Node_Str",client);
  node.subscribe("String_Node_Str",client);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals(2,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeMultipleNoSubID(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  node.subscribe("String_Node_Str",client);
  node.subscribe("String_Node_Str",client);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals(2,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getNamespaceURI());
}
Program: 152670
Project: 152670
Buggy source:
public void testUnsubscribeBadSubID(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  sg.setSubID("String_Node_Str");
  node.subscribe("String_Node_Str",client);
  node.subscribe("String_Node_Str",client);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals(2,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testUnsubscribeBadSubID(){
  DefaultUnsubscribeStanzaGenerator sg=new DefaultUnsubscribeStanzaGenerator();
  sg.setSubID("String_Node_Str");
  node.subscribe("String_Node_Str",client);
  node.subscribe("String_Node_Str",client);
  ResponseStanzaContainer result=sendStanza(sg.getStanza(client,pubsubService,"String_Node_Str","String_Node_Str"),true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertTrue(node.isSubscribed(client));
  assertEquals(2,node.countSubscriptions(client));
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(2,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
  assertEquals("String_Node_Str",errorContent.get(1).getName());
  assertEquals(NamespaceURIs.XEP0060_PUBSUB_ERRORS,errorContent.get(1).getNamespaceURI());
}
Program: 152671
Project: 152671
Buggy source:
public void testDeleteNotAuth() throws Exception {
  String testNode="String_Node_Str";
  root.createNode(pubsubService,testNode);
  assertNotNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
  LeafNode n=root.find(testNode);
  assertNotNull(n);
}

Fixed version (ground truth):
public void testDeleteNotAuth() throws Exception {
  String testNode="String_Node_Str";
  root.createNode(pubsubService,testNode);
  assertNotNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
  LeafNode n=root.find(testNode);
  assertNotNull(n);
}
Program: 152672
Project: 152672
Buggy source:
public void testDeleteNoSuchNode() throws Exception {
  String testNode="String_Node_Str";
  assertNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getVerifier().getUniqueXMLNSValue());
}

Fixed version (ground truth):
public void testDeleteNoSuchNode() throws Exception {
  String testNode="String_Node_Str";
  assertNull(root.find(testNode));
  AbstractStanzaGenerator sg=getDefaultStanzaGenerator();
  Stanza stanza=sg.getStanza(client,pubsubService,"String_Node_Str",testNode);
  ResponseStanzaContainer result=sendStanza(stanza,true);
  assertTrue(result.hasResponse());
  IQStanza response=new IQStanza(result.getResponseStanza());
  assertEquals(IQStanzaType.ERROR.value(),response.getType());
  assertEquals("String_Node_Str",response.getAttributeValue("String_Node_Str"));
  XMLElement error=response.getInnerElementsNamed("String_Node_Str").get(0);
  assertEquals("String_Node_Str",error.getName());
  assertEquals("String_Node_Str",error.getAttributeValue("String_Node_Str"));
  List<XMLElement> errorContent=error.getInnerElements();
  assertEquals(1,errorContent.size());
  assertEquals("String_Node_Str",errorContent.get(0).getName());
  assertEquals(NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS,errorContent.get(0).getNamespaceURI());
}
Program: 152673
Project: 152673
Buggy source:
public boolean verify(Stanza stanza){
  verifyCalled=true;
  if (name != null && !name.equals(stanza.getName()))   return false;
  if (namespaceURI == null)   return true;
  boolean elementNamespaceMatches=false;
  if (namespaceURI != null && namespaceURI.equals(stanza.getNamespacePrefix()))   elementNamespaceMatches=true;
  boolean outerNamespaceMatches=false;
  boolean innerNamespaceMatches=false;
  if (namespaceURI != null && namespaceURI.equals(stanza.getVerifier().getUniqueXMLNSValue()))   outerNamespaceMatches=true;
  XMLElement firstInnerElement=stanza.getFirstInnerElement();
  if (firstInnerElement != null) {
    if (namespaceURI != null && namespaceURI.equals(firstInnerElement.getVerifier().getUniqueXMLNSValue()))     innerNamespaceMatches=true;
  }
  return elementNamespaceMatches || outerNamespaceMatches || innerNamespaceMatches;
}

Fixed version (ground truth):
public boolean verify(Stanza stanza){
  verifyCalled=true;
  if (name != null && !name.equals(stanza.getName()))   return false;
  if (namespaceURI == null)   return true;
  boolean elementNamespaceMatches=false;
  if (namespaceURI != null && namespaceURI.equals(stanza.getNamespacePrefix()))   elementNamespaceMatches=true;
  boolean outerNamespaceMatches=false;
  boolean innerNamespaceMatches=false;
  if (namespaceURI != null && namespaceURI.equals(stanza.getNamespaceURI()))   outerNamespaceMatches=true;
  XMLElement firstInnerElement=stanza.getFirstInnerElement();
  if (firstInnerElement != null) {
    if (namespaceURI != null && namespaceURI.equals(firstInnerElement.getNamespaceURI()))     innerNamespaceMatches=true;
  }
  return elementNamespaceMatches || outerNamespaceMatches || innerNamespaceMatches;
}
Program: 152674
Project: 152674
Buggy source:
@Override protected void processElement(IIOPMetaData metaData,XMLStreamReader reader,final PropertyReplacer propertyReplacer) throws XMLStreamException {
  Namespace namespace=Namespace.forUri(reader.getNamespaceURI());
switch (namespace) {
case EJB3_IIOP:
{
      Element element=Element.forName(reader.getLocalName());
switch (element) {
case BINDING_NAME:
{
          metaData.setBindingName(getElementText(reader,propertyReplacer));
          break;
        }
case IOR_SECURITY_CONFIG:
{
        IORSecurityConfigMetaData iorSecurityMetaData=this.processIORSecurityConfig(reader,propertyReplacer);
        metaData.setIorSecurityConfigMetaData(iorSecurityMetaData);
        break;
      }
  }
  return;
}
}
super.processElement(metaData,reader,propertyReplacer);
}

Fixed version (ground truth):
@Override protected void processElement(IIOPMetaData metaData,XMLStreamReader reader,final PropertyReplacer propertyReplacer) throws XMLStreamException {
  Namespace namespace=Namespace.forUri(reader.getNamespaceURI());
switch (namespace) {
case EJB3_IIOP:
{
      Element element=Element.forName(reader.getLocalName());
switch (element) {
case EJB_NAME:
        final String ejbName=getElementText(reader,propertyReplacer);
      break;
case BINDING_NAME:
{
      metaData.setBindingName(getElementText(reader,propertyReplacer));
      break;
    }
case IOR_SECURITY_CONFIG:
{
    IORSecurityConfigMetaData iorSecurityMetaData=this.processIORSecurityConfig(reader,propertyReplacer);
    metaData.setIorSecurityConfigMetaData(iorSecurityMetaData);
    break;
  }
}
return;
}
}
super.processElement(metaData,reader,propertyReplacer);
}
Program: 152677
Project: 152677
Buggy source:
public static ContainerListenerMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  ContainerListenerMetaData containerListener=new ContainerListenerMetaData();
  while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case CLASS_NAME:
      containerListener.setListenerClass(getElementText(reader));
    break;
case MODULE:
  containerListener.setModule(getElementText(reader));
break;
case LISTENER_TYPE:
containerListener.setListenerType(ContainerListenerType.valueOf(getElementText(reader)));
break;
case PARAM:
List<ParamValueMetaData> params=containerListener.getParams();
if (params == null) {
params=new ArrayList<ParamValueMetaData>();
containerListener.setParams(params);
}
params.add(ParamValueMetaDataParser.parse(reader));
break;
default :
throw unexpectedElement(reader);
}
}
return containerListener;
}

Fixed version (ground truth):
public static ContainerListenerMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  ContainerListenerMetaData containerListener=new ContainerListenerMetaData();
  while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case CLASS_NAME:
      containerListener.setListenerClass(getElementText(reader));
    break;
case MODULE:
  containerListener.setModule(getElementText(reader));
break;
case LISTENER_TYPE:
try {
containerListener.setListenerType(ContainerListenerType.valueOf(getElementText(reader)));
}
 catch (IllegalArgumentException e) {
throw unexpectedValue(reader,e);
}
break;
case PARAM:
List<ParamValueMetaData> params=containerListener.getParams();
if (params == null) {
params=new ArrayList<ParamValueMetaData>();
containerListener.setParams(params);
}
params.add(ParamValueMetaDataParser.parse(reader));
break;
default :
throw unexpectedElement(reader);
}
}
return containerListener;
}