Skip to content

Small cleanups#7725

Merged
mernst merged 1 commit into
typetools:masterfrom
mernst:7049-dev-pre
May 17, 2026
Merged

Small cleanups#7725
mernst merged 1 commit into
typetools:masterfrom
mernst:7049-dev-pre

Conversation

@mernst
Copy link
Copy Markdown
Member

@mernst mernst commented May 17, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

MustCallConsistencyAnalyzer adds support for nullness checking in obligation tracking. The @NonNull annotation is imported and applied to return expressions in updateObligationsForOwningReturn, which now performs temp-variable substitution and uses pattern matching to identify LocalVariableNode instances before removing obligations. Separately, checkReassignmentToOwningField adds nullness dereference suppression and renames its receiver type-element variable for constructor-specific reassignment handling.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@checker/src/main/java/org/checkerframework/checker/resourceleak/MustCallConsistencyAnalyzer.java`:
- Around line 1054-1063: The method updateObligationsForOwningReturn currently
assumes ReturnNode#getResult() is non-null and suppresses nullness, which can
cause an NPE for bare returns; update this by fetching the result via
ReturnNode#getResult(), check for null and return early (or skip processing) if
it is null, then call getTempVarOrNode(returnExpr) and proceed with existing
logic (removing obligations via removeObligationsContainingVar) only when
returnExpr is non-null; reference ReturnNode#getResult, getTempVarOrNode,
updateObligationsForOwningReturn (and mirror the null-check approach used in
LiveVarTransfer/BusyExprTransfer).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 946f2323-11eb-4ce2-a5cf-174cc3a1f74c

📥 Commits

Reviewing files that changed from the base of the PR and between 0be8d5a and 372c084.

📒 Files selected for processing (1)
  • checker/src/main/java/org/checkerframework/checker/resourceleak/MustCallConsistencyAnalyzer.java

@mernst mernst merged commit 16369c7 into typetools:master May 17, 2026
35 checks passed
@mernst mernst deleted the 7049-dev-pre branch May 17, 2026 19:23
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.

1 participant