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

Use lowercase property names in SpEL examples #25538

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Aug 6, 2020

According to java code conventions

According to java code conventions
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 6, 2020
@sbrannen
Copy link
Member

sbrannen commented Aug 6, 2020

For the record, the proposed changes are to SpEL "property names", not variable names.

As stated in the same chapter:

Case insensitivity is allowed for the first letter of property names.

Thus, person.name, person.Name, Person.Name, and person.getName() are all equivalent with regard to property access in SpEL.

It's ultimately a matter of taste. Some people prefer to follow Java conventions. Others prefer capitalized property names in expressions for improved readability.

In any case, I do think it would be beneficial to focus on Java coding conventions in the examples, with a NOTE pointing out more explicitly what I've stated above.

In light of that, I'll probably merge this PR as-is and add such a note.

@sbrannen sbrannen changed the title Insist on using lowercase variable names Use lowercase property names in SpEL examples Aug 6, 2020
@sbrannen sbrannen self-assigned this Aug 6, 2020
@sbrannen sbrannen added type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 6, 2020
@sbrannen sbrannen added this to the 5.3 RC1 milestone Aug 6, 2020
@jhoeller jhoeller modified the milestones: 5.3 RC1, 5.3 RC2 Aug 24, 2020
@sbrannen sbrannen modified the milestones: 5.3 RC2, 5.3 GA Sep 22, 2020
@sbrannen sbrannen closed this in 9c11887 Oct 27, 2020
@sbrannen
Copy link
Member

This has been merged into master in 9c11887 and revised in b01adad.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants