siom79 / japicmp

Comparison of two versions of a jar archive
https://siom79.github.io/japicmp
Apache License 2.0
694 stars 107 forks source link

Optionally take changes to annotations into account #392

Closed guillermocalvo closed 3 months ago

guillermocalvo commented 4 months ago

Resolves:

Related pull request:

This is an alternative approach, in which changes to annotations will be ignored if option --no-annotations is set.

siom79 commented 3 months ago

This PR looks good. But I don't see any integration into the maven plugin nor into the reporting (HTML, stdout, etc.). Are you planning to add this in the future or do you expect me to do this? Anyhow, thanks for the PR.

guillermocalvo commented 3 months ago

This PR looks good. But I don't see any integration into the maven plugin nor into the reporting (HTML, stdout, etc.). Are you planning to add this in the future or do you expect me to do this? Anyhow, thanks for the PR.

Thanks for reviewing my PR. I used an existing configuration option that is already documented and integrated into the CLI as --no-annotations, as well as into the maven plugin as noAnnotations. This PR introduces three new JApiCompatibilityChangeType values that can be added to affected elements when annotations are added, removed or changed. I believe they should be reported as they are, along with the rest of the compatibility changes, both in HTML and stdout. However, I'm more than happy to implement any integrations I may have overlooked. Could you please elaborate on what exactly needs to be done?

siom79 commented 3 months ago

Thanks again for the PR. I have added another compatibility change: ANNOTATION_MODIFIED and reworked the code in CompatibilityChanges.java slightly.

During the work I also realized that the implementation of HtmlOutputGenerator did output the wrong value for fields of annotations. This must have been in there for longer, but is fixed now.