ctf: Fix simple resource leak warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / MetadataTest.java
index 105adb7850186c7daa6c8d437acff1149ee12b5a..cf140481c1afd44aa9d499b6a8fa4f528bf459b3 100644 (file)
@@ -204,10 +204,11 @@ public class MetadataTest {
 
     @Test
     public void testStreamTextMD() throws CTFReaderException {
-        CTFTrace trace = testSingleFragment();
-        fixture.parseTextFragment(mdSecond);
-        assertEquals(2, trace.getEvents(0L).size());
-        assertEquals("bozo_the_clown", trace.getEvents(0L).get(1L).getName());
+        try (CTFTrace trace = testSingleFragment();) {
+            fixture.parseTextFragment(mdSecond);
+            assertEquals(2, trace.getEvents(0L).size());
+            assertEquals("bozo_the_clown", trace.getEvents(0L).get(1L).getName());
+        }
     }
 
     /**
This page took 0.024655 seconds and 5 git commands to generate.