Anonymous avatar Anonymous committed 69cc7b7

Issue number: CACHE-226 Drop Java 1.3 support
Obtained from: Lars Torunski

Comments (0)

Files changed (1)

src/java/com/opensymphony/oscache/base/algorithm/FIFOCache.java

  * @author        <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
  */
 public class FIFOCache extends AbstractConcurrentReadCache {
-    /**
+
+	/**
      * A queue containing all cache keys
      */
     private Collection list;
 
     /**
-     * A flag indicating whether we are using a List or a Set for the key collection
-     */
-    private boolean isSet = false;
-
-    /**
      * Constructs a FIFO Cache.
      */
     public FIFOCache() {
         super();
-
-        // Check if we're running under JRE 1.4+. If so we can use a LinkedHashSet
-        // instead of a LinkedList for a big performance boost when removing elements.
-        try {
-            Class.forName("java.util.LinkedHashSet");
-            list = new LinkedHashSet();
-            isSet = true;
-        } catch (ClassNotFoundException e) {
-            list = new LinkedList();
-        }
+        list = new LinkedHashSet();
     }
 
     /**
      * @return The key of whichever item was removed.
      */
     protected Object removeItem() {
-        Object toRemove;
-
-        if (isSet) {
-            Iterator it = list.iterator();
-            toRemove = it.next();
-            it.remove();
-        } else {
-            toRemove = ((List) list).remove(0);
-        }
+        Iterator it = list.iterator();
+        Object toRemove = it.next();
+        it.remove();
 
         return toRemove;
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.