lttng: Fix null annotation error on Eclipse 4.5.x
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 25 Feb 2016 18:19:03 +0000 (13:19 -0500)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 25 Feb 2016 22:59:53 +0000 (17:59 -0500)
getAnalysisModuleOfClass returns a Nullable module, this nullable should
be kept all the way to the Optional returned by findFirst. In 4.5.x,
this works correctly and the result of findFirst cannot be assigned to
an Optional<@NonNull>, hence the error. In 4.6, the @Nullable is lost
along the way and the result of findFirst can be assigned without error
to an Optional<@NonNull>.

Change-Id: If544f9372e2132f5796074f197a7ae01679fe1da
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/67355
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngWorker.java

index a5c252c42b9139bca94006bc5bd8cbf597396dd9..08e0eeaa47bbc2309feb16f44b37993548b6a74d 100644 (file)
@@ -77,7 +77,7 @@ public class LttngWorker implements IGraphWorker {
             if (tid == -1) {
                 return Collections.EMPTY_MAP;
             }
-            Optional<KernelAnalysisModule> kam = TmfTraceManager.getInstance().getActiveTraceSet().stream()
+            Optional<@Nullable KernelAnalysisModule> kam = TmfTraceManager.getInstance().getActiveTraceSet().stream()
                         .filter(trace -> trace.getHostId().equals(getHostId()))
                         .map(trace -> TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID))
                         .filter(mod -> mod != null)
This page took 0.025754 seconds and 5 git commands to generate.