Skip to content

Minor cleanup, no behavior changes#1487

Merged
msridhar merged 2 commits intouber:masterfrom
armandino:cleanup
Mar 7, 2026
Merged

Minor cleanup, no behavior changes#1487
msridhar merged 2 commits intouber:masterfrom
armandino:cleanup

Conversation

@armandino
Copy link
Copy Markdown
Contributor

@armandino armandino commented Mar 1, 2026

Cleanup a few things I noticed while browsing the source. No logic changes.

Summary by CodeRabbit

  • Refactor

    • Simplified conditional logic and reduced nesting across core modules for clearer, more maintainable control flow.
    • Modernized type handling using newer language constructs to eliminate redundant casts while preserving existing behavior.
    • Consolidated checks to streamline processing paths; no public APIs were changed.
  • Style

    • Minor null-safety and generic-initialization cleanups to improve robustness and readability.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 1, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 62210a14-b168-4a93-a0de-b1c5408812c4

📥 Commits

Reviewing files that changed from the base of the PR and between aefa24c and 1f9db5b.

📒 Files selected for processing (1)
  • nullaway/src/main/java/com/uber/nullaway/NullAway.java

Walkthrough

This PR applies localized syntactic refactors across multiple files: consolidating nested conditionals (NullAway.java, AbstractFieldContractHandler.java), converting instanceof + cast patterns to Java pattern-matching (DataFlow, AccessPath, ContractCheckHandler, EnsuresNonNullIfHandler, TypeSubstitutionUtils), using the diamond operator (EnsuresNonNullHandler), and replacing an explicit null comparison with Objects.nonNull in ErrorBuilder. Control flow and public APIs are unchanged.

Possibly related PRs

Suggested reviewers

  • yuxincs
  • lazaroclapp
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: consolidating logic into streamlined conditionals, modernizing Java code with pattern matching and the diamond operator, and refactoring null checks—all without behavior modifications.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

Thanks for these changes!

@msridhar msridhar enabled auto-merge (squash) March 7, 2026 23:02
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.43%. Comparing base (5593abf) to head (1f9db5b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...away/src/main/java/com/uber/nullaway/NullAway.java 85.71% 0 Missing and 1 partial ⚠️
...ullaway/handlers/AbstractFieldContractHandler.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1487      +/-   ##
============================================
- Coverage     88.44%   88.43%   -0.01%     
+ Complexity     2792     2790       -2     
============================================
  Files            99       99              
  Lines          9291     9279      -12     
  Branches       1877     1872       -5     
============================================
- Hits           8217     8206      -11     
  Misses          524      524              
+ Partials        550      549       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@msridhar msridhar merged commit c85b66e into uber:master Mar 7, 2026
12 checks passed
@armandino armandino deleted the cleanup branch March 8, 2026 00:44
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