downloads.getReadWriteLock().readLock().unlock();
}
public void updateMD5(Download d) {
if (Model.generateMD5(d)) {
MD5State oldValue = md5ValuesMap.get(d);
MD5State md5 = d.getMD5();
boolean doUpdate = false;
if (oldValue == null || !oldValue.equals(md5)) {
doUpdate = true;
}
if (doUpdate) {
if (oldValue == null) {
oldValue = new MD5State();
}
oldValue.copy(md5);
dao.updateDownload(d, Download.PROP_MD5);
}
}