THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
RequestCycle#find(Class<T>) returns java.util.Optional
Jira | ||||||
---|---|---|---|---|---|---|
|
Code calling RequestCycle#find(Class<T>) has to check whether a matching IRequestHandler is found. This is now enforced by returning an Optional<T>:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
getComponent().getRequestCycle().find(AjaxRequestTarget.class).ifPresent(target -> target.add(this)); |
Warning | ||
---|---|---|
| ||
During migration you should check your old code for places where the AjaxRequestCycle (now an Optional<AjaxRequestTarget>) is compared with null: |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
if (cycle.find(AjaxRequestTarget.class) == null) { // this is *never* executed since #find() always returns an Optional } if (cycle.find(AjaxRequestTarget.class) != null) { // this is *always* executed since #find() always returns an Optional } |
...