diff --git a/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContext.java b/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContext.java index 6d502f082..1f06e5fe3 100644 --- a/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContext.java +++ b/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContext.java @@ -59,9 +59,9 @@ public CacheInvocationContext(A cacheAnnotation, MethodExecutionAction cacheKeyM this.cacheKeyMethod = cacheKeyMethod; this.cacheAnnotation = cacheAnnotation; Class[] parametersTypes = method.getParameterTypes(); - Annotation[][] parametersAnnotations = method.getParameterAnnotations(); int parameterCount = parametersTypes.length; if (parameterCount > 0) { + Annotation[][] parametersAnnotations = method.getParameterAnnotations(); ImmutableList.Builder parametersBuilder = ImmutableList.builder(); for (int pos = 0; pos < parameterCount; pos++) { Class paramType = parametersTypes[pos];