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

Detect incompatible `module-info.class` changes #401

Open Marcono1234 opened 1 month ago

Marcono1234 commented 1 month ago

It might be useful if the module-info.class file was checked as well, it seems that is currently not the case. If no /module-info.class file exists, it would be good to also check at /META-INF/versions/.../module-info.class. Many libraries use that approach to still target Java 8, but include a module-info.class when users use a newer Java version.

Some incompatible changes which come into my mind:

Not sure if all of these are really major incompatibilities, or incompatibilities at all.

[^1]: Technically changes to the modules listed as to <module>, e.g. to mod_a, mod_bto mod_c, could also cause incompatibilities. But that would only affect those modules (since other modules neither had access before nor after), so in most cases such a change would probably not matter much, especially since the listed modules are likely modules from the same organization.