From e8c06c6d991e135015ddd620526ac2dee789c8a5 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 26 Mar 2014 21:47:56 +0100 Subject: [PATCH] Consistent PropertyAccessor method order as declared in the interface Issue: SPR-11609 (cherry picked from commit b70148c) --- .../context/expression/BeanFactoryAccessor.java | 11 ++++++----- .../context/expression/MapAccessor.java | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java b/spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java index 486ded925fd..dc0a77b6432 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java +++ b/spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2014 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. @@ -32,6 +32,11 @@ import org.springframework.expression.TypedValue; */ public class BeanFactoryAccessor implements PropertyAccessor { + public Class[] getSpecificTargetClasses() { + return new Class[] {BeanFactory.class}; + } + + @Override public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException { return (((BeanFactory) target).containsBean(name)); } @@ -48,8 +53,4 @@ public class BeanFactoryAccessor implements PropertyAccessor { throw new AccessException("Beans in a BeanFactory are read-only"); } - public Class[] getSpecificTargetClasses() { - return new Class[] {BeanFactory.class}; - } - } 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 a580cf39849..a897614d6e7 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-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -33,6 +33,10 @@ import org.springframework.expression.TypedValue; */ public class MapAccessor implements PropertyAccessor { + public Class[] getSpecificTargetClasses() { + return new Class[] {Map.class}; + } + public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException { Map map = (Map) target; return map.containsKey(name); @@ -57,10 +61,6 @@ public class MapAccessor implements PropertyAccessor { map.put(name, newValue); } - public Class[] getSpecificTargetClasses() { - return new Class[] {Map.class}; - } - /** * Exception thrown from {@code read} in order to reset a cached