As you can see in the implementation of ThreadYieldTransformer, in order to understand whether it should remove yield-call, it checkes owner. But it doesn't take into account that owner means the actual callee (not the concrete class which method will be called).
In Java it's possible to call static methods from base classes. So, if we have a derived thread instance and call its yield, then it will not be removed.
But, I'm not sure that it's a big problem, because I think that almost all users call exactly Thread.yield().
How to fix
We can easily check that owner extends Thread as it's done in RandomTransformer. ASAIU, it fixes the problem.
Version: 2.16 (and the previous ones, too)
Issue
As you can see in the implementation of ThreadYieldTransformer, in order to understand whether it should remove
yield
-call, it checkesowner
. But it doesn't take into account thatowner
means the actual callee (not the concrete class which method will be called).In Java it's possible to call static methods from base classes. So, if we have a derived thread instance and call its
yield
, then it will not be removed.But, I'm not sure that it's a big problem, because I think that almost all users call exactly
Thread.yield()
.How to fix
We can easily check that
owner
extendsThread
as it's done in RandomTransformer. ASAIU, it fixes the problem.