Currently on master, all of the nspmd.util package was marked internal (#2060), and we have a few utility classes in nspmd.internal.util. Some of those are used in other pmd modules (IteratorUtil, StringUtil, CollectionUtil).
I think we should be strict about usage of internal API, ie, even modules in the main repo should not have access to pmd core's internal API.
I think we should have public utilities in nspmd.util, and a nspmd.util.internal for utils that are only relevant to pmd core (eg, IOUtil).
Public ones include at least:
- IteratorUtil (should be moved from
nspmd.internal.util)
- CollectionUtil
- StringUtil
- AssertionUtil
- GraphUtil (used in pmd-java)
Plus stuff like OptionalBool and DataMap. Publishing IteratorUtil also allows us to remove DesignerIteratorUtil from the designer codebase (it was intentionally copied to not depend on pmd-core's internals).
Other things should be internal (esp. FileUtil and IOUtil, which are only relevant to pmd-core).
We can also use the InternalApiUsage rule to verify that there is no internal api leak across our codebase.
Refs #995
Currently on master, all of the
nspmd.utilpackage was marked internal (#2060), and we have a few utility classes innspmd.internal.util. Some of those are used in other pmd modules (IteratorUtil, StringUtil, CollectionUtil).I think we should be strict about usage of internal API, ie, even modules in the main repo should not have access to pmd core's internal API.
I think we should have public utilities in
nspmd.util, and anspmd.util.internalfor utils that are only relevant to pmd core (eg, IOUtil).Public ones include at least:
nspmd.internal.util)Plus stuff like OptionalBool and DataMap. Publishing IteratorUtil also allows us to remove DesignerIteratorUtil from the designer codebase (it was intentionally copied to not depend on pmd-core's internals).
Other things should be internal (esp. FileUtil and IOUtil, which are only relevant to pmd-core).
We can also use the InternalApiUsage rule to verify that there is no internal api leak across our codebase.
Refs #995