Yep, looks like a bug to me to. Can you do two things?
- file a jira issue for it so it dos not get lost
- extend the unittest for taskinstances with a test for this functionality.
- write a patch
ok, 3 things, but the third already seems done. Imo the solution is good. Would improve speed as well by testing first if it is the right token. I'm only not sure where the synchronization in the method name comes from.