Use diamond operator where feasible
See gh-31916
This commit is contained in:
committed by
Stéphane Nicoll
parent
db2c532c07
commit
094479b55f
@@ -59,7 +59,7 @@ public class SpelExceptionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
Expression spelExpression = parser.parseExpression("#aMap['one'] eq 1");
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariables(new HashMap<String, Object>() {
|
||||
ctx.setVariables(new HashMap<>() {
|
||||
{
|
||||
put("aMap", new HashMap<String, Integer>() {
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public class SpelExceptionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
Expression spelExpression = parser.parseExpression("#aList.contains('one')");
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariables(new HashMap<String, Object>() {
|
||||
ctx.setVariables(new HashMap<>() {
|
||||
{
|
||||
put("aList", new ArrayList<String>() {
|
||||
{
|
||||
@@ -120,7 +120,7 @@ public class SpelExceptionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
Expression spelExpression = parser.parseExpression("#aList[0] eq 'one'");
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariables(new HashMap<String, Object>() {
|
||||
ctx.setVariables(new HashMap<>() {
|
||||
{
|
||||
put("aList", new ArrayList<String>() {
|
||||
{
|
||||
@@ -150,9 +150,9 @@ public class SpelExceptionTests {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
Expression spelExpression = parser.parseExpression("#anArray[0] eq 1");
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariables(new HashMap<String, Object>() {
|
||||
ctx.setVariables(new HashMap<>() {
|
||||
{
|
||||
put("anArray", new int[] {1,2,3});
|
||||
put("anArray", new int[]{1, 2, 3});
|
||||
}
|
||||
});
|
||||
boolean result = spelExpression.getValue(ctx, Boolean.class);
|
||||
|
||||
Reference in New Issue
Block a user