Skip to content

Conversation

@JanKanis
Copy link
Contributor

Apply fix from #10414 to 3.2.x

Fixes #10403 / #10428

Make ClassPropertyFetcher also recognize properties of the form "xAge" that have the second letter capitalized.

Fixes apache#10403
GrailsClassUtils.getPropertyForGetter/Setter would previously return property names for some method names that were not valid
getters or setters, although the documentation says they return null in those cases. This change improves the detection
and makes sure only valid getters/setters result in a property name.

This commit includes updates in the documentation of related methods to more clearly indicate what is accepted and what not,
and what assumptions are made.

This also includes a bunch of new test cases.
Re-use GrailsNameUtils.getPropertyForGetter from ClassPropertyFetcher instead of having
separate (and wrong) logic.

This commit has a small behavioral change in that the old code would register both
"Property" and "property" for a static property with a getter "getProperty" in
ClassPropertyFetcher. With improved property name derivation that should not be
necessary anymore.
@JanKanis JanKanis changed the title 3.2.x 3.2.x version of pr #10414 Jan 25, 2017
@jameskleeh
Copy link
Contributor

Closing as the merge from 3.1.x to 3.2.x will do the same thing

@jameskleeh jameskleeh closed this Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants