lami: possible ressource leak on IntStream
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 21 Sep 2016 21:07:34 +0000 (17:07 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 22 Sep 2016 14:26:42 +0000 (10:26 -0400)
Even if this is a fluke from Coverity using a for loop is simpler.

CID 141163 & 141165

Change-Id: I6087b22cd9ad9beb47f5546d54fd5167bdd66390
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-on: https://git.eclipse.org/r/81638
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.lami.ui/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/ui/views/LamiSeriesDialog.java

index 8aebff80c4bdd85ad0766907a99217bef3f665ad..ddb36a022ddbabe2442ae9ed641a67dd71e2add6 100644 (file)
@@ -16,7 +16,6 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.function.Function;
 import java.util.function.Predicate;
-import java.util.stream.IntStream;
 
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jface.dialogs.Dialog;
@@ -457,8 +456,8 @@ public class LamiSeriesDialog extends SelectionDialog {
      */
     public boolean[] getXCheckBoxOptionValues() {
         boolean[] selections = new boolean[fXCheckBoxOptions.size()];
-        if (selections.length != 0) {
-            IntStream.range(0, selections.length).forEach(i -> selections[i] = fXCheckBoxOptions.get(i).getValue());
+        for (int i = 0; i < selections.length; i++) {
+            selections[i] = fXCheckBoxOptions.get(i).getValue();
         }
         return selections;
     }
@@ -468,8 +467,8 @@ public class LamiSeriesDialog extends SelectionDialog {
      */
     public boolean[] getYCheckBoxOptionValues() {
         boolean[] selections = new boolean[fYCheckBoxOptions.size()];
-        if (selections.length != 0) {
-            IntStream.range(0, selections.length).forEach(i -> selections[i] = fYCheckBoxOptions.get(i).getValue());
+        for (int i = 0; i < selections.length; i++) {
+            selections[i] = fYCheckBoxOptions.get(i).getValue();
         }
         return selections;
     }
This page took 0.026115 seconds and 5 git commands to generate.