@@ -104,17 +104,16 @@ public boolean removeConstructorResolver(ConstructorResolver resolver) {
104
104
return this .constructorResolvers .remove (resolver );
105
105
}
106
106
107
+ public void setConstructorResolvers (List <ConstructorResolver > constructorResolvers ) {
108
+ this .constructorResolvers = constructorResolvers ;
109
+ }
110
+
107
111
@ Override
108
112
public List <ConstructorResolver > getConstructorResolvers () {
109
113
ensureConstructorResolversInitialized ();
110
114
return this .constructorResolvers ;
111
115
}
112
116
113
- public void setConstructorResolvers (List <ConstructorResolver > constructorResolvers ) {
114
- this .constructorResolvers = constructorResolvers ;
115
- }
116
-
117
-
118
117
public void addMethodResolver (MethodResolver resolver ) {
119
118
ensureMethodResolversInitialized ();
120
119
this .methodResolvers .add (this .methodResolvers .size () - 1 , resolver );
@@ -125,6 +124,10 @@ public boolean removeMethodResolver(MethodResolver methodResolver) {
125
124
return this .methodResolvers .remove (methodResolver );
126
125
}
127
126
127
+ public void setMethodResolvers (List <MethodResolver > methodResolvers ) {
128
+ this .methodResolvers = methodResolvers ;
129
+ }
130
+
128
131
@ Override
129
132
public List <MethodResolver > getMethodResolvers () {
130
133
ensureMethodResolversInitialized ();
@@ -140,11 +143,6 @@ public BeanResolver getBeanResolver() {
140
143
return this .beanResolver ;
141
144
}
142
145
143
- public void setMethodResolvers (List <MethodResolver > methodResolvers ) {
144
- this .methodResolvers = methodResolvers ;
145
- }
146
-
147
-
148
146
public void addPropertyAccessor (PropertyAccessor accessor ) {
149
147
ensurePropertyAccessorsInitialized ();
150
148
this .propertyAccessors .add (this .propertyAccessors .size () - 1 , accessor );
@@ -154,17 +152,16 @@ public boolean removePropertyAccessor(PropertyAccessor accessor) {
154
152
return this .propertyAccessors .remove (accessor );
155
153
}
156
154
155
+ public void setPropertyAccessors (List <PropertyAccessor > propertyAccessors ) {
156
+ this .propertyAccessors = propertyAccessors ;
157
+ }
158
+
157
159
@ Override
158
160
public List <PropertyAccessor > getPropertyAccessors () {
159
161
ensurePropertyAccessorsInitialized ();
160
162
return this .propertyAccessors ;
161
163
}
162
164
163
- public void setPropertyAccessors (List <PropertyAccessor > propertyAccessors ) {
164
- this .propertyAccessors = propertyAccessors ;
165
- }
166
-
167
-
168
165
public void setTypeLocator (TypeLocator typeLocator ) {
169
166
Assert .notNull (typeLocator , "TypeLocator must not be null" );
170
167
this .typeLocator = typeLocator ;
@@ -232,10 +229,8 @@ public Object lookupVariable(String name) {
232
229
/**
233
230
* Register a {@code MethodFilter} which will be called during method resolution
234
231
* for the specified type.
235
- *
236
232
* <p>The {@code MethodFilter} may remove methods and/or sort the methods which
237
233
* will then be used by SpEL as the candidates to look through for a match.
238
- *
239
234
* @param type the type for which the filter should be called
240
235
* @param filter a {@code MethodFilter}, or {@code null} to unregister a filter for the type
241
236
* @throws IllegalStateException if the {@link ReflectiveMethodResolver} is not in use
@@ -244,7 +239,8 @@ public void registerMethodFilter(Class<?> type, MethodFilter filter) throws Ille
244
239
ensureMethodResolversInitialized ();
245
240
if (this .reflectiveMethodResolver != null ) {
246
241
this .reflectiveMethodResolver .registerMethodFilter (type , filter );
247
- } else {
242
+ }
243
+ else {
248
244
throw new IllegalStateException ("Method filter cannot be set as the reflective method resolver is not in use" );
249
245
}
250
246
}
@@ -272,7 +268,8 @@ private void ensureMethodResolversInitialized() {
272
268
private synchronized void initializeMethodResolvers () {
273
269
if (this .methodResolvers == null ) {
274
270
List <MethodResolver > defaultResolvers = new ArrayList <MethodResolver >();
275
- defaultResolvers .add (this .reflectiveMethodResolver = new ReflectiveMethodResolver ());
271
+ this .reflectiveMethodResolver = new ReflectiveMethodResolver ();
272
+ defaultResolvers .add (this .reflectiveMethodResolver );
276
273
this .methodResolvers = defaultResolvers ;
277
274
}
278
275
}
0 commit comments