Github user bitstorm commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/224#discussion_r129855170
  
    --- Diff: 
wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java 
---
    @@ -2325,21 +2325,27 @@ public Result isComponentOnAjaxResponse(final 
Component component)
                failMessage = "Component wasn't found in the AJAX response. " + 
componentInfo;
                result = isTrue(failMessage, isComponentInAjaxResponse);
     
    -           // Check if the component has been included as part of an 
enclosure render
    -           Enclosure enclosure = 
getLastRenderedPage().visitChildren(Enclosure.class, (Enclosure enc, 
IVisit<Enclosure> visit) -> {
    -                   if 
(AjaxEnclosureListener.isControllerOfEnclosure(component, enc)){
    -                           visit.stop(enc);
    +           if (result.wasFailed()){
    --- End diff --
    
    To avoid if-else nesting I usually prefer to return immediately:
    
    ```
    if (!result.wasFailed())
      {
        return result;
       }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to