From a6d1f7c256b618009abc55b26a0958acb7383fa9 Mon Sep 17 00:00:00 2001 From: Simon Kitching Date: Wed, 22 Feb 2006 04:53:08 +0000 Subject: [PATCH] Removed Serializable marker interface as it is not possible to implement this correctly in all cases. AvalonLogger was introduced in 1.0.4, and was marked Serializable. However serialization for this class was *completely* broken in all cases in that release, so removing the Serializable marker is not considered a binary-incompatible change. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@379680 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/logging/impl/AvalonLogger.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/java/org/apache/commons/logging/impl/AvalonLogger.java b/src/java/org/apache/commons/logging/impl/AvalonLogger.java index f043c2f..1753c25 100644 --- a/src/java/org/apache/commons/logging/impl/AvalonLogger.java +++ b/src/java/org/apache/commons/logging/impl/AvalonLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2004 The Apache Software Foundation. + * Copyright 2001-2004,2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ package org.apache.commons.logging.impl; -import java.io.Serializable; - import org.apache.avalon.framework.logger.Logger; import org.apache.commons.logging.Log; @@ -41,14 +39,19 @@ import org.apache.commons.logging.Log; * * *

- * Note: AvalonLogger implements - * Serializable for reasons of consistency and backwards compatibility. - * However, serializable is not recommended. + * Note: AvalonLogger does not implement Serializable + * because the constructors available for it make this impossible to achieve in all + * circumstances; there is no way to "reconnect" to an underlying Logger object on + * deserialization if one was just passed in to the constructor of the original + * object. This class was marked Serializable in the 1.0.4 release of + * commons-logging, but this never actually worked (a NullPointerException would + * be thrown as soon as the deserialized object was used), so removing this marker + * is not considered to be an incompatible change. *

* @author Neeme Praks * @version $Revision$ $Date$ */ -public class AvalonLogger implements Log, Serializable { +public class AvalonLogger implements Log { /** Ancesteral avalon logger */ private static Logger defaultLogger = null;