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>
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)