You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Brian Demers (JIRA)" <ji...@apache.org> on 2016/06/23 23:54:16 UTC

[jira] [Updated] (SHIRO-473) DefaultAnnotationResolver.getAnnotation throws NullPointerException

     [ https://issues.apache.org/jira/browse/SHIRO-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Demers updated SHIRO-473:
-------------------------------
    Labels: AOP AnnotationResolver NullPointerException patch  (was: AOP AnnotationResolver NullPointerException)

> DefaultAnnotationResolver.getAnnotation throws NullPointerException
> -------------------------------------------------------------------
>
>                 Key: SHIRO-473
>                 URL: https://issues.apache.org/jira/browse/SHIRO-473
>             Project: Shiro
>          Issue Type: Bug
>          Components: Integration: JEE
>    Affects Versions: 1.2.2
>         Environment: Cross platform / Play Framework 2.2
>            Reporter: Sergiy Sokolenko
>              Labels: AOP, AnnotationResolver, NullPointerException, patch
>         Attachments: DefaultAnnotationResolver.java.diff
>
>
> h3. Bug Description
> The method org.apache.shiro.aop.DefaultAnnotationResolver.getAnnotation throws NullPointerException when a given MethodInvocation argument represents static method:
> h3. Technical Info
> [http://shiro.apache.org/static/1.2.2/apidocs/src-html/org/apache/shiro/aop/DefaultAnnotationResolver.html#line.62]:
> {code}
> return annotation == null ? mi.getThis().getClass().getAnnotation(clazz) : annotation;
> {code}
> if annotation is null and mi represents static method invocation, then mi.getThis() will return null causing the following chained call {{getClass()}} fail with NullPointerException.
> h3. Resolution
> See attached patch: DefaultAnnotationResolver.java.diff.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)