但是我在“名册”对象上同步它得到新的任何地方。怎么来的 ?
违规代码:
public Roster getRoster() {
if (roster == null) {
return null;
}
if (!roster.rosterInitialized) {
try {
synchronized (roster) {
roster.reload();
long waitTime = SmackConfiguration.getPacketReplyTimeout();
long start = System.currentTimeMillis();
while (!roster.rosterInitialized) {
if (waitTime <= 0) {
break;
}
roster.wait(waitTime);
long now = System.currentTimeMillis();
waitTime -= now - start;
start = now;
}
}
}
catch (InterruptedException ie) {
// Ignore.
}
}
return roster;
}