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/06/11 21:27:32 UTC

wicket git commit: WICKET-6560 log class of non serializable

Repository: wicket
Updated Branches:
  refs/heads/master c6d3ae1e6 -> 175734dae


WICKET-6560 log class of non serializable


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

Branch: refs/heads/master
Commit: 175734dae970c4c328a2ea6a089382a2454c46b3
Parents: c6d3ae1
Author: Sven Meier <sv...@apache.org>
Authored: Mon Jun 11 23:09:41 2018 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Mon Jun 11 23:26:08 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/wicket/model/ChainingModel.java   |  4 ++--
 .../org/apache/wicket/model/ChainingModelTest.java    | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/175734da/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java b/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
index 4b65b76..5d5a7fa 100644
--- a/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/model/ChainingModel.java
@@ -50,8 +50,8 @@ public class ChainingModel<T> implements IChainingModel<T>
 					+ "page instance as the model object and 'session.attribute' as the path.");
 		} else if (modelObject != null && (modelObject instanceof Serializable == false))
 		{
-			LOG.warn("It is not a good idea to reference a non-serializable instance "
-					+ "in models directly as it may lead to serialization problems.");
+			LOG.warn("It is not a good idea to reference non-serializable {} "
+					+ "in a model directly as it may lead to serialization problems.", modelObject.getClass());
 		}
 
 		target = modelObject;

http://git-wip-us.apache.org/repos/asf/wicket/blob/175734da/wicket-core/src/test/java/org/apache/wicket/model/ChainingModelTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/model/ChainingModelTest.java b/wicket-core/src/test/java/org/apache/wicket/model/ChainingModelTest.java
index 6b64d44..3239136 100644
--- a/wicket-core/src/test/java/org/apache/wicket/model/ChainingModelTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/model/ChainingModelTest.java
@@ -16,10 +16,19 @@
  */
 package org.apache.wicket.model;
 
+import static org.hamcrest.core.StringContains.containsString;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
+import java.io.StringWriter;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.WriterAppender;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -39,6 +48,11 @@ public class ChainingModelTest
 	}
 	
 	@Test
+	public void testNonSerializable() {
+		new ChainingModel<>(Thread.currentThread());
+	}
+	
+	@Test
 	public void testDetachable() {
 		class TestDetachable implements IDetachable
 		{