ASSERT-KTH/depclean

[BUG] module-info

imjhonny opened this issue · 2 comments

Describe the bug
Dependencies with module-info appear as bloated, but it is indeed used.

To Reproduce
For example in Spork's visualization the direct dependency junit-jupiter appears as bloated. See also Spoon's visualization

Expected behavior
Dependencies with module-info should appear as used.

Hello @imjhonny
This does not seem to be a bug for me, in fact, the author uses a filter so that depClean didn't analyze classes like module-info, package-info, etc.
See here in the code.
The logic behind this filter may be that since these types of classes only contain the general information of module, package, or project which I think rarely required a dependency or an artifact.
So, it will be better to ignore these classes(which may save time).

But if still, this seems to be a bug then it can be easily fixed (just remove the filter).
@cesarsotovalero needs your opinion here.

Thank you
Abhay

Hi @imjhonny,

The viewpoint of @ABHAY0O7 is correct.

The dependency junit-jypiter is an aggregator of other JUnit dependencies. Aggregators are used to simplify the addition of many dependencies at once. In the case of this particular dependency, it contains a single module-info.class file, see also here.

Therefore, I think it is correct for DepClean to report this type of dependencies as unused, and focus the analysis on the dependencies that actually contain executable bytecode, i.e., the sub-modules of junit-jypiter.