common.test: Fix Todo and warning in BBQ tests
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 8 Nov 2016 01:58:20 +0000 (20:58 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 14 Nov 2016 15:07:46 +0000 (10:07 -0500)
Now that we're in Java8, we can fix the todo to support
List<@NonNull...> and also properly annotate the output
of the stream.

Change-Id: I1584164748beed859a4b2883435c537aa97aa1ff
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/84633
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java

index 593bd0e4168b1c52bf0f49a98e6663930c260534..805126077e978402a0cb887def1a1bbaac749962 100644 (file)
@@ -408,7 +408,7 @@ public class BufferedBlockingQueueTest {
          * Convert the test's testBuffer into an array of String, one for each
          * character.
          */
-        List<String> strings = Chars.asList(testString.toCharArray()).stream()
+        List<@NonNull String> strings = Chars.asList(testString.toCharArray()).stream()
             .map(Object::toString)
             .collect(Collectors.toList());
 
@@ -444,7 +444,7 @@ public class BufferedBlockingQueueTest {
      * @return The consumed elements, as seen by each consumer thread.
      */
     private static <T> Iterable<Iterable<T>> runConcurrencyTest(final BufferedBlockingQueue<@NonNull T> queue,
-            final List<T> testBuffer,
+            final List<@NonNull T> testBuffer,
             final @NonNull T poisonPill,
             int nbProducerThreads,
             int nbConsumerThreads,
@@ -455,10 +455,6 @@ public class BufferedBlockingQueueTest {
             public void run() {
                 for (int i = 0; i < testBuffer.size(); i++) {
                     T elem = testBuffer.get(i);
-                    if (elem == null) {
-                        // TODO replace with List<@NonNull T> once we can
-                        throw new IllegalArgumentException();
-                    }
                     queue.put(elem);
                 }
                 queue.put(poisonPill);
This page took 0.026842 seconds and 5 git commands to generate.