Skip to content

ArrayIndexOutOfBoundsException in MethodBasedEvaluationContext [SPR-14554] #19122

Closed
@spring-projects-issues

Description

@spring-projects-issues

Matthias Rühl opened SPR-14554 and commented

java.lang.ArrayIndexOutOfBoundsException: 2
at org.springframework.context.expression.MethodBasedEvaluationContext.lazyLoadArguments(MethodBasedEvaluationContext.java:94)
at org.springframework.context.expression.MethodBasedEvaluationContext.lookupVariable(MethodBasedEvaluationContext.java:68)
at org.springframework.cache.interceptor.CacheEvaluationContext.lookupVariable(CacheEvaluationContext.java:74)
at org.springframework.expression.spel.ExpressionState.lookupVariable(ExpressionState.java:144)
at org.springframework.expression.spel.ast.VariableReference.getValueInternal(VariableReference.java:75)
at org.springframework.expression.spel.ast.MethodReference.getArguments(MethodReference.java:154)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:84)
at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:57)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:87)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:120)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:242)
at org.springframework.cache.interceptor.CacheOperationExpressionEvaluator.key(CacheOperationExpressionEvaluator.java:117)
at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:738)
at org.springframework.cache.interceptor.CacheAspectSupport.generateKey(CacheAspectSupport.java:554)
at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:498)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:389)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:327)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)

This is my cacheable annotation:

@Cacheable(value = "dummyCache", key = "'getSomethingList_'.concat(#var1).concat(T(java.util.Arrays).deepHashCode(#var2))")
List<Something> getSomethingList(String var1, Integer... var2);

Affects: 4.2.7, 4.3.2

Issue Links:

Referenced from: commits 4543a28, 48980a2, fae503d

Backported to: 4.2.8

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions