24
24
import java .util .Collection ;
25
25
import java .util .Collections ;
26
26
import java .util .HashMap ;
27
- import java .util .HashSet ;
28
27
import java .util .LinkedHashMap ;
28
+ import java .util .LinkedHashSet ;
29
29
import java .util .List ;
30
30
import java .util .Map ;
31
31
import java .util .Properties ;
@@ -227,9 +227,7 @@ public int run2() {
227
227
public void SPR5804 () throws Exception {
228
228
Map <String , String > m = new HashMap <String , String >();
229
229
m .put ("foo" , "bar" );
230
- StandardEvaluationContext eContext = new StandardEvaluationContext (m ); // root is
231
- // a map
232
- // instance
230
+ StandardEvaluationContext eContext = new StandardEvaluationContext (m ); // root is a map instance
233
231
eContext .addPropertyAccessor (new MapAccessor ());
234
232
Expression expr = new SpelExpressionParser ().parseRaw ("['foo']" );
235
233
assertEquals ("bar" , expr .getValue (eContext ));
@@ -419,8 +417,7 @@ public void indexingAsAPropertyAccess_SPR6968_1() {
419
417
expr = new SpelExpressionParser ().parseRaw ("instance[bar]" );
420
418
name = expr .getValue (eContext , String .class );
421
419
assertEquals ("hello" , name );
422
- name = expr .getValue (eContext , String .class ); // will be using the cached accessor
423
- // this time
420
+ name = expr .getValue (eContext , String .class ); // will be using the cached accessor this time
424
421
assertEquals ("hello" , name );
425
422
}
426
423
@@ -434,8 +431,7 @@ public void indexingAsAPropertyAccess_SPR6968_2() {
434
431
expr = new SpelExpressionParser ().parseRaw ("instance[#bar]" );
435
432
name = expr .getValue (eContext , String .class );
436
433
assertEquals ("hello" , name );
437
- name = expr .getValue (eContext , String .class ); // will be using the cached accessor
438
- // this time
434
+ name = expr .getValue (eContext , String .class ); // will be using the cached accessor this time
439
435
assertEquals ("hello" , name );
440
436
}
441
437
@@ -1279,8 +1275,8 @@ public void customStaticFunctions_SPR9038() {
1279
1275
@ Override
1280
1276
protected Method [] getMethods (Class <?> type ) {
1281
1277
try {
1282
- return new Method [] { Integer . class . getDeclaredMethod ( "parseInt" , new Class [] { String . class ,
1283
- Integer .TYPE }) };
1278
+ return new Method [] {
1279
+ Integer . class . getDeclaredMethod ( "parseInt" , new Class [] { String . class , Integer .TYPE }) };
1284
1280
}
1285
1281
catch (NoSuchMethodException ex ) {
1286
1282
return new Method [0 ];
@@ -1811,7 +1807,7 @@ public void SPR9194() {
1811
1807
1812
1808
@ Test
1813
1809
public void SPR11348 () {
1814
- Collection <String > coll = new HashSet <String >();
1810
+ Collection <String > coll = new LinkedHashSet <String >();
1815
1811
coll .add ("one" );
1816
1812
coll .add ("two" );
1817
1813
coll = Collections .unmodifiableCollection (coll );
@@ -1841,6 +1837,7 @@ public void SPR11445_beanReference() {
1841
1837
assertEquals (1 , expr .getValue (context ));
1842
1838
}
1843
1839
1840
+
1844
1841
static class Spr11445Class implements BeanResolver {
1845
1842
1846
1843
private final AtomicInteger counter = new AtomicInteger ();
@@ -1859,6 +1856,7 @@ public Object resolve(EvaluationContext context, String beanName) throws AccessE
1859
1856
}
1860
1857
}
1861
1858
1859
+
1862
1860
@ Test
1863
1861
public void SPR11494 () {
1864
1862
Expression exp = new SpelExpressionParser ().parseExpression ("T(java.util.Arrays).asList('a','b')" );
0 commit comments