Use diamond operator where feasible

See gh-31916
This commit is contained in:
Yanming Zhou
2023-12-28 15:25:18 +08:00
committed by Stéphane Nicoll
parent db2c532c07
commit 094479b55f
22 changed files with 54 additions and 35 deletions

View File

@@ -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);