Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: WICKET-6189

...

Code Block
languagejava
titleRequestCycle.find(Class<T>)
collapsetrue
getComponent().getRequestCycle().find(AjaxRequestTarget.class).ifPresent(target -> target.add(this)); 

 

...

During migration you should check your old code for places where the AjaxRequestCycle (now an Optional<AjaxRequestTarget>) is compared with null:

Code Block
languagejava
titlePitfall when comparing with null
collapsetrue
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
}

AjaxFallback** components now use java.util.Optional  
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyWICKET-6104

...