siom79 / japicmp

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

Constructor `protected` -> `private` in `final` class detected as `CONSTRUCTOR_LESS_ACCESSIBLE` #310

Closed scordio closed 2 years ago

scordio commented 2 years ago

In a final class, a visibility change of a constructor from protected to private is detected as CONSTRUCTOR_LESS_ACCESSIBLE:

Comparing binary compatibility of assertj-core-3.22.1-SNAPSHOT.jar against assertj-core-3.22.0.jar
***! MODIFIED CLASS: PUBLIC FINAL org.assertj.core.api.Fail  (not serializable)
    ===  CLASS FILE FORMAT VERSION: 52.0 <- 52.0
    ***! MODIFIED CONSTRUCTOR: PRIVATE (<- PROTECTED) Fail()

Screenshot 2022-01-14 at 15 07 06

Although it's a proper detection considering only the constructor visibility, I am wondering if this could be correlated with the fact that the class is final and there is no way it can be extended, so it shouldn't be an incompatible change.

siom79 commented 2 years ago

Fixed: 0.15.5