You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/06/10 10:36:41 UTC

[Bug 56611] New: No need to call method.isAnnotationPresent() then call method.getAnnotation.

https://issues.apache.org/bugzilla/show_bug.cgi?id=56611

            Bug ID: 56611
           Summary: No need to call method.isAnnotationPresent() then call
                    method.getAnnotation.
           Product: Tomcat 7
           Version: 7.0.47
          Hardware: All
                OS: Mac OS X 10.4
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: jianpro@foxmail.com

Created attachment 31702
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31702&action=edit
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;
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56611] No need to call method.isAnnotationPresent() then call method.getAnnotation.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56611

Mou, Jian <ji...@foxmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31702|0                           |1
           is patch|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56611] No need to call method.isAnnotationPresent() then call method.getAnnotation.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56611

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
I fixed several other usages of isAnnotationPresent() method, missed by Mark.
It will be in 8.0.10, 7.0.55 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56611] No need to call method.isAnnotationPresent() then call method.getAnnotation.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56611

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org