Skip to content

Constructor sets the source incorrectly in org.springframework.beans.PropertyValue [SPR-8337] #12985

@spring-projects-issues

Description

@spring-projects-issues

Sandu Turcan opened SPR-8337 and commented

I'm using my own document loader to preserve the line numbers but source information is not available in PropertyValue instances.
I tracked down the problem to PropertyValue code.
PropertyValue defines a field named 'source' and uses it instead of the one inherited from BeanMetadataAttributeAccessor.
As a result when the beandefinition is merged and PropertyValues are cloned the source is lost.
Line 84 in PropertyValue.java:

this.source = original.getSource();

should be

this.setSource(original.getSource());

or the same as line 104, which is:

this.source = original;

I'm not sure which one is right, I'd prefer the first one.


Issue Links:

Backported to: 4.2.8, 3.2.18

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions