Commit f7e2cdbb by eguven Committed by Oliver Woodman

Add missing synchronized keywords and assertions

applyContentMetadataMutations and getContentMetadata methods suppossed to be synchronized and assert the instance isn't released.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191419637
parent 82c71378
......@@ -306,14 +306,16 @@ public final class SimpleCache implements Cache {
}
@Override
public void applyContentMetadataMutations(String key, ContentMetadataMutations mutations)
throws CacheException {
public synchronized void applyContentMetadataMutations(
String key, ContentMetadataMutations mutations) throws CacheException {
Assertions.checkState(!released);
index.applyContentMetadataMutations(key, mutations);
index.store();
}
@Override
public ContentMetadata getContentMetadata(String key) {
public synchronized ContentMetadata getContentMetadata(String key) {
Assertions.checkState(!released);
return index.getContentMetadata(key);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment