Skip to content

Commit

Permalink
Ignore bridge methods on method handling
Browse files Browse the repository at this point in the history
  • Loading branch information
finesoft committed Jan 27, 2024
1 parent 215e127 commit 2c3f319
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public PropertyInjector(boolean nameUpperCase, Object instance) {
this.nameUpperCase = nameUpperCase;
Map<String, Method> setters = new HashMap<>();
for (Method method : instanceClass.getMethods()) {
if (method.isBridge()) {
// TODO consider the bridge method "change" visibility of base class's methods ??
continue;
}
String name = method.getName();
if (method.getParameterCount() == 1 && name.startsWith("set")) {
setters.put(name.substring(3), method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public ProxyInvocationHandler(final Class<?> clazz,
this.clazz = shouldNotNull(clazz);
Map<Method, MethodInvoker> methodInvokers = new HashMap<>();
for (Method method : clazz.getMethods()) {
if (method.isDefault() || Modifier.isStatic(method.getModifiers())) {
if (method.isDefault() || method.isBridge() || Modifier.isStatic(method.getModifiers())) {
// TODO consider the bridge method "change" visibility of base class's methods ??
continue;
}
methodInvokers.put(method, invokerBuilder.apply(method));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public static Map<Method, List<InterceptorInvocation>> getInterceptorChains(
getInterceptorBindings(beanType.getAnnotations(), beanManager);

for (Method method : beanType.getMethods()) {
if ( /* method.isDefault() || */ Modifier.isStatic(method.getModifiers())) {
if ( /* method.isDefault() || */method.isBridge()
|| Modifier.isStatic(method.getModifiers())) {
// TODO consider the bridge method "change" visibility of base class's methods ??
continue;
}
List<Annotation> methodLevelBindings =
Expand Down

0 comments on commit 2c3f319

Please sign in to comment.