Program: 103054
Project: 103054
Buggy source:
/** 
 * Parses an IQ sub-document and creates an <tt>org.jivesoftware.smack.packet.IQ</tt> instance.
 * @param parser an <tt>XmlPullParser</tt> which specifies the IQsub-document to be parsed into a new <tt>IQ</tt> instance
 * @return a new <tt>IQ</tt> instance parsed from the specified IQsub-document
 * @see IQProvider#parseIQ(XmlPullParser)
 */
@SuppressWarnings("String_Node_Str") public IQ parseIQ(XmlPullParser parser) throws Exception {
  String namespace=parser.getNamespace();
  IQ iq;
  if (ColibriConferenceIQ.ELEMENT_NAME.equals(parser.getName()) && ColibriConferenceIQ.NAMESPACE.equals(namespace)) {
    ColibriConferenceIQ conference=new ColibriConferenceIQ();
    String conferenceID=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.ID_ATTR_NAME);
    if ((conferenceID != null) && (conferenceID.length() != 0))     conference.setID(conferenceID);
    boolean done=false;
    ColibriConferenceIQ.Channel channel=null;
    ColibriConferenceIQ.Content content=null;
    StringBuilder ssrc=null;
    while (!done) {
switch (parser.next()) {
case XmlPullParser.END_TAG:
{
          String name=parser.getName();
          if (ColibriConferenceIQ.ELEMENT_NAME.equals(name)) {
            done=true;
          }
 else           if (ColibriConferenceIQ.Channel.ELEMENT_NAME.equals(name)) {
            content.addChannel(channel);
            channel=null;
          }
 else           if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME.equals(name)) {
            channel.addSSRC(Long.parseLong(ssrc.toString().trim()));
            ssrc=null;
          }
 else           if (ColibriConferenceIQ.Content.ELEMENT_NAME.equals(name)) {
            conference.addContent(content);
            content=null;
          }
          break;
        }
case XmlPullParser.START_TAG:
{
        String name=parser.getName();
        if (ColibriConferenceIQ.Channel.ELEMENT_NAME.equals(name)) {
          channel=new ColibriConferenceIQ.Channel();
          String direction=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.DIRECTION_ATTR_NAME);
          if ((direction != null) && (direction.length() != 0)) {
            channel.setDirection(MediaDirection.parseString(direction));
          }
          String expire=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.EXPIRE_ATTR_NAME);
          if ((expire != null) && (expire.length() != 0))           channel.setExpire(Integer.parseInt(expire));
          String host=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.HOST_ATTR_NAME);
          if ((host != null) && (host.length() != 0))           channel.setHost(host);
          String channelID=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.ID_ATTR_NAME);
          if ((channelID != null) && (channelID.length() != 0))           channel.setID(channelID);
          String initiator=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.INITIATOR_ATTR_NAME);
          if ((initiator != null) && (initiator.length() != 0))           channel.setInitiator(Boolean.valueOf(initiator));
          String rtcpPort=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTCP_PORT_ATTR_NAME);
          if ((rtcpPort != null) && (rtcpPort.length() != 0))           channel.setRTCPPort(Integer.parseInt(rtcpPort));
          String rtpLevelRelayType=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTP_LEVEL_RELAY_TYPE_ATTR_NAME);
          if ((rtpLevelRelayType != null) && (rtpLevelRelayType.length() != 0)) {
            channel.setRTPLevelRelayType(rtpLevelRelayType);
          }
          String rtpPort=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTP_PORT_ATTR_NAME);
          if ((rtpPort != null) && (rtpPort.length() != 0))           channel.setRTPPort(Integer.parseInt(rtpPort));
        }
 else         if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME.equals(name)) {
          ssrc=new StringBuilder();
        }
 else         if (ColibriConferenceIQ.Content.ELEMENT_NAME.equals(name)) {
          content=new ColibriConferenceIQ.Content();
          String contentName=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Content.NAME_ATTR_NAME);
          if ((contentName != null) && (contentName.length() != 0))           content.setName(contentName);
        }
 else         if (channel != null) {
          String peName=null;
          String peNamespace=null;
          if (IceUdpTransportPacketExtension.ELEMENT_NAME.equals(name) && IceUdpTransportPacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=IceUdpTransportPacketExtension.NAMESPACE;
          }
 else           if (PayloadTypePacketExtension.ELEMENT_NAME.equals(name)) {
            peName=name;
            peNamespace=namespace;
          }
 else           if (RawUdpTransportPacketExtension.ELEMENT_NAME.equals(name) && RawUdpTransportPacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=RawUdpTransportPacketExtension.NAMESPACE;
          }
 else           if (SourcePacketExtension.ELEMENT_NAME.equals(name) && SourcePacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=SourcePacketExtension.NAMESPACE;
          }
          if (peName == null) {
            throwAway(parser,name);
          }
 else {
            PacketExtension extension=parseExtension(parser,peName,peNamespace);
            if (extension != null)             addChildExtension(channel,extension);
          }
        }
        break;
      }
case XmlPullParser.TEXT:
{
      if (ssrc != null)       ssrc.append(parser.getText());
      break;
    }
}
}
iq=conference;
}
 else iq=null;
return iq;
}

Fixed version (ground truth):
/** 
 * Parses an IQ sub-document and creates an <tt>org.jivesoftware.smack.packet.IQ</tt> instance.
 * @param parser an <tt>XmlPullParser</tt> which specifies the IQsub-document to be parsed into a new <tt>IQ</tt> instance
 * @return a new <tt>IQ</tt> instance parsed from the specified IQsub-document
 * @see IQProvider#parseIQ(XmlPullParser)
 */
@SuppressWarnings("String_Node_Str") public IQ parseIQ(XmlPullParser parser) throws Exception {
  String namespace=parser.getNamespace();
  IQ iq;
  if (ColibriConferenceIQ.ELEMENT_NAME.equals(parser.getName()) && ColibriConferenceIQ.NAMESPACE.equals(namespace)) {
    ColibriConferenceIQ conference=new ColibriConferenceIQ();
    String conferenceID=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.ID_ATTR_NAME);
    if ((conferenceID != null) && (conferenceID.length() != 0))     conference.setID(conferenceID);
    boolean done=false;
    ColibriConferenceIQ.Channel channel=null;
    ColibriConferenceIQ.Content content=null;
    StringBuilder ssrc=null;
    while (!done) {
switch (parser.next()) {
case XmlPullParser.END_TAG:
{
          String name=parser.getName();
          if (ColibriConferenceIQ.ELEMENT_NAME.equals(name)) {
            done=true;
          }
 else           if (ColibriConferenceIQ.Channel.ELEMENT_NAME.equals(name)) {
            content.addChannel(channel);
            channel=null;
          }
 else           if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME.equals(name)) {
            String s=ssrc.toString().trim();
            if (s.length() != 0) {
              int i;
              if (s.startsWith("String_Node_Str"))               i=Integer.parseInt(s);
 else               i=(int)Long.parseLong(s);
              channel.addSSRC(i);
            }
            ssrc=null;
          }
 else           if (ColibriConferenceIQ.Content.ELEMENT_NAME.equals(name)) {
            conference.addContent(content);
            content=null;
          }
          break;
        }
case XmlPullParser.START_TAG:
{
        String name=parser.getName();
        if (ColibriConferenceIQ.Channel.ELEMENT_NAME.equals(name)) {
          channel=new ColibriConferenceIQ.Channel();
          String direction=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.DIRECTION_ATTR_NAME);
          if ((direction != null) && (direction.length() != 0)) {
            channel.setDirection(MediaDirection.parseString(direction));
          }
          String expire=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.EXPIRE_ATTR_NAME);
          if ((expire != null) && (expire.length() != 0))           channel.setExpire(Integer.parseInt(expire));
          String host=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.HOST_ATTR_NAME);
          if ((host != null) && (host.length() != 0))           channel.setHost(host);
          String channelID=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.ID_ATTR_NAME);
          if ((channelID != null) && (channelID.length() != 0))           channel.setID(channelID);
          String initiator=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.INITIATOR_ATTR_NAME);
          if ((initiator != null) && (initiator.length() != 0))           channel.setInitiator(Boolean.valueOf(initiator));
          String rtcpPort=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTCP_PORT_ATTR_NAME);
          if ((rtcpPort != null) && (rtcpPort.length() != 0))           channel.setRTCPPort(Integer.parseInt(rtcpPort));
          String rtpLevelRelayType=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTP_LEVEL_RELAY_TYPE_ATTR_NAME);
          if ((rtpLevelRelayType != null) && (rtpLevelRelayType.length() != 0)) {
            channel.setRTPLevelRelayType(rtpLevelRelayType);
          }
          String rtpPort=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Channel.RTP_PORT_ATTR_NAME);
          if ((rtpPort != null) && (rtpPort.length() != 0))           channel.setRTPPort(Integer.parseInt(rtpPort));
        }
 else         if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME.equals(name)) {
          ssrc=new StringBuilder();
        }
 else         if (ColibriConferenceIQ.Content.ELEMENT_NAME.equals(name)) {
          content=new ColibriConferenceIQ.Content();
          String contentName=parser.getAttributeValue("String_Node_Str",ColibriConferenceIQ.Content.NAME_ATTR_NAME);
          if ((contentName != null) && (contentName.length() != 0))           content.setName(contentName);
        }
 else         if (channel != null) {
          String peName=null;
          String peNamespace=null;
          if (IceUdpTransportPacketExtension.ELEMENT_NAME.equals(name) && IceUdpTransportPacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=IceUdpTransportPacketExtension.NAMESPACE;
          }
 else           if (PayloadTypePacketExtension.ELEMENT_NAME.equals(name)) {
            peName=name;
            peNamespace=namespace;
          }
 else           if (RawUdpTransportPacketExtension.ELEMENT_NAME.equals(name) && RawUdpTransportPacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=RawUdpTransportPacketExtension.NAMESPACE;
          }
 else           if (SourcePacketExtension.ELEMENT_NAME.equals(name) && SourcePacketExtension.NAMESPACE.equals(parser.getNamespace())) {
            peName=name;
            peNamespace=SourcePacketExtension.NAMESPACE;
          }
          if (peName == null) {
            throwAway(parser,name);
          }
 else {
            PacketExtension extension=parseExtension(parser,peName,peNamespace);
            if (extension != null)             addChildExtension(channel,extension);
          }
        }
        break;
      }
case XmlPullParser.TEXT:
{
      if (ssrc != null)       ssrc.append(parser.getText());
      break;
    }
}
}
iq=conference;
}
 else iq=null;
return iq;
}