Skip to content

Instantly share code, notes, and snippets.

@manuelvicnt
Created March 20, 2019 08:17
Show Gist options
  • Save manuelvicnt/bf0e2c65083c48c29aba1207d2b59f61 to your computer and use it in GitHub Desktop.
Save manuelvicnt/bf0e2c65083c48c29aba1207d2b59f61 to your computer and use it in GitHub Desktop.
@MainThread
final void clear() {
mCleared = true;
// Since clear() is final, this method is still called on mock
// objects and in those cases, mBagOfTags is null. It'll always
// be empty though because setTagIfAbsent and getTag are not
// final so we can skip clearing it
if (mBagOfTags != null) {
for (Object value : mBagOfTags.values()) {
// see comment for the similar call in setTagIfAbsent
closeWithRuntimeException(value);
}
}
onCleared();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment