-
Notifications
You must be signed in to change notification settings - Fork 44
Backports from 3de4c3b26c1 - Fixes #105 #106
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
Conversation
* Added `findGetterDescriptionForField(FieldDescription base)` to check against all known prefixes for methods that clash * Extended test case for FieldPropertyClash to include predicate case
|
is that because of line endings ? I use linux, that kind of errors are not easy to detect. |
|
Some are,
|
| this.superType = superType; | ||
| } | ||
|
|
||
| public GetterDescription findGetterDescriptionForField(FieldDescription base) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add unit tests for this in FieldDescriptionTest ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense in ClassDescriptionTest?
Edit: It would, but that class doesn't exist... 😅
| field.getTypeDescription(), | ||
| Collections.<TypeName> emptyList()))) { | ||
|
|
||
| if (classDescription.findGetterDescriptionForField(field) != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename findGetterDescriptionForField to hasGetterForField and simply return a boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the name. For return type, I think it could be useful later to have it returning the value. If we were on Java 8 I'd rather return an Optional<>, though. Thought?s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, I've realized that there is a very real possibility of multiple. So either:
- return a
Set<>ofGetters - Boolean on first found
I'm okay with either.
| return getterDesc; | ||
| } | ||
| } | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the else can be removed and replaced by this one line (assuming we return a boolean):
return fieldMap.containsKey("get" + capName)
|
Sure thing, I'll get to it later today! |
* Addresses comments from @joel-costigliola in assertj#106 * Broke method into two: one for presence, one for getting the values * Added many more tests
Backport of 3de4c3b.
findGetterDescriptionForField(FieldDescription base)to check against all known prefixes for methods that clashFun fact: The current master branch fails on windows, I had to use a vagrant machine to test this. 😢
Fixes #105.