From f7e2cdbbbb24075ca1f117cb63e7a9a7efe34972 Mon Sep 17 00:00:00 2001 From: eguven Date: Tue, 3 Apr 2018 03:32:24 -0700 Subject: [PATCH] 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 --- .../android/exoplayer2/upstream/cache/SimpleCache.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java index 98c1fc97f7..d1b26f884c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java @@ -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); }