Commit 8a74acbe by danarapagna Committed by Oliver Woodman

Automated g4 rollback of changelist 191128111.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191834511
parent 26cb32ab
...@@ -93,6 +93,10 @@ public final class SimpleCache implements Cache { ...@@ -93,6 +93,10 @@ public final class SimpleCache implements Cache {
* @param index The CachedContentIndex to be used. * @param index The CachedContentIndex to be used.
*/ */
/*package*/ SimpleCache(File cacheDir, CacheEvictor evictor, CachedContentIndex index) { /*package*/ SimpleCache(File cacheDir, CacheEvictor evictor, CachedContentIndex index) {
if (!lockFolder(cacheDir)) {
throw new IllegalStateException("Another SimpleCache instance uses the folder: " + cacheDir);
}
this.cacheDir = cacheDir; this.cacheDir = cacheDir;
this.evictor = evictor; this.evictor = evictor;
this.index = index; this.index = index;
......
...@@ -296,17 +296,17 @@ public class SimpleCacheTest { ...@@ -296,17 +296,17 @@ public class SimpleCacheTest {
} }
} }
// @Test @Test
// public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception { public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception {
// new SimpleCache(cacheDir, new NoOpCacheEvictor()); new SimpleCache(cacheDir, new NoOpCacheEvictor());
//
// try { try {
// new SimpleCache(cacheDir, new NoOpCacheEvictor()); new SimpleCache(cacheDir, new NoOpCacheEvictor());
// assertWithMessage("Exception was expected").fail(); assertWithMessage("Exception was expected").fail();
// } catch (IllegalStateException e) { } catch (IllegalStateException e) {
// // Expected. Do nothing. // Expected. Do nothing.
// } }
// } }
@Test @Test
public void testMultipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease() public void testMultipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease()
......
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