XStream (http://xstream.codehaus.org/) provides a neat serialisation format in XML. It would be nice to serialise the state of a PicoContainer with XStream, and this would complement the default serialisation as well as the mechanism provided by org.nanocontainer.reflection.recorder.ContainerRecorder. (3 different serialisation schemes, each of which have their strengths and weaknesses).
Here is a testcase that should pass with XStream compatibility in place:
public void testShouldBeAbleToSerializeContainerWithXStream()
{
MutablePicoContainer pico = new DefaultPicoContainer();
pico.registerComponentImplementation(ArrayList.class);
XStream xStream = new XStream();
String picoXML = xStream.toXML(pico);
MutablePicoContainer pico2 = (MutablePicoContainer) xStream.fromXML(picoXML);
assertNotNull(pico2.getComponentInstance(ArrayList.class));
}
Resolving this issue will require most of the current final fields in various classes to be made non final.
This is a bit of a hack, but has no impact on the bytecode (final info is not in the bytecode afaik).
Any objections about making fields non final can be discussed here.