Skip to content

Consider bridge methods in SpEL properties [SPR-10162] #14795

Closed
@spring-projects-issues

Description

@spring-projects-issues

Marian Gallo opened SPR-10162 and commented

I have found a problem with evaluating of object property values used within SpEL expressions in version 3.2. Expressions were working in older versions (have tried 3.0.6, 3.1.3).

I made an analysis and have found a reason. There was done a change in a class org.springframework.expression.spel.support.ReflectivePropertyAccessor in version 3.2. There was added a subcondition !method.isBridge() in method findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) which hides desired class getter for a property which shall be used in an expression during evaluation.

I checked that the problematic getter is a bridge method. A class which I would like to access via a property has a deep inheritance tree - but there is no class design irregularity.

Is there a reason why this behaviour was changed?

It is a blocking issue for us to migrate to Spring 3.2.


Affects: 3.2 GA

Issue Links:

Referenced from: commits 5ae706e, fce7adc

Backported to: 3.1.4

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions