Moving over from Jaxen-108:
Brian Ewins writes:
A related serialization issue: in ContextSupport, there is this line:
private transient FunctionContext functionContext;
The upshot of this is that functionContext will end up null on deserialization, and will be recreated as the default function context (in BaseXPath.java). So, XPaths that use extension functions are not actually serializable. Its not even clear that the non-transient members of ContextSupport are serializable either.
I think the correct answer here is that functionContext shouldn't be transient. I also thought it was considered best practice not to declare interfaces serializable (I'm thinking of Navigator here - interfaces that are effectively private, like Expr, don't matter). We're inconsistent there - eg VariableContext isn't marked Serializable but is stored in a non-transient field of ContextSupport, but Navigator is stored the same way and marked Serializable.
Comment by Elliotte Rusty Harold [17/Sep/05 08:02 AM]
FunctionContext does not implement Serializable. Making it implement Serializable would be tricky since most of the functions it contains aren't serializable either. This is especially true when considering the possibility of user defined extension functions not known to us at compile time.