alien-tools / maracas

Maracas is a source code and bytecode analysis framework⁠—written in Java with the help of Spoon—which analyzes how Java libraries evolve and how their evolution impacts their clients.
https://alien-tools.github.io/maracas/
MIT License
13 stars 2 forks source link

No broken use when overriding more accessible method #43

Closed lmove closed 2 years ago

lmove commented 2 years ago

Maracas does not report broken uses when overriding methods that turned to be more accessible.

Related compiler messages:

Path: path-to/maracas/test-data/comp-changes/client/src/main/methodMoreAccessible/MethodMoreAccessibleExt.java
Line: 11
Message: pkgProtected2public() in main.methodMoreAccessible.MethodMoreAccessibleExt cannot override pkgProtected2public() in main.methodMoreAccessible.MethodMoreAccessible

Path: path-to/maracas/test-data/comp-changes/client/src/main/methodMoreAccessible/MethodMoreAccessibleExt.java
Line: 16
Message: pkgProtected2protected() in main.methodMoreAccessible.MethodMoreAccessibleExt cannot override pkgProtected2protected() in main.methodMoreAccessible.MethodMoreAccessible

Path: path-to/maracas/test-data/comp-changes/client/src/mainclient/methodMoreAccessible/MethodMoreAccessibleExt.java
Line: 8
Message: protected2public() in mainclient.methodMoreAccessible.MethodMoreAccessibleExt cannot override protected2public() in main.methodMoreAccessible.MethodMoreAccessible

Path: path-to/maracas/test-data/comp-changes/client/src/main/methodMoreAccessible/MethodMoreAccessibleExt.java
Line: 6
Message: protected2public() in main.methodMoreAccessible.MethodMoreAccessibleExt cannot override protected2public() in main.methodMoreAccessible.MethodMoreAccessible
tdegueul commented 2 years ago

I believe this is japicmp's lmitation. It does only report visibility problems when the visibility goes down, not up (though this is indeed a problem when overriding).

lmove commented 2 years ago

You are totally right. This breaking change is not part of JApiCmp implementation, however, we do consider the cases in the comp-changes project. I will exclude this case from our accuracy validation.