Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
this stackt trace:
Stack trace: java.lang.NullPointerException java.util.Objects#requireNonNull(Objects.java:203) java.util.Optional#<init>(Optional.java:96) java.util.Optional#of(Optional.java:108) java.util.stream.FindOps$FindSink$OfRef#get(FindOps.java:193) java.util.stream.FindOps$FindSink$OfRef#get(FindOps.java:190) java.util.stream.FindOps$FindOp#evaluateSequential(FindOps.java:152) java.util.stream.AbstractPipeline#evaluate(AbstractPipeline.java:234) java.util.stream.ReferencePipeline#findFirst(ReferencePipeline.java:464) org.apache.isis.viewer.wicket.model.models.ActionModel#executeAction(ActionModel.java:474)
which results from this code:
return routingServices .filter(routingService->routingService.canRoute(result)) .map(routingService->{ final Object routeTo = routingService.route(result); return routeTo != null? getPersistenceSession().adapterFor(routeTo): null; }) .findFirst() .orElse(resultAdapter);
This isn't quite equivalent to the code in 1.16.x:
final Object result = resultAdapter != null ? resultAdapter.getObject() : null; for (RoutingService routingService : routingServices) { final boolean canRoute = routingService.canRoute(result); if(canRoute) { final Object routeTo = routingService.route(result); return routeTo != null? getPersistenceSession().adapterFor(routeTo): null; } } return resultAdapter;