@@ -2277,7 +2277,7 @@ public static String join(String...strings) {
2277
2277
2278
2278
@ Test
2279
2279
void compiledExpressionShouldWorkWhenUsingCustomFunctionWithVarargs () throws Exception {
2280
- StandardEvaluationContext context = null ;
2280
+ StandardEvaluationContext context ;
2281
2281
2282
2282
// Here the target method takes Object... and we are passing a string
2283
2283
expression = parser .parseExpression ("#doFormat('hey %s', 'there')" );
@@ -2287,7 +2287,7 @@ void compiledExpressionShouldWorkWhenUsingCustomFunctionWithVarargs() throws Exc
2287
2287
((SpelExpression ) expression ).setEvaluationContext (context );
2288
2288
2289
2289
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2290
- assertThat (((SpelNodeImpl ) (( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2290
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2291
2291
assertCanCompile (expression );
2292
2292
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2293
2293
@@ -2298,7 +2298,7 @@ void compiledExpressionShouldWorkWhenUsingCustomFunctionWithVarargs() throws Exc
2298
2298
((SpelExpression ) expression ).setEvaluationContext (context );
2299
2299
2300
2300
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2301
- assertThat (((SpelNodeImpl ) (( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2301
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2302
2302
assertCanCompile (expression );
2303
2303
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2304
2304
@@ -2310,7 +2310,7 @@ void compiledExpressionShouldWorkWhenUsingCustomFunctionWithVarargs() throws Exc
2310
2310
((SpelExpression ) expression ).setEvaluationContext (context );
2311
2311
2312
2312
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2313
- assertThat (((SpelNodeImpl ) (( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2313
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2314
2314
assertCanCompile (expression );
2315
2315
assertThat (expression .getValue (String .class )).isEqualTo ("hey there" );
2316
2316
}
@@ -2465,173 +2465,173 @@ void functionReferenceVarargs_SPR12359() throws Exception {
2465
2465
2466
2466
expression = parser .parseExpression ("#append('a','b','c')" );
2467
2467
assertThat (expression .getValue (context ).toString ()).isEqualTo ("abc" );
2468
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2468
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2469
2469
assertCanCompile (expression );
2470
2470
assertThat (expression .getValue (context ).toString ()).isEqualTo ("abc" );
2471
2471
2472
2472
expression = parser .parseExpression ("#append('a')" );
2473
2473
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a" );
2474
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2474
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2475
2475
assertCanCompile (expression );
2476
2476
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a" );
2477
2477
2478
2478
expression = parser .parseExpression ("#append()" );
2479
2479
assertThat (expression .getValue (context ).toString ()).isEmpty ();
2480
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2480
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2481
2481
assertCanCompile (expression );
2482
2482
assertThat (expression .getValue (context ).toString ()).isEmpty ();
2483
2483
2484
2484
expression = parser .parseExpression ("#append(#stringArray)" );
2485
2485
assertThat (expression .getValue (context ).toString ()).isEqualTo ("xyz" );
2486
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2486
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2487
2487
assertCanCompile (expression );
2488
2488
assertThat (expression .getValue (context ).toString ()).isEqualTo ("xyz" );
2489
2489
2490
2490
// This is a methodreference invocation, to compare with functionreference
2491
2491
expression = parser .parseExpression ("append(#stringArray)" );
2492
2492
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("xyz" );
2493
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2493
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2494
2494
assertCanCompile (expression );
2495
2495
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("xyz" );
2496
2496
2497
2497
expression = parser .parseExpression ("#append2('a','b','c')" );
2498
2498
assertThat (expression .getValue (context ).toString ()).isEqualTo ("abc" );
2499
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2499
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2500
2500
assertCanCompile (expression );
2501
2501
assertThat (expression .getValue (context ).toString ()).isEqualTo ("abc" );
2502
2502
2503
2503
expression = parser .parseExpression ("append2('a','b')" );
2504
2504
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("ab" );
2505
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2505
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2506
2506
assertCanCompile (expression );
2507
2507
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("ab" );
2508
2508
2509
2509
expression = parser .parseExpression ("#append2('a','b')" );
2510
2510
assertThat (expression .getValue (context ).toString ()).isEqualTo ("ab" );
2511
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2511
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2512
2512
assertCanCompile (expression );
2513
2513
assertThat (expression .getValue (context ).toString ()).isEqualTo ("ab" );
2514
2514
2515
2515
expression = parser .parseExpression ("#append2()" );
2516
2516
assertThat (expression .getValue (context ).toString ()).isEmpty ();
2517
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2517
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2518
2518
assertCanCompile (expression );
2519
2519
assertThat (expression .getValue (context ).toString ()).isEmpty ();
2520
2520
2521
2521
expression = parser .parseExpression ("#append3(#stringArray)" );
2522
2522
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("xyz" );
2523
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2523
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2524
2524
assertCanCompile (expression );
2525
2525
assertThat (expression .getValue (context , new SomeCompareMethod2 ()).toString ()).isEqualTo ("xyz" );
2526
2526
2527
2527
// TODO Determine why the String[] is passed as the first element of the Object... varargs array instead of the entire varargs array.
2528
2528
// expression = parser.parseExpression("#append2(#stringArray)");
2529
2529
// assertThat(expression.getValue(context)).hasToString("xyz");
2530
- // assertThat(((SpelNodeImpl) (( SpelExpression) expression).getAST() ).isCompilable()).isTrue();
2530
+ // assertThat(((SpelExpression) expression).getAST().isCompilable()).isTrue();
2531
2531
// assertCanCompile(expression);
2532
2532
// assertThat(expression.getValue(context)).hasToString("xyz");
2533
2533
2534
2534
expression = parser .parseExpression ("#sum(1,2,3)" );
2535
2535
assertThat (expression .getValue (context )).isEqualTo (6 );
2536
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2536
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2537
2537
assertCanCompile (expression );
2538
2538
assertThat (expression .getValue (context )).isEqualTo (6 );
2539
2539
2540
2540
expression = parser .parseExpression ("#sum(2)" );
2541
2541
assertThat (expression .getValue (context )).isEqualTo (2 );
2542
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2542
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2543
2543
assertCanCompile (expression );
2544
2544
assertThat (expression .getValue (context )).isEqualTo (2 );
2545
2545
2546
2546
expression = parser .parseExpression ("#sum()" );
2547
2547
assertThat (expression .getValue (context )).isEqualTo (0 );
2548
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2548
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2549
2549
assertCanCompile (expression );
2550
2550
assertThat (expression .getValue (context )).isEqualTo (0 );
2551
2551
2552
2552
expression = parser .parseExpression ("#sum(#intArray)" );
2553
2553
assertThat (expression .getValue (context )).isEqualTo (20 );
2554
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2554
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2555
2555
assertCanCompile (expression );
2556
2556
assertThat (expression .getValue (context )).isEqualTo (20 );
2557
2557
2558
2558
expression = parser .parseExpression ("#sumDouble(1.0d,2.0d,3.0d)" );
2559
2559
assertThat (expression .getValue (context )).isEqualTo (6 );
2560
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2560
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2561
2561
assertCanCompile (expression );
2562
2562
assertThat (expression .getValue (context )).isEqualTo (6 );
2563
2563
2564
2564
expression = parser .parseExpression ("#sumDouble(2.0d)" );
2565
2565
assertThat (expression .getValue (context )).isEqualTo (2 );
2566
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2566
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2567
2567
assertCanCompile (expression );
2568
2568
assertThat (expression .getValue (context )).isEqualTo (2 );
2569
2569
2570
2570
expression = parser .parseExpression ("#sumDouble()" );
2571
2571
assertThat (expression .getValue (context )).isEqualTo (0 );
2572
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2572
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2573
2573
assertCanCompile (expression );
2574
2574
assertThat (expression .getValue (context )).isEqualTo (0 );
2575
2575
2576
2576
expression = parser .parseExpression ("#sumDouble(#doubleArray)" );
2577
2577
assertThat (expression .getValue (context )).isEqualTo (20 );
2578
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2578
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2579
2579
assertCanCompile (expression );
2580
2580
assertThat (expression .getValue (context )).isEqualTo (20 );
2581
2581
2582
2582
expression = parser .parseExpression ("#sumFloat(1.0f,2.0f,3.0f)" );
2583
2583
assertThat (expression .getValue (context )).isEqualTo (6 );
2584
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2584
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2585
2585
assertCanCompile (expression );
2586
2586
assertThat (expression .getValue (context )).isEqualTo (6 );
2587
2587
2588
2588
expression = parser .parseExpression ("#sumFloat(2.0f)" );
2589
2589
assertThat (expression .getValue (context )).isEqualTo (2 );
2590
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2590
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2591
2591
assertCanCompile (expression );
2592
2592
assertThat (expression .getValue (context )).isEqualTo (2 );
2593
2593
2594
2594
expression = parser .parseExpression ("#sumFloat()" );
2595
2595
assertThat (expression .getValue (context )).isEqualTo (0 );
2596
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2596
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2597
2597
assertCanCompile (expression );
2598
2598
assertThat (expression .getValue (context )).isEqualTo (0 );
2599
2599
2600
2600
expression = parser .parseExpression ("#sumFloat(#floatArray)" );
2601
2601
assertThat (expression .getValue (context )).isEqualTo (20 );
2602
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2602
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2603
2603
assertCanCompile (expression );
2604
2604
assertThat (expression .getValue (context )).isEqualTo (20 );
2605
2605
2606
2606
2607
2607
expression = parser .parseExpression ("#appendChar('abc'.charAt(0),'abc'.charAt(1))" );
2608
2608
assertThat (expression .getValue (context )).isEqualTo ("ab" );
2609
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2609
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2610
2610
assertCanCompile (expression );
2611
2611
assertThat (expression .getValue (context )).isEqualTo ("ab" );
2612
2612
2613
2613
2614
2614
expression = parser .parseExpression ("#append4('a','b','c')" );
2615
2615
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::bc" );
2616
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2616
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2617
2617
assertCanCompile (expression );
2618
2618
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::bc" );
2619
2619
2620
2620
expression = parser .parseExpression ("#append4('a','b')" );
2621
2621
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::b" );
2622
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2622
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2623
2623
assertCanCompile (expression );
2624
2624
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::b" );
2625
2625
2626
2626
expression = parser .parseExpression ("#append4('a')" );
2627
2627
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::" );
2628
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2628
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2629
2629
assertCanCompile (expression );
2630
2630
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::" );
2631
2631
2632
2632
expression = parser .parseExpression ("#append4('a',#stringArray)" );
2633
2633
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::xyz" );
2634
- assertThat (((SpelNodeImpl )(( SpelExpression ) expression ).getAST () ).isCompilable ()).isTrue ();
2634
+ assertThat (((SpelExpression ) expression ).getAST ().isCompilable ()).isTrue ();
2635
2635
assertCanCompile (expression );
2636
2636
assertThat (expression .getValue (context ).toString ()).isEqualTo ("a::xyz" );
2637
2637
}
0 commit comments