[BZ-1005204] recognize an event also when using java annotation
(cherry picked from commit f4baca9a44f29fe864c312dbdd82d1da56351f0b)