1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Small fixes.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1803 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-01-17 17:50:56 +00:00 committed by mtucker
parent 25628bd0e9
commit f6b61b5715

View file

@ -64,7 +64,7 @@ import java.util.LinkedList;
* use than a {@link PacketListener} when you need to wait for a specific
* result.
*
* @see PacketReader#createPacketCollector(PacketFilter)
* @see XMPPConnection#createPacketCollector(PacketFilter)
* @author Matt Tucker
*/
public class PacketCollector {
@ -85,8 +85,7 @@ public class PacketCollector {
this.packetReader = packetReader;
this.packetFilter = packetFilter;
this.resultQueue = new LinkedList();
// Add the collector to the packet reader's list of active collector.
// Add the collector to the packet reader's list of active collector.
synchronized (packetReader.collectors) {
packetReader.collectors.add(this);
}
@ -107,8 +106,10 @@ public class PacketCollector {
// Remove object from collectors list by setting the value in the
// list at the correct index to null. The collector thread will
// automatically remove the actual list entry when it can.
int index = packetReader.collectors.indexOf(this);
packetReader.collectors.set(index, null);
synchronized (packetReader.collectors) {
int index = packetReader.collectors.indexOf(this);
packetReader.collectors.set(index, null);
}
}
}