Program: 20518
Project: 20518
Buggy source:
/** 
 * Parse top-level packets in order to process them further.
 */
private void parsePackets(){
  try {
    int eventType=parser.getEventType();
    do {
      if (eventType == XmlPullParser.START_TAG) {
        if (parser.getName().equals("String_Node_Str")) {
          processPacket(parseMessage(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          processPacket(parseIQ(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          processPacket(parsePresence(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          if ("String_Node_Str".equals(parser.getNamespace(null))) {
            for (int i=0; i < parser.getAttributeCount(); i++) {
              if (parser.getAttributeName(i).equals("String_Node_Str")) {
                connectionID=parser.getAttributeValue(i);
synchronized (connectionIDLock) {
                  connectionIDLock.notifyAll();
                }
              }
            }
          }
        }
      }
 else       if (eventType == XmlPullParser.END_TAG) {
        if (parser.getName().equals("String_Node_Str")) {
          connection.close();
        }
      }
      eventType=parser.next();
    }
 while (!done && eventType != XmlPullParser.END_DOCUMENT);
  }
 catch (  Exception e) {
    if (!done) {
      connection.close();
synchronized (connectionListeners) {
        for (Iterator i=connectionListeners.iterator(); i.hasNext(); ) {
          ConnectionListener listener=(ConnectionListener)i.next();
          listener.connectionClosedOnError(e);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse top-level packets in order to process them further.
 */
private void parsePackets(){
  try {
    int eventType=parser.getEventType();
    do {
      if (eventType == XmlPullParser.START_TAG) {
        if (parser.getName().equals("String_Node_Str")) {
          processPacket(parseMessage(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          processPacket(parseIQ(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          processPacket(parsePresence(parser));
        }
 else         if (parser.getName().equals("String_Node_Str")) {
          if ("String_Node_Str".equals(parser.getNamespace(null))) {
            for (int i=0; i < parser.getAttributeCount(); i++) {
              if (parser.getAttributeName(i).equals("String_Node_Str")) {
                connectionID=parser.getAttributeValue(i);
synchronized (connectionIDLock) {
                  connectionIDLock.notifyAll();
                }
              }
            }
          }
        }
      }
 else       if (eventType == XmlPullParser.END_TAG) {
        if (parser.getName().equals("String_Node_Str")) {
          connection.close();
        }
      }
      eventType=parser.next();
    }
 while (!done && eventType != XmlPullParser.END_DOCUMENT);
  }
 catch (  Exception e) {
    if (!done) {
      done=true;
      connection.close();
synchronized (connectionListeners) {
        for (Iterator i=connectionListeners.iterator(); i.hasNext(); ) {
          ConnectionListener listener=(ConnectionListener)i.next();
          listener.connectionClosedOnError(e);
        }
      }
    }
  }
}