Repository navigation
[java] New rule: InternalApiUsage - #6994
Conversation
fc48cdf to
7a029b2
Compare
|
Compared to main: (comment created at 2026-09-24 09:07:55+00:00 for d30214e) |
86a78d6 to
234fa23
Compare
234fa23 to
d91f26a
Compare
d91f26a to
5043b02
Compare
5043b02 to
95bff4c
Compare
adangel
left a comment
There was a problem hiding this comment.
Thanks!
The only question I have is: Should we support fields now? IMHO, we could also deliver this in a later release and have this rule in 7.28.0. If we defer this, then we should update the examples on #6889.
The regression tester finds some cases in checkstyle, where a class (not a test class, a helper class) in test-sources access a @VisibleForTesting only constructor. This is ok in general, but in this case, the constructor is in the same source unit - so we could apply the same rule for internal (can be accessed if it is in the same unit).
Co-authored-by: Andreas Dangel <[email protected]>
720703f to
400d77c
Compare
|
Thanks for the feedback, I hope the last commit handles all of it. There's always more to do: if an internal class is used in any way ( |
400d77c to
5d56904
Compare
5d56904 to
9d74e12
Compare
adangel
left a comment
There was a problem hiding this comment.
Thanks!
I'll update the release notes and merge it afterwards.
Describe the PR
Adds a rule that detects usages of internal APIs, currently checking for
@VisibleForTesting,@TestOnly, JetBrains@ApiStatusand Apigurdian's@API.Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)