Issue Details (XML | Word | Printable)

Key: JAXEN-141
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Elliotte Rusty Harold
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jaxen

Serializable FunctionContext

Created: 01/May/06 06:39 AM   Updated: 01/May/06 06:39 AM
Return to search
Component/s: function
Affects Version/s: 2.0
Fix Version/s: 2.0

Time Tracking:
Not Specified


 Description  « Hide

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.



There are no entries against this issue.