From e4e667acdb774b45164f3ec345bfdf9e406e537f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 23 Oct 2021 18:02:55 +0200 Subject: [PATCH] Polishing --- .../org/springframework/context/expression/MapAccessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java index 5acc804d2a..e7374fe305 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java +++ b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public class MapAccessor implements CompilablePropertyAccessor { @Override public boolean canRead(EvaluationContext context, @Nullable Object target, String name) throws AccessException { - return (target instanceof Map && ((Map) target).containsKey(name)); + return (target instanceof Map map && map.containsKey(name)); } @Override