tmf.ctf: fix findbugs in ctfIteratorManager
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 29 Jan 2015 14:47:46 +0000 (09:47 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 29 Jan 2015 18:28:28 +0000 (13:28 -0500)
Change-Id: I7720a756cc7b1051554a8d5bc0b5771b220ba930
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/40630
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/trace/iterator/CtfIteratorManager.java

index 0e7ccaa1cfadf008322a9a0c1ec0d6d24351ff9b..89f781ce2305cab790e92aa345bc4e16127844bb 100644 (file)
@@ -14,6 +14,8 @@ package org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -36,13 +38,13 @@ public class CtfIteratorManager {
      * Cache size. Under 1023 on linux32 systems. Number of file handles
      * created.
      */
-    private final static int MAX_SIZE = 100;
+    private static final int MAX_SIZE = 100;
 
     /** The map of the cache */
-    private final HashMap<CtfTmfContext, CtfIterator> fMap;
+    private final Map<CtfTmfContext, CtfIterator> fMap;
 
     /** An array pointing to the same cache. this allows fast "random" accesses */
-    private final ArrayList<CtfTmfContext> fRandomAccess;
+    private final List<CtfTmfContext> fRandomAccess;
 
     /** Lock for when we access the two previous data structures */
     private final Lock fAccessLock = new ReentrantLock();
@@ -128,6 +130,7 @@ public class CtfIteratorManager {
         try {
             /* The try below is only to auto-call CtfIterator.close() */
             try (CtfIterator removed = fMap.remove(context)) {
+                // try with resource
             }
             fRandomAccess.remove(context);
 
This page took 0.028258 seconds and 5 git commands to generate.