1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-06-30 15:26:46 +02: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:
Gaston Dombiak 2006-07-17 19:38:37 +00:00 committed by gato
parent 0e1c037504
commit f520dfe02e

View file

@ -88,7 +88,8 @@ public class RosterTest extends SmackTestCase {
roster.createEntry(getBareJID(2), "gato12", new String[] { "Family" }); roster.createEntry(getBareJID(2), "gato12", new String[] { "Family" });
// Wait until the server confirms the new entries // 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); Thread.sleep(50);
} }
@ -98,7 +99,7 @@ public class RosterTest extends SmackTestCase {
} }
} }
// Wait up to 2 seconds // Wait up to 2 seconds
long initial = System.currentTimeMillis(); initial = System.currentTimeMillis();
while (System.currentTimeMillis() - initial < 2000 && while (System.currentTimeMillis() - initial < 2000 &&
(roster.getGroupCount() != 0 && (roster.getGroupCount() != 0 &&
getConnection(2).getRoster().getEntryCount() != 2)) { getConnection(2).getRoster().getEntryCount() != 2)) {