You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2018/11/05 12:01:12 UTC

wicket git commit: WICKET-6600 log with warn only

Repository: wicket
Updated Branches:
  refs/heads/wicket-8.x 343ab8462 -> 2edfa9b09


WICKET-6600 log with warn only


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

Branch: refs/heads/wicket-8.x
Commit: 2edfa9b096c7c90b432a9acdde27f5475ea1dfb5
Parents: 343ab84
Author: Sven Meier <sv...@apache.org>
Authored: Mon Nov 5 12:41:36 2018 +0100
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Nov 5 13:00:27 2018 +0100

----------------------------------------------------------------------
 .../apache/wicket/page/PartialPageUpdate.java   | 27 ++++++++------------
 1 file changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/2edfa9b0/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
index 0b89cef..5b8794b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
+++ b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
@@ -439,22 +439,17 @@ public abstract class PartialPageUpdate
 		else
 		{
 			Page pageOfComponent = component.findParent(Page.class);
-			if (pageOfComponent != page)
+			if (pageOfComponent == null) 
 			{
-				String msg = "Cannot update component because its page is not the same as this partial update. Component: " + component.toString();
-				IllegalArgumentException error = new IllegalArgumentException(msg);
-
-				if (pageOfComponent == null) {
-					// no longer on page - log the error but don't block the user of the application
-					// (which was the behavior in Wicket <= 7).
-					LOG.error(msg, error);
-					return;
-				}
-				else 
-				{
-					// on another page
-					throw error;
-				}
+				// no longer on page - log the error but don't block the user of the application
+				// (which was the behavior in Wicket <= 7).
+				LOG.warn("Component '{}' not cannot be updated because it was already removed from page", component);
+				return;
+			}
+			else if (pageOfComponent != page) 
+			{
+				// on another page
+				throw new IllegalArgumentException("Component " + component.toString() + " cannot be updated because it is on another page.");
 			}
 
 			if (component instanceof AbstractRepeater)
@@ -462,7 +457,7 @@ public abstract class PartialPageUpdate
 				throw new IllegalArgumentException(
 						"Component " +
 								component.getClass().getName() +
-								" has been added to a partial page update. This component is a repeater and cannot be repainted directly. " +
+								" is a repeater and cannot be added to a partial page update directly. " +
 								"Instead add its parent or another markup container higher in the hierarchy.");
 			}
 		}