From 8ed06a4f06d28107534db1cc058fdebca1527057 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Mon, 4 Aug 2003 21:58:31 +0000 Subject: [PATCH] Cleanup of IQ parsing. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2008 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/PacketReader.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index c197380b2..61ee8c6ef 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -347,7 +347,6 @@ class PacketReader { String from = parser.getAttributeValue("", "from"); IQ.Type type = IQ.Type.fromString(parser.getAttributeValue("", "type")); XMPPError error = null; - Map properties = null; boolean done = false; while (!done) { @@ -391,21 +390,19 @@ class PacketReader { } // Set basic values on the iq packet. if (iqPacket == null) { - iqPacket = new IQ(); + // If an IQ packet wasn't created above, create an empty IQ packet. + iqPacket = new IQ() { + public String getChildElementXML() { + return null; + } + }; } iqPacket.setPacketID(id); iqPacket.setTo(to); iqPacket.setFrom(from); iqPacket.setType(type); iqPacket.setError(error); - // Set packet properties. - if (properties != null) { - for (Iterator i=properties.keySet().iterator(); i.hasNext(); ) { - String name = (String)i.next(); - iqPacket.setProperty(name, properties.get(name)); - } - } - // Return the packet. + return iqPacket; }