I’m neutral towards introducing package protected visibility. But I’m strictly against the solution to simply add a new visibility modifier (pkg-private
or sorts). Instead I hope for a structured and uniform way to handle such things in the future. I have written down a proposal.
It can be used in a basic mode where it is extremely simple: There is just private
(and protected
as special case) but at more locations than currently possible. In the advanced mode, it is maximally flexible: Any visibility constellations can be realized. But the different layers/levels in the source code are treated similarly with respect to visibility.