/*****************************************************************************
 * Copyright (c) PicoContainer Organization. All rights reserved.            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *                                                                           *
 * Original code by Joerg Schaible                                           *
 *****************************************************************************/

package org.picocontainer.gems.adapters;

import org.picocontainer.defaults.ObjectReference;

import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;


/**
 * An {@link org.picocontainer.defaults.ObjectReference} based on a {@link ThreadLocal}.
 * 
 * @author J&ouml;rg Schaible
 */
public class ThreadLocalReference extends ThreadLocal implements ObjectReference, Serializable {

    private static final long serialVersionUID = 1L;

    private void writeObject(final ObjectOutputStream out) {
        if(out != null); // eliminate warning because of unused parameter
    }

    private void readObject(final ObjectInputStream in) {
        if(in != null); // eliminate warning because of unused parameter
    }
}

@@ -748,16 +748,46 @@
 pters;%0A%0A
+import java.io.Serializable;%0A%0A
 import o
@@ -834,107 +834,8 @@
 e;%0A%0A
-import java.io.ObjectInputStream;%0Aimport java.io.ObjectOutputStream;%0Aimport java.io.Serializable;%0A%0A
 %0A/**
@@ -1130,138 +1130,177 @@
 ate 
-void writeObject(final ObjectOutputStream out) %7B%0A        if(out != null); // eliminate warning because of unused parameter
+static class Marker implements Serializable %7B%0A        private static final long serialVersionUID = 1L;%0A        private static final Marker INSTANCE = new Marker();%0A
 %0A    
-%7D%0A%0A
     
@@ -1311,126 +1311,162 @@
 ate 
-void readObject(final ObjectInputStream in) %7B%0A        if(in != null); // eliminate warning because of unused parameter
+Object readResolve() %7B%0A            return new ThreadLocalReference();%0A        %7D%0A    %7D%0A%0A    private Object writeReplace() %7B%0A        return Marker.INSTANCE;
 %0A   

Fix serialization issue with XStream 1.2.x.