static record like methods are no longer supported#3251
Merged
Conversation
bbakerman
commented
Jun 25, 2023
| try { | ||
| MethodFinder methodFinder = (rootClass, methodName) -> findPubliclyAccessibleMethod(cacheKey, rootClass, methodName, dfeInUse); | ||
| MethodFinder methodFinder = (rootClass, methodName) -> findPubliclyAccessibleMethod(cacheKey, rootClass, methodName, dfeInUse, false); | ||
| return getPropertyViaGetterMethod(object, propertyName, graphQLType, methodFinder, singleArgumentValue); |
Member
Author
There was a problem hiding this comment.
finds non static ones first
bbakerman
commented
Jun 25, 2023
| // in order to not break things we allow statics to be used. In theory this double code check is not needed | ||
| // because you CANT have a `static getFoo()` and a `getFoo()` in the same class hierarchy but to make the code read clearer | ||
| // I have repeated the lookup. Since we cache methods, this happens only once and does not slow us down | ||
| MethodFinder methodFinder = (rootClass, methodName) -> findPubliclyAccessibleMethod(cacheKey, rootClass, methodName, dfeInUse, true); |
Member
Author
There was a problem hiding this comment.
finds static getters next
bbakerman
commented
Jun 25, 2023
| */ | ||
| private Method findRecordMethod(CacheKey cacheKey, Class<?> rootClass, String methodName) throws NoSuchMethodException { | ||
| return findPubliclyAccessibleMethod(cacheKey, rootClass, methodName, false); | ||
| return findPubliclyAccessibleMethod(cacheKey, rootClass, methodName, false, false); |
Member
Author
There was a problem hiding this comment.
NEVER finds static recordLike() methods now
bbakerman
commented
Jun 25, 2023
| @Override | ||
| String getSomething() { | ||
| return "bar"; | ||
| return "bar" |
Member
Author
There was a problem hiding this comment.
yellow tagged IDEA code cleanup
dondonz
approved these changes
Jun 26, 2023
dondonz
added a commit
that referenced
this pull request
Apr 2, 2024
…-for-special-release Cherry pick PR #3251: Remove static record-like method lookup - for special 20.9 Atlassian release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has some challenges. I will discuss them more on the issue #3247
This PR now changes how
recordLike()methods are looked up. The use ofstatic recordLike()is no longer supported.I had intended to NOT make a breaking change but after canvassing this with some others like the team at Spring GraphQL it was suggested that allowing
static recordLike()access will present more problems in the future than benefits.Since this is only 6 months old the scope of the breaking change is smaller than banning static
getFoomethods say.So the breaking change is this - if you have a
static recordLike()method - it will no longer be called.