Skip to content

Update Pointcuts to match getter methods by also excluding void return type #30068

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

Closed
wants to merge 2 commits into from

Conversation

enimiste
Copy link
Contributor

@enimiste enimiste commented Mar 5, 2023

A getter method should always have a return type other than void.

A getter method should always have a return type different from Void
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 5, 2023
@rstoyanchev rstoyanchev added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Mar 6, 2023
@rstoyanchev
Copy link
Contributor

Thanks for the suggestion. Do you come across an actual method that begins with "get" and returns void?

@rstoyanchev rstoyanchev changed the title Add non void return type check to GetterPointcut Update Pointcuts to match getter methods by also excluding void as return type Mar 6, 2023
@enimiste
Copy link
Contributor Author

enimiste commented Mar 6, 2023

Hi, @rstoyanchev
No, but as there non garanties from the compiler that no one can type a getter method with void return, i think the framework should filter out this case.

A getter with a return type different from void and without any arguments is juste a convention from JavaBean and not a compilation error.

Thanks,

@vishalsingh2972
Copy link

@enimiste @rstoyanchev is this issue still open?

@snicoll
Copy link
Member

snicoll commented Sep 8, 2023

Given how strict the setter match implementation is, I think this is a good change that improves the consistency.

@sbrannen sbrannen self-assigned this Sep 8, 2023
@sbrannen sbrannen removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 8, 2023
@sbrannen sbrannen changed the title Update Pointcuts to match getter methods by also excluding void as return type Update Pointcuts to match getter methods by also excluding void as return type Sep 8, 2023
@sbrannen sbrannen changed the title Update Pointcuts to match getter methods by also excluding void as return type Update Pointcuts to match getter methods by also excluding void return type Sep 8, 2023
@sbrannen sbrannen added this to the 6.1.0-RC1 milestone Sep 8, 2023
snicoll pushed a commit that referenced this pull request Sep 8, 2023
snicoll added a commit that referenced this pull request Sep 8, 2023
@snicoll snicoll closed this in 91f65e6 Sep 8, 2023
@snicoll snicoll assigned snicoll and unassigned sbrannen Sep 8, 2023
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: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants