Skip to content

Commit 4751769

Browse files
committed
Polishing
1 parent 1f8e9f5 commit 4751769

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectiveMethodResolver.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ private Set<Method> getMethods(Class<?> type, Object targetObject) {
225225
if (targetObject instanceof Class) {
226226
Set<Method> result = new LinkedHashSet<>();
227227
// Add these so that static methods are invocable on the type: e.g. Float.valueOf(..)
228-
Method[] methods = getMethods(type);
229-
for (Method method : methods) {
228+
for (Method method : getMethods(type)) {
230229
if (Modifier.isStatic(method.getModifiers())) {
231230
result.add(method);
232231
}
@@ -239,8 +238,7 @@ else if (Proxy.isProxyClass(type)) {
239238
Set<Method> result = new LinkedHashSet<>();
240239
// Expose interface methods (not proxy-declared overrides) for proper vararg introspection
241240
for (Class<?> ifc : type.getInterfaces()) {
242-
Method[] methods = getMethods(ifc);
243-
for (Method method : methods) {
241+
for (Method method : getMethods(ifc)) {
244242
if (isCandidateForInvocation(method, type)) {
245243
result.add(method);
246244
}
@@ -250,8 +248,7 @@ else if (Proxy.isProxyClass(type)) {
250248
}
251249
else {
252250
Set<Method> result = new LinkedHashSet<>();
253-
Method[] methods = getMethods(type);
254-
for (Method method : methods) {
251+
for (Method method : getMethods(type)) {
255252
if (isCandidateForInvocation(method, type)) {
256253
result.add(method);
257254
}
@@ -276,7 +273,7 @@ protected Method[] getMethods(Class<?> type) {
276273
* Determine whether the given {@code Method} is a candidate for method resolution
277274
* on an instance of the given target class.
278275
* <p>The default implementation considers any method as a candidate, even for
279-
* static methods sand non-user-declared methods on the {@link Object} base class.
276+
* static methods and non-user-declared methods on the {@link Object} base class.
280277
* @param method the Method to evaluate
281278
* @param targetClass the concrete target class that is being introspected
282279
* @since 4.3.15

0 commit comments

Comments
 (0)