Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AbstractNestablePropertyAccessor#setPropertyValue(PropertyTokenHolder, PropertyValue) [SPR-15053] #19619

Closed
spring-issuemaster opened this issue Dec 26, 2016 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Dec 26, 2016

Behrang Saeedzadeh opened SPR-15053 and commented

The org.springframework.beans.AbstractNestablePropertyAccessor#setPropertyValue(org.springframework.beans.AbstractNestablePropertyAccessor.PropertyTokenHolder, org.springframework.beans.PropertyValue) method is very long (193 lines) and has statements that are 5-6 levels deep. For example:

!refactoring.png!

I suggest breaking down this method into smaller methods and reduce the depth of nesting in its code.


Affects: 4.3.5

Attachments:

Referenced from: commits 64d6561, d77ab67

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 26, 2016

Juergen Hoeller commented

I've split the method into three: processKeyedProperty with a getPropertyHoldingValue delegate for key traversal, and processLocalProperty for direct property handling. The largest method has ~90 lines of code now which should be good enough.

Thanks for raising this!

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 26, 2016

Behrang Saeedzadeh commented

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.