Skip to content

Improve documentation by link getUpstreamCheckerNames and getSuppressWarningsPrefixes#1016

Open
aosen-xiong wants to merge 5 commits into
eisop:masterfrom
aosen-xiong:eisop-issue-1011
Open

Improve documentation by link getUpstreamCheckerNames and getSuppressWarningsPrefixes#1016
aosen-xiong wants to merge 5 commits into
eisop:masterfrom
aosen-xiong:eisop-issue-1011

Conversation

@aosen-xiong

Copy link
Copy Markdown
Collaborator

Fixes #1011

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point of #1011 was to improve the documentation of these methods in BaseTypeChecker. That documentation should make clear that these two methods likely want similar behavior.
The improvement here might be good, but please also look at BaseTypeChecker (and also check whether these methods are overridden elsewhere).

@wmdietl wmdietl assigned aosen-xiong and unassigned wmdietl Dec 20, 2024
@aosen-xiong

Copy link
Copy Markdown
Collaborator Author

Thanks! Since those two methods are in sourcechecker, I noticed there are five overrides for getSuppressWarningsPrefixes in FenumChecker, InitializationChecker, NullnessNonInitSubChecker, SubtypingChecker and UnitsChecker. While
getUpstreamCheckerNames only have two overrides in InitializationChecker and InitializationFieldAccessChecker.

Copilot AI review requested due to automatic review settings May 26, 2026 04:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Javadoc in InitializationChecker to better explain how upstream checkers and @SuppressWarnings prefixes are coordinated for AnnotatedFor support.

Changes:

  • Expanded getUpstreamCheckerNames() Javadoc to reference getSuppressWarningsPrefixes() and add an explicit @return description.
  • Added new Javadoc for getSuppressWarningsPrefixes() describing the "initialization" suppression prefix and noting its relationship to upstream checkers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aosen-xiong aosen-xiong requested a review from wmdietl May 26, 2026 17:07
@aosen-xiong aosen-xiong assigned wmdietl and unassigned aosen-xiong May 26, 2026
@wmdietl

wmdietl commented May 28, 2026

Copy link
Copy Markdown
Member

Thanks! Since those two methods are in sourcechecker, I noticed there are five overrides for getSuppressWarningsPrefixes in FenumChecker, InitializationChecker, NullnessNonInitSubChecker, SubtypingChecker and UnitsChecker. While getUpstreamCheckerNames only have two overrides in InitializationChecker and InitializationFieldAccessChecker.

Should there be further overrides then?

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

* Returns a list containing this checker name and all checkers it is a part of (that is,
* checkers that called it).
*
* <p>This list determines which {@code @AnnotatedFor} annotations are recognized as covering

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the only use case or is that just an example?

* <p>Note: {@link #getSuppressWarningsPrefixes()} and {@link #getUpstreamCheckerNames()} are a
* related pair and should be kept in sync. If you override this method to add an additional
* prefix (for example, the prefix of an abstract parent class that this checker extends), you
* should also override {@link #getUpstreamCheckerNames()} to add the corresponding checker

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nicer if we did that for the user? At the moment we only determine one standard prefix. Couldn't we just use all the upstream checker names directly?

@wmdietl wmdietl assigned aosen-xiong and unassigned wmdietl May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the documentation for getSuppressWarningsPrefixes and getUpstreamCheckerNames

3 participants