Summary: | No need to call method.isAnnotationPresent() then call method.getAnnotation. | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Mou, Jian <jianpro> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 7.0.47 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Mac OS X 10.4 | ||
Attachments: | org.apache.catalina.core.DefaultInstanceManager |
Thanks for the patch. It has been applied )with slight tweaks for formatting) to 8.0.x for 8.0.9 onwards and to 7.0.x for 7.0./55 onwards. I also fixed all the additional instances of the same problem elsewhere in the code base. I fixed several other usages of isAnnotationPresent() method, missed by Mark. It will be in 8.0.10, 7.0.55 onwards. |
Created attachment 31702 [details] org.apache.catalina.core.DefaultInstanceManager Just call method.getAnnotation(EJB.class) once, since isAnnotationPresent is also implmented by calling getAnnotation. java.lang.reflect.AccessibleObject: public boolean isAnnotationPresent( Class<? extends Annotation> annotationClass) { return getAnnotation(annotationClass) != null; }