checker-framework icon indicating copy to clipboard operation
checker-framework copied to clipboard

Suppresses RLC non-final field overwrite warning for safe constructor field initialization

Open iamsanjaymalakar opened this issue 9 months ago • 5 comments

iamsanjaymalakar avatar Apr 18 '25 10:04 iamsanjaymalakar

@iamsanjaymalakar The typecheck job is not passing.

mernst avatar Apr 18 '25 14:04 mernst

@iamsanjaymalakar Martin asked you to assign me when you had addressed his comments. Have you addressed them?

mernst avatar Jul 10 '25 02:07 mernst

@iamsanjaymalakar Martin asked you to assign me when you had addressed his comments. Have you addressed them?

Yes, I have. You can take a look.

iamsanjaymalakar avatar Jul 14 '25 00:07 iamsanjaymalakar

@iamsanjaymalakar Please take a look at my review comments.

mernst avatar Jul 20 '25 15:07 mernst

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds constructor-first-write suppression to MustCallConsistencyAnalyzer: introduces isFirstWriteToFieldInConstructor, callsThisConstructor, and a private ConstructorFirstWriteScanner TreeScanner; integrates these checks into checkReassignmentToOwningField to bypass certain first-field writes in constructors; extends imports for new Tree and utility APIs. Adds a per-directory test ResourceLeakFirstInitConstructorTest and a new test suite under checker/tests/resourceleak-firstinitconstructor covering constructor chaining, inline/null/instance initializers, conditionals, method-call ordering, visibility variants, final-field, and try/catch/finally scenarios. No exported or public API changes.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] 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

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

coderabbitai[bot] avatar Oct 04 '25 03:10 coderabbitai[bot]