From 2c85be333c89f2d56f6e8e32563d369a948481f1 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Tue, 15 May 2018 14:58:50 +0200 Subject: [PATCH] Filter synthetic in ReflectionUtils#USER_DECLARED_METHODS Issue: SPR-16823 --- .../main/java/org/springframework/util/ReflectionUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index a4c7fdc2d9..4950a6f57a 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -862,10 +862,10 @@ public abstract class ReflectionUtils { /** - * Pre-built MethodFilter that matches all non-bridge methods + * Pre-built MethodFilter that matches all non-bridge non-synthetic methods * which are not declared on {@code java.lang.Object}. */ public static final MethodFilter USER_DECLARED_METHODS = - (method -> (!method.isBridge() && method.getDeclaringClass() != Object.class)); + (method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class)); }