cgeo/c-geo-opensource — pull request #1362 by teschi (2012-04-02 23:55:41+00:00)
Title: Issue#1304

My attempt to fix issue #1304:

I replaced the LeastRecentlyUsedCache by a LeastRecentlyUsedMap and a LeastRecentlyUsedSet.
Both support different modes of operation, where LRU keeps track of get() operations, BOUNDED only keeps track of put() operations.

Note: LestRecentlyUsedSet is very heavily based on JAVA's implementation of HashSet, not sure if that means anything in regard to Licensing.

Also Note: that I set the default mode for the LeastRecentlyUsedMap to LRU_CACHE, because I assumed that it was meant like this in the first place. In the previous implementation the "accessOrder" parameter of the LinkedHashMap constructor was false, which is imho the wrong one for a Map used for caching.

P.S.: This is my first pull request ever, if I've done anything wrong, please let me know