Commit fa3d129b by eguven Committed by Oliver Woodman

Fix some of the issues pointed by android lint tool

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139915885
parent 61014503
......@@ -50,7 +50,7 @@ public class AtomicFileTest extends InstrumentationTestCase {
assertFalse(file.exists());
}
public void testWriteEndRead() throws Exception {
public void testWriteRead() throws Exception {
OutputStream output = atomicFile.startWrite();
output.write(5);
atomicFile.endWrite(output);
......
......@@ -138,6 +138,7 @@ public final class CacheDataSink implements DataSink {
outputStreamBytesWritten = 0;
}
@SuppressWarnings("ThrowFromFinallyBlock")
private void closeCurrentOutputStream() throws IOException {
if (outputStream == null) {
return;
......@@ -150,13 +151,14 @@ public final class CacheDataSink implements DataSink {
success = true;
} finally {
Util.closeQuietly(outputStream);
outputStream = null;
File fileToCommit = file;
file = null;
if (success) {
cache.commitFile(file);
cache.commitFile(fileToCommit);
} else {
file.delete();
fileToCommit.delete();
}
outputStream = null;
file = null;
}
}
......
......@@ -22,7 +22,7 @@ package com.google.android.exoplayer2.upstream.cache;
public interface CacheEvictor extends Cache.Listener {
/**
* Called when cache has beeen initialized.
* Called when cache has been initialized.
*/
void onCacheInitialized();
......
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