Skip to content

Commit b70148c

Browse files
committed
Consistent PropertyAccessor method order as declared in the interface
Issue: SPR-11609
1 parent 3af8a32 commit b70148c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,11 @@
3232
*/
3333
public class BeanFactoryAccessor implements PropertyAccessor {
3434

35+
@Override
36+
public Class<?>[] getSpecificTargetClasses() {
37+
return new Class<?>[] {BeanFactory.class};
38+
}
39+
3540
@Override
3641
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
3742
return (((BeanFactory) target).containsBean(name));
@@ -52,9 +57,4 @@ public void write(EvaluationContext context, Object target, String name, Object
5257
throw new AccessException("Beans in a BeanFactory are read-only");
5358
}
5459

55-
@Override
56-
public Class<?>[] getSpecificTargetClasses() {
57-
return new Class<?>[] {BeanFactory.class};
58-
}
59-
6060
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,11 @@
3333
*/
3434
public class MapAccessor implements PropertyAccessor {
3535

36+
@Override
37+
public Class<?>[] getSpecificTargetClasses() {
38+
return new Class<?>[] {Map.class};
39+
}
40+
3641
@Override
3742
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
3843
Map<?, ?> map = (Map<?, ?>) target;
@@ -61,11 +66,6 @@ public void write(EvaluationContext context, Object target, String name, Object
6166
map.put(name, newValue);
6267
}
6368

64-
@Override
65-
public Class<?>[] getSpecificTargetClasses() {
66-
return new Class<?>[] {Map.class};
67-
}
68-
6969

7070
/**
7171
* Exception thrown from {@code read} in order to reset a cached

0 commit comments

Comments
 (0)