siom79 / japicmp

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

Excluding methods from an included class by annotations #226

Closed Bagge42 closed 5 years ago

Bagge42 commented 5 years ago

I'm currently integrating japicmp into a build process using the Maven plugin. To do so I wanted to use annotations to mark what should be included in the compatibility check. The inclusion works fine, but when I attempted to include a class, but exclude one of the methods in that class it didn't seem to take. Japicmp still included the method that was marked with the exclude annotation.

I noticed you wrote a comment about it in December 2015: https://github.com/siom79/japicmp/issues/88#issuecomment-165054384 Here you mention it should be possible to exclude elements of the included class with another exclude annotation, but that it is to be tested. Did you get around to testing it?

Either way it doesn't seem to be working for me, so I'd like to hear your input on the subject.

siom79 commented 5 years ago

Here is a test case that includes a class and excludes a method on it. From that I would conclude that it works.

Can you provide more details for your case?

Bagge42 commented 5 years ago

Actually I can't, I tried to reproduce it now, but it seems to work for me. I must have done something wrong the other times, sorry for the inconvenience.

The issue seems to be that I wanted to exclude methods marked with the deprecated annotation, how ever marking new methods as deprecated would then be interpreted as removing the method. I can see exclude wasn't intended to be used this way.