google / google/error-prone

NonApiType: signaling for use of non-API-types on private methods does not make sense

Open
#4,254 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

[NonApiType]() warns for concrete types used as parameter types and return types for (static) private methods. To verify this for private methods does not make sense, given that the class is the unit of abstraction. You cannot ignore the chosen concrete type if it is subsequently used as part of internal state.

Note that you can voluntarily choose to ignore the concrete type if its use is so minimal that the concrete type does not in any way reach an implementation boundary or design limitation. However, given that private methods can only be accessed in the internals of classes, the class itself needs to be sound unit and hiding types would obscure possible problems.

__update__ or parameter-types of private constructors

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.