Browse Source

Polishing

pull/27600/head
Sam Brannen 4 years ago
parent
commit
e4e667acdb
  1. 4
      spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java

4
spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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

Loading…
Cancel
Save