Moving some class from internal to public API
We use some class from the internal API for code analyzation,
- org.jacoco.core.internal.analysis.BundleCoverageImpl
- org.jacoco.core.internal.analysis.SourceFileCoverageImpl
Is it possible to move org.jacoco.core.internal.analysis to the public API?
Seems to be an https://github.com/jacoco/jacoco issue.
Anyhow: Both types are supposed to be instantiated internally by the BundleBuilder and Analyzer respectively only. Can you please elaborate about your use case why instances should be created by API users?
The base use case is using a custom Coverage Builder, which ignores duplicate class file names even if their are different.
Any thoughts regarding our request?
The class SourceFileCoverageImpl extends SourceNodeImpl. Not sure whether this needs to be exposed too for a consistent type hierarchy. But SourceNodeImpl again exposes internal classes on its APIs.
Maybe an alternative aproach would be to provide public factory methods.
Another option would be to implement a method
protected IClassFileCoverage merge(IClassFileCoverage c1, IClassFileCoverage c2);
in CoverageBuilder which throws an exception by default. So you can implement your own behavior.
What would be the merge strategy you're thinking of? Maybe we can adopt this for JaCoCo.
Public factory methods could work with BundleCoverageImpl and SourceFileCoverageImpl. The second approach in our case is not the best, cause we use a custom CoverageBuilder, which is able to manage multiple package matching.