Repository: wicket
Updated Branches:
  refs/heads/master 5f2809c7c -> 2f23607e1


Reduced degree of nesting and also didn't mess up the indentation all over the 
place


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2f23607e
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2f23607e
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2f23607e

Branch: refs/heads/master
Commit: 2f23607e13fb3582e84874f57a8a3ec6b7cc5a98
Parents: f2a23b8
Author: Domas Poliakas <dpoliakas@Domas-MBP.local>
Authored: Thu Aug 3 09:04:52 2017 +0100
Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Committed: Sun Aug 6 15:27:21 2017 +0300

----------------------------------------------------------------------
 .../wicket/util/tester/BaseWicketTester.java    | 26 +++++++++-----------
 1 file changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/2f23607e/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java 
b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
index ce8bc08..b0263c7 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
@@ -2328,26 +2328,24 @@ public class BaseWicketTester
                failMessage = "Component wasn't found in the AJAX response. " + 
componentInfo;
                result = isTrue(failMessage, isComponentInAjaxResponse);
 
-               if (result.wasFailed()){
-                       // 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()) {
+                       return result;
+               }
 
-                       if (enclosure != null){
-                               failMessage = "Component's enclosure was not 
found in the AJAX response. " + enclosure;
-                               boolean isEnclosureInAjaxResponse = 
!isComponentOnAjaxResponse(enclosure).wasFailed();
-                               return isTrue(failMessage, 
isEnclosureInAjaxResponse);
-                       } else {
-                               return result;
+               // 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);
                        }
+               });
 
-               } else {
+               if (enclosure == null) {
                        return result;
                }
 
+               failMessage = "Component's enclosure was not found in the AJAX 
response. " + enclosure;
+               boolean isEnclosureInAjaxResponse = 
!isComponentOnAjaxResponse(enclosure).wasFailed();
+               return isTrue(failMessage, isEnclosureInAjaxResponse);
 
        }
 

Reply via email to