Skip to content

Test PR for @AnnotatedFor and @SuppressWarnings interaction#25

Closed
aosen-xiong wants to merge 3 commits into
masterfrom
fix-annotatedfor-warning
Closed

Test PR for @AnnotatedFor and @SuppressWarnings interaction#25
aosen-xiong wants to merge 3 commits into
masterfrom
fix-annotatedfor-warning

Conversation

@aosen-xiong

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 4, 2026 23:17

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

Adds regression tests to ensure @SuppressWarnings on an enclosing class suppresses diagnostics even when an individual method is explicitly opted into a checker via @AnnotatedFor.

Changes:

  • Add a Subtyping Checker regression test where class-level @SuppressWarnings("subtyping") suppresses a method-level @AnnotatedFor("subtyping") diagnostic.
  • Add a Nullness Checker regression test where class-level @SuppressWarnings("nullness") suppresses a method-level @AnnotatedFor("nullness") diagnostic.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
framework/tests/conservative-defaults/annotatedfor/AnnotatedForTest.java Adds a subtyping scenario where a class-level suppression should override a method-level @AnnotatedFor.
checker/tests/nulless-conservative-defaults/annotatedfornullness/AnnotatedForNullness.java Adds a nullness scenario where a class-level suppression should override a method-level @AnnotatedFor.

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

@aosen-xiong

Copy link
Copy Markdown
Owner Author

Error reproduced.

AnnotatedForNullnessTest > run[/home/runner/work/checker-framework/checker-framework/checker/tests/nulless-conservative-defaults/annotatedfornullness] STANDARD_OUT
    To see the javac command line and output, run with: -Pemit.test.debug
AnnotatedForNullnessTest > run[/home/runner/work/checker-framework/checker-framework/checker/tests/nulless-conservative-defaults/annotatedfornullness] FAILED
    java.lang.AssertionError: 5 out of 5 expected diagnostics were found.
    1 unexpected diagnostic was found:
      AnnotatedForNullness.java:81: error: (return.type.incompatible)
    While type-checking 1 files.

@aosen-xiong

Copy link
Copy Markdown
Owner Author

Closed as opened eisop#1699.

@aosen-xiong aosen-xiong closed this May 5, 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.

2 participants