tmf: Switch tmf.core.tests to Java 7 + fix warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / trace / indexer / AbstractCheckpointCollectionTest.java
index 8601c76ad79586033359339667d188efcecf5b93..3fcb715be4fda107638d587292dd3f3d735c34c9 100644 (file)
@@ -216,9 +216,9 @@ public abstract class AbstractCheckpointCollectionTest {
     public void testVersionChange() throws IOException {
         fCheckpointCollection.setIndexComplete();
         fCheckpointCollection.dispose();
-        RandomAccessFile f = new RandomAccessFile(fFile, "rw");
-        f.writeInt(-1);
-        f.close();
+        try (RandomAccessFile f = new RandomAccessFile(fFile, "rw");) {
+            f.writeInt(-1);
+        }
 
         fCheckpointCollection = createCollection();
         assertTrue(fCheckpointCollection.isCreatedFromScratch());
@@ -253,7 +253,7 @@ public abstract class AbstractCheckpointCollectionTest {
         }
 
         boolean random = true;
-        ArrayList<Integer> list = new ArrayList<Integer>();
+        ArrayList<Integer> list = new ArrayList<>();
         for (int i = 0; i < CHECKPOINTS_INSERT_NUM; i++) {
             if (random) {
                 Random rand = new Random();
@@ -302,7 +302,7 @@ public abstract class AbstractCheckpointCollectionTest {
         }
 
         boolean random = true;
-        ArrayList<Integer> list = new ArrayList<Integer>();
+        ArrayList<Integer> list = new ArrayList<>();
         for (int i = 0; i < CHECKPOINTS_INSERT_NUM; i++) {
             if (random) {
                 Random rand = new Random();
This page took 0.028303 seconds and 5 git commands to generate.