-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix: check changes in return types #397
Conversation
Also the JApiCompatibilityChange could be added to the method not the return type, as the return type has changed. I did not go for this approach off the bat because there are multiple tests that specify this behaviour. This could be done by checking here if the generic return type is different and putting the JApiChangeStatus to MODIFIED. Adjusting accordingly in the check method. I think this is following the section 13.4.15 of the SE7 java spec a little more accurately. |
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.
Thanks for the PR and your work on it. It looks good, I only have one question.
|
||
for (JApiCompatibilityChange change : jApiMethod.getReturnType().getCompatibilityChanges()) { | ||
if (!change.isBinaryCompatible() || !change.isSourceCompatible()) { | ||
if (!change.isBinaryCompatible() && options.isErrorOnBinaryIncompatibility()) { |
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.
Shouldn't this be the same as in the line 218? I mean the exclusion of the method is not checked. And if it is the same as in line 218 then this block could be refactored to a method called with the two sets of JApiCompatibilityChange
.
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.
agreed, good suggestion. Will change and refactor
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.
updated
Thanks again for the PR and your work. |
0.21.2 is on its way to Maven central. |
I noticed that the maven plugin does not break on
METHOD_RETURN_TYPE_GENERICS_CHANGED
.This looked to be because method is not given a JApiCompatibilityChange, but instead the return type of the method is given a JApiCompatibilityChange.
japicmp/japicmp/src/main/java/japicmp/compat/CompatibilityChanges.java
Line 453 in 68727ed
So added a check for the compatibility changes in the return types of methods.