[DROOLS-251] fix annotation resolution when it has the same name of a declared type
(cherry picked from commit c20957b873f5c03bbb5b90cbc571ce420704f052)