🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@rwinch
Copy link
Contributor

@rwinch rwinch commented Aug 15, 2025

This adds (Ignored) tests for the failures for nullable super invocations described in gh-1246

Thank you for contributing to NullAway!

Please note that once you click "Create Pull Request" you will be asked to sign our Uber Contributor License Agreement via CLA assistant.

Before pressing the "Create Pull Request" button, please provide the following:

  • A description about what and why you are contributing, even if it's trivial.

  • The issue number(s) or PR number(s) in the description if you are contributing in response to those.

  • If applicable, unit tests.

Summary by CodeRabbit

  • Tests
    • Added two unit tests covering nullability interactions in generic type hierarchies, including passing null to a superclass constructor and to a superclass method parameter.
    • Tests are currently disabled pending resolution of a known issue, ensuring future verification once enabled.
    • Improves coverage for nullness behavior with bounded type parameters and annotations, helping validate expected behavior in inheritance scenarios.

Demos that nullable super invocations fail
@CLAassistant
Copy link

CLAassistant commented Aug 15, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds two ignored JSpecify generics nullability tests to GenericsTests.java, covering passing null to a super constructor and a super method via generic types. No production code changes.

Changes

Cohort / File(s) Summary
JSpecify generics tests
nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java
Added two @ignore @test methods: nullableSuperConstructorArg and nullableSuperMethodArg, exercising null passed to super constructor and method in generic type hierarchies (issue 1246).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • msridhar

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java (1)

2367-2387: Make the super call explicit to match the test intent

Given the test name nullableSuperMethodArg and the PR objective (super invocation behavior), consider calling the super implementation explicitly to ensure we’re covering the super method invocation path rather than relying on method resolution through this.

Apply this diff inside the .addSourceLines() snippet:

-            "    void test() {",
-            "      m(null);",
+            "    void test() {",
+            "      super.m(null);",

Optionally, add a negative companion scenario elsewhere (non-blocking) to assert an error for a non-null instantiation, e.g., extend A and invoke super.m(null) with a “BUG: Diagnostic contains …” assertion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ba4ff83 and 91988f3.

📒 Files selected for processing (1)
  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: msridhar
PR: uber/NullAway#1245
File: guava-recent-unit-tests/src/test/java/com/uber/nullaway/guava/NullAwayGuavaParametricNullnessTests.java:101-102
Timestamp: 2025-08-14T18:50:06.094Z
Learning: In NullAway JSpecify tests, when JDK version requirements exist due to bytecode annotation reading capabilities, prefer failing tests over skipping them on unsupported versions to ensure CI catches regressions and enforces proper JDK version usage for developers.
📚 Learning: 2025-08-14T18:50:06.094Z
Learnt from: msridhar
PR: uber/NullAway#1245
File: guava-recent-unit-tests/src/test/java/com/uber/nullaway/guava/NullAwayGuavaParametricNullnessTests.java:101-102
Timestamp: 2025-08-14T18:50:06.094Z
Learning: In NullAway JSpecify tests, when JDK version requirements exist due to bytecode annotation reading capabilities, prefer failing tests over skipping them on unsupported versions to ensure CI catches regressions and enforces proper JDK version usage for developers.

Applied to files:

  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java
🔇 Additional comments (2)
nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java (2)

2345-2365: LGTM: Good coverage for the super-constructor nullability case

Adding an ignored test that exercises passing null to a generic super constructor where T extends @nullable Object is valuable. This should be allowed once the referenced issue is fixed.


2345-2365: Align issue reference: tests reference issue 1246 but PR mentions 1446

Repository search shows only references to issues/1246; there are no occurrences of 1446. Please confirm which issue is intended and update either the @ignore annotation(s) or the PR description to match.

  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericsTests.java — @ignore("#1246") at lines 2345 and 2367

@msridhar msridhar enabled auto-merge (squash) August 15, 2025 23:14
@msridhar msridhar merged commit f59d952 into uber:master Aug 15, 2025
11 checks passed
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.

3 participants