Hi guys! I've got a slight problem. Previously I mentioned a problem
where I was not able to initialise the method id because of MethodCall()'s
empty constructor being called. method in MethodCall would then be
initialised in readExternal(). At the time, I was using the Lightweight
subclass and i got around the problem by overriding readExternal and
assigning the method id once readExternal had executed.
Now that I'm using MethodCall's directly and using the getId(), I've got a
similar problem but I'm not sure how to solve it. Basically, for every
MethodCall(Method, Object[]) constructor call, it's easy to wrap it in a
factory method and call setId based on the method to method id map
after the constructor.
However, for the cases when MethodCall() is called, I end up having
MethodCalls which haven't got their id initialised so tests are failing. This
happens in EnhancedTreeCacheMarshaller.unmarshallMethodCall() where
arguments sometimes contains MethodCalls initialised using the empty
constructor (called by ObjectInputStream), but where can I inject the
setId call?
I've added a different create method to be called when creating the
MethodCall at the end of unmarshallMethodCall() where I inspect the
arguments to see if there's any MethodCall in here. I know that if they are
there, their id has not been initiliased and i do so. Any better ideas?
The JIRA issue related to this has been resolved:
http://jira.jboss.com/jira/browse/JBCACHE-581
Nice one