mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 00:02:06 +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:
parent
25628bd0e9
commit
f6b61b5715
1 changed files with 6 additions and 5 deletions
|
@ -64,7 +64,7 @@ import java.util.LinkedList;
|
||||||
* use than a {@link PacketListener} when you need to wait for a specific
|
* use than a {@link PacketListener} when you need to wait for a specific
|
||||||
* result.
|
* result.
|
||||||
*
|
*
|
||||||
* @see PacketReader#createPacketCollector(PacketFilter)
|
* @see XMPPConnection#createPacketCollector(PacketFilter)
|
||||||
* @author Matt Tucker
|
* @author Matt Tucker
|
||||||
*/
|
*/
|
||||||
public class PacketCollector {
|
public class PacketCollector {
|
||||||
|
@ -85,7 +85,6 @@ public class PacketCollector {
|
||||||
this.packetReader = packetReader;
|
this.packetReader = packetReader;
|
||||||
this.packetFilter = packetFilter;
|
this.packetFilter = packetFilter;
|
||||||
this.resultQueue = new LinkedList();
|
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) {
|
synchronized (packetReader.collectors) {
|
||||||
packetReader.collectors.add(this);
|
packetReader.collectors.add(this);
|
||||||
|
@ -107,10 +106,12 @@ public class PacketCollector {
|
||||||
// Remove object from collectors list by setting the value in the
|
// Remove object from collectors list by setting the value in the
|
||||||
// list at the correct index to null. The collector thread will
|
// list at the correct index to null. The collector thread will
|
||||||
// automatically remove the actual list entry when it can.
|
// automatically remove the actual list entry when it can.
|
||||||
|
synchronized (packetReader.collectors) {
|
||||||
int index = packetReader.collectors.indexOf(this);
|
int index = packetReader.collectors.indexOf(this);
|
||||||
packetReader.collectors.set(index, null);
|
packetReader.collectors.set(index, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the packet filter associated with this packet collector. The packet
|
* Returns the packet filter associated with this packet collector. The packet
|
||||||
|
|
Loading…
Reference in a new issue