-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Overview
After fixing the bugs related to #36019, I noticed that PropertyDescriptorUtils still does not reliably resolve the correct write method if an overloaded candidate write method has a parameter type that is a subtype of another candidate write method whose parameter is an exact match for the resolved read method's return type. Whereas, we should always select an exact match for the write method whenever possible.
Although we consider this a bug, we currently only plan to fix this in 7.0.x, thereby foregoing a backport to 6.2.x that could result in regressions in the 6.2.x line which we would like to avoid.
Example
Lines 386 to 399 in 992ae2e
| @Test | |
| void resolvePropertiesWithUnresolvedGenericsInSubclassWithOverloadedSetter() { | |
| var pdMap = resolver.resolve(PersonWithOverloadedSetter.class); | |
| Class<?> writeType = Number.class; | |
| if (resolver instanceof BasicPropertiesResolver) { | |
| // TODO: PropertyDescriptorUtils currently incorrectly resolves setId(Integer) | |
| // as the write method instead of setId(Number) (where Number is the | |
| // unresolved generic for Long). | |
| writeType = Integer.class; | |
| } | |
| assertReadAndWriteMethodsForClassAndId(pdMap, Number.class, writeType); | |
| } |
Related Issues
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug