original report 26 July 2006 by Ruimo Uno (Shisei Hanai)
Hi,
The DumbMethods detector in FIndBugs-1.0.0 reports the DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION against the following code:
Method m = String.class.getMethod("getBytes", new Class[] {int.class, int.class, byte[].class, int.class}); if (m.isAnnotationPresent(Deprecated.class)) {
Since the retention policy of the @Deprecated is the RUNTIME, this is a false positive. It seems that the DumbMethods uses a retention class database that is set by the visitAnnotation(). As a result, FindBugs can report correctly only for visited annotation classes and other classes are wrongly reported as bugs. Is this as designed?
Comment #1
Posted on Jul 28, 2006 by Helpful Wombatfix checked into cvs 27 July 2006
Status: Fixed
Labels:
Type-Defect
Priority-Medium