Program: 152641
Project: 152641
Buggy source:
/** 
 * This method takes care of handling the "publish" use-case including all (relevant) error conditions.
 * @return the appropriate response stanza (either success or some error condition).
 */
@Override @SpecCompliance(compliant={@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED)}) protected Stanza handleSet(IQStanza stanza,ServerRuntimeContext serverRuntimeContext,SessionContext sessionContext){
  Entity serverJID=serviceConfiguration.getServerJID();
  CollectionNode root=serviceConfiguration.getRootNode();
  Entity sender=extractSenderJID(stanza,sessionContext);
  StanzaBuilder sb=StanzaBuilder.createDirectReply(stanza,false,IQStanzaType.RESULT);
  sb.startInnerElement("String_Node_Str",NamespaceURIs.XEP0060_PUBSUB);
  XMLElement publish=stanza.getFirstInnerElement().getFirstInnerElement();
  String nodeName=publish.getAttributeValue("String_Node_Str");
  XMLElement item=publish.getFirstInnerElement();
  String strID=item.getAttributeValue("String_Node_Str");
  LeafNode node=root.find(nodeName);
  if (node == null) {
    return errorStanzaGenerator.generateNoNodeErrorStanza(sender,serverJID,stanza);
  }
  if (!node.isAuthorized(sender,PubSubPrivilege.PUBLISH)) {
    return errorStanzaGenerator.generateInsufficientPrivilegesErrorStanza(sender,serverJID,stanza);
  }
  if (strID == null) {
    strID=idGenerator.create();
    StanzaBuilder itemBuilder=new StanzaBuilder("String_Node_Str");
    itemBuilder.addAttribute("String_Node_Str",strID);
    itemBuilder.addPreparedElement(item.getFirstInnerElement());
    item=itemBuilder.build();
  }
  StanzaRelay relay=serverRuntimeContext.getStanzaRelay();
  node.publish(sender,relay,strID,item);
  buildSuccessStanza(sb,nodeName,strID);
  sb.endInnerElement();
  return new IQStanza(sb.build());
}

Fixed version (ground truth):
/** 
 * This method takes care of handling the "publish" use-case including all (relevant) error conditions.
 * @return the appropriate response stanza (either success or some error condition).
 */
@Override @SpecCompliance(compliant={@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.FINISHED,coverage=SpecCompliant.ComplianceCoverage.COMPLETE),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED),@SpecCompliant(spec="String_Node_Str",section="String_Node_Str",status=SpecCompliant.ComplianceStatus.NOT_STARTED,coverage=SpecCompliant.ComplianceCoverage.UNSUPPORTED)}) protected Stanza handleSet(IQStanza stanza,ServerRuntimeContext serverRuntimeContext,SessionContext sessionContext){
  Entity serverJID=serviceConfiguration.getServerJID();
  CollectionNode root=serviceConfiguration.getRootNode();
  Entity sender=extractSenderJID(stanza,sessionContext);
  StanzaBuilder sb=StanzaBuilder.createDirectReply(stanza,false,IQStanzaType.RESULT);
  sb.startInnerElement("String_Node_Str",NamespaceURIs.XEP0060_PUBSUB);
  XMLElement publish=stanza.getFirstInnerElement().getFirstInnerElement();
  String nodeName=publish.getAttributeValue("String_Node_Str");
  XMLElement item=publish.getFirstInnerElement();
  String strID=item.getAttributeValue("String_Node_Str");
  LeafNode node=root.find(nodeName);
  if (node == null) {
    return errorStanzaGenerator.generateNoNodeErrorStanza(sender,serverJID,stanza);
  }
  if (!node.isAuthorized(sender,PubSubPrivilege.PUBLISH)) {
    return errorStanzaGenerator.generateInsufficientPrivilegesErrorStanza(sender,serverJID,stanza);
  }
  StanzaRelay relay=serverRuntimeContext.getStanzaRelay();
  XMLElementBuilder eventItemBuilder=new XMLElementBuilder("String_Node_Str",NamespaceURIs.XEP0060_PUBSUB_EVENT);
  if (strID == null) {
    strID=idGenerator.create();
  }
  eventItemBuilder.addAttribute("String_Node_Str",strID);
  for (  XMLFragment fragment : item.getInnerFragments()) {
    if (fragment instanceof XMLElement) {
      eventItemBuilder.addPreparedElement((XMLElement)fragment);
    }
 else {
      eventItemBuilder.addText(((XMLText)fragment).getText());
    }
  }
  node.publish(sender,relay,strID,eventItemBuilder.build());
  buildSuccessStanza(sb,nodeName,strID);
  sb.endInnerElement();
  return new IQStanza(sb.build());
}