Public interfaces leaks private classes
zgh-public opened this issue · 2 comments
General explanation.
There are packages that are exported using module-info. There are classes and interfaces in these packages. These classes and interfaces are considered as API so clients will use them. There are a lot of methods in API that returns instances of private, not API classes or takes them as parameters. This situation prevents clients from using such API methods in a modular environment.
For instance:
Package org.jfree.chart.plot is exported because it contains API.
So public class org.jfree.chart.plot.SpiderWebPlot is an API.
public method org.jfree.chart.plot.SpiderWebPlot#getLabelGenerator returns org.jfree.chart.labels.CategoryItemLabelGenerator
But org.jfree.chart.labels is not considered as an API in module-info.
I'll correct that. Is there a tool that reports these inconsistencies?
Committed the fix.