Fixed existing unit tests for DatabaseComponentImpl, and two bugs.

This commit is contained in:
akwizgran
2013-01-30 14:39:13 +00:00
parent fe153b0815
commit e379f11698
6 changed files with 178 additions and 126 deletions

View File

@@ -514,7 +514,7 @@ DatabaseCleaner.Callback {
subscriptionLock.readLock().unlock();
}
} finally {
messageLock.readLock().lock();
messageLock.readLock().unlock();
}
if(messages.isEmpty()) return null;
// Record the message as sent
@@ -1589,7 +1589,8 @@ DatabaseCleaner.Callback {
} finally {
contactLock.writeLock().unlock();
}
callListeners(new LocalSubscriptionsUpdatedEvent(affected));
if(!affected.isEmpty())
callListeners(new LocalSubscriptionsUpdatedEvent(affected));
}
public void subscribe(Group g) throws DbException {

View File

@@ -347,8 +347,8 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener {
this.transportId = transportId;
}
private EndpointKey(Endpoint ct) {
this(ct.getContactId(), ct.getTransportId());
private EndpointKey(Endpoint ep) {
this(ep.getContactId(), ep.getTransportId());
}
@Override