@@ -724,13 +724,32 @@ public void varargsAgainstProxy_SPR16122() {
724
724
725
725
VarargsReceiver receiver = new VarargsReceiver ();
726
726
VarargsInterface proxy = (VarargsInterface ) Proxy .newProxyInstance (
727
- getClass ().getClassLoader (), new Class <?>[]{VarargsInterface .class },
727
+ getClass ().getClassLoader (), new Class <?>[] {VarargsInterface .class },
728
728
(proxy1 , method , args ) -> method .invoke (receiver , args ));
729
729
730
730
assertEquals ("OK" , expr .getValue (new StandardEvaluationContext (receiver )));
731
731
assertEquals ("OK" , expr .getValue (new StandardEvaluationContext (proxy )));
732
732
}
733
733
734
+ @ Test
735
+ public void testCompiledExpressionForProxy_SPR16191 () {
736
+ SpelExpressionParser expressionParser =
737
+ new SpelExpressionParser (new SpelParserConfiguration (SpelCompilerMode .IMMEDIATE , null ));
738
+ Expression expression = expressionParser .parseExpression ("#target.process(#root)" );
739
+
740
+ VarargsReceiver receiver = new VarargsReceiver ();
741
+ VarargsInterface proxy = (VarargsInterface ) Proxy .newProxyInstance (
742
+ getClass ().getClassLoader (), new Class <?>[] {VarargsInterface .class },
743
+ (proxy1 , method , args ) -> method .invoke (receiver , args ));
744
+
745
+ StandardEvaluationContext evaluationContext = new StandardEvaluationContext ();
746
+ evaluationContext .setVariable ("target" , proxy );
747
+
748
+ String result = expression .getValue (evaluationContext , "foo" , String .class );
749
+ result = expression .getValue (evaluationContext , "foo" , String .class );
750
+ assertEquals ("OK" , result );
751
+ }
752
+
734
753
@ Test
735
754
public void varargsAndPrimitives_SPR8174 () throws Exception {
736
755
EvaluationContext emptyEvalContext = new StandardEvaluationContext ();
0 commit comments