Author bpedman
Recipients bpedman
Date 2010-04-12.15:50:46
SpamBayes Score 5.85698e-13
Marked as misclassified No
Message-id <>
When I get a SynchronizedCallable object back from looking up an attribute on an object it does not report that it is callable. This makes it hard to determine whether the object is just a regular attribute or a method or something else. (In my case I really just need to detect that it is callable). This occurs by calling object.isCallable() and any SynchronizedCallable will return false even though it should be callable.

The reason this happens is because the actual object that would report that it is callable is stored as an attribute on the object. To fix this there are a couple of options, both include creating a method in the SynchronizedCallable class:

1.) Just return true since it is a callable

public boolean isCallable(){
    return true;

2) check the isCallable() function on the callable object
public boolean isCallable(){
    return callable.isCallable();

I think option 2 is more safe but I don't know what leads up to the creation of a SynchronizedCallable or if there is any verification that happens to make sure the callable object is callable, so it could just be by virtue of it being a SynchronizedCallable that it is in fact callable.
Date User Action Args
2010-04-12 15:50:47bpedmansetrecipients: + bpedman
2010-04-12 15:50:46bpedmansetmessageid: <>
2010-04-12 15:50:46bpedmanlinkissue1596 messages
2010-04-12 15:50:46bpedmancreate