Commit aefc5165 by olly Committed by Oliver Woodman

Fix cache upgrade

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138687623
parent ee8a7f17
...@@ -84,7 +84,12 @@ public class SimpleCacheSpanTest extends InstrumentationTestCase { ...@@ -84,7 +84,12 @@ public class SimpleCacheSpanTest extends InstrumentationTestCase {
File v1File = createTestFile("asd\u00aa.5.6.v1.exo"); File v1File = createTestFile("asd\u00aa.5.6.v1.exo");
for (File file : cacheDir.listFiles()) { for (File file : cacheDir.listFiles()) {
SimpleCacheSpan.createCacheEntry(file, index); SimpleCacheSpan cacheEntry = SimpleCacheSpan.createCacheEntry(file, index);
if (file.equals(wrongEscapedV2file)) {
assertNull(cacheEntry);
} else {
assertNotNull(cacheEntry);
}
} }
assertTrue(v3file.exists()); assertTrue(v3file.exists());
......
...@@ -67,6 +67,7 @@ import java.util.regex.Pattern; ...@@ -67,6 +67,7 @@ import java.util.regex.Pattern;
if (file == null) { if (file == null) {
return null; return null;
} }
name = file.getName();
} }
Matcher matcher = CACHE_FILE_PATTERN_V3.matcher(name); Matcher matcher = CACHE_FILE_PATTERN_V3.matcher(name);
......
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