diff options
author | Andrew Su <[email protected]> | 2011-05-27 12:32:52 -0400 |
---|---|---|
committer | Andrew Su <[email protected]> | 2011-05-27 12:32:52 -0400 |
commit | 3b596abbf0bea7954b32a6104ddf65ab4000dbdd (patch) | |
tree | cdb4725752710f03b6cd4cf1631234bddb55407c /netx/net/sourceforge | |
parent | fbe59e59413f5b8fd2aa6f58b7f2c19d94b836b3 (diff) |
Fix PR727: Split conditional to removed duplicate entries in cache.
Diffstat (limited to 'netx/net/sourceforge')
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/CacheUtil.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/CacheUtil.java b/netx/net/sourceforge/jnlp/cache/CacheUtil.java index a307a11..b88c6e9 100644 --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java @@ -567,6 +567,11 @@ public class CacheUtil { rStr = cacheDir + rStr.substring(0, rStr.indexOf(File.separatorChar, 1)); long len = file.length(); + if (keep.contains(file.getPath().substring(rStr.length()))) { + lruHandler.removeEntry(key); + continue; + } + /* * we remove entries from our lru if any of the following condition is met. * Conditions: @@ -574,11 +579,8 @@ public class CacheUtil { * - !file.isFile(): if someone tampered with the directory, file doesn't exist. * - maxSize >= 0 && curSize + len > maxSize: If a limit was set and the new size * on disk would exceed the maximum size. - * - keep.contains(...): We had already decided to keep an entry with the same - * url path. */ - if (delete || !file.isFile() || (maxSize >= 0 && curSize + len > maxSize) || - keep.contains(file.getPath().substring(rStr.length()))) { + if (delete || !file.isFile() || (maxSize >= 0 && curSize + len > maxSize)) { lruHandler.removeEntry(key); remove.add(rStr); } else { |