mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42:06 +01:00
Fixed potential endless loop.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4527 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
0e1c037504
commit
f520dfe02e
1 changed files with 3 additions and 2 deletions
|
@ -88,7 +88,8 @@ public class RosterTest extends SmackTestCase {
|
|||
roster.createEntry(getBareJID(2), "gato12", new String[] { "Family" });
|
||||
|
||||
// Wait until the server confirms the new entries
|
||||
while (roster.getEntryCount() != 2) {
|
||||
long initial = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() - initial < 2000 && roster.getEntryCount() != 2) {
|
||||
Thread.sleep(50);
|
||||
}
|
||||
|
||||
|
@ -98,7 +99,7 @@ public class RosterTest extends SmackTestCase {
|
|||
}
|
||||
}
|
||||
// Wait up to 2 seconds
|
||||
long initial = System.currentTimeMillis();
|
||||
initial = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() - initial < 2000 &&
|
||||
(roster.getGroupCount() != 0 &&
|
||||
getConnection(2).getRoster().getEntryCount() != 2)) {
|
||||
|
|
Loading…
Reference in a new issue