Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.2.2
-
Cross platform / Play Framework 2.2
Description
Bug Description
The method org.apache.shiro.aop.DefaultAnnotationResolver.getAnnotation throws NullPointerException when a given MethodInvocation argument represents static method:
Technical Info
return annotation == null ? mi.getThis().getClass().getAnnotation(clazz) : annotation;
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.
Resolution
See attached patch: DefaultAnnotationResolver.java.diff.