mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +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,8 +85,7 @@ 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,8 +106,10 @@ 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.
|
||||||
int index = packetReader.collectors.indexOf(this);
|
synchronized (packetReader.collectors) {
|
||||||
packetReader.collectors.set(index, null);
|
int index = packetReader.collectors.indexOf(this);
|
||||||
|
packetReader.collectors.set(index, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue