Skip to content

JSpecify: properly handle lambdas in anonymous inner classes#1165

Merged
msridhar merged 7 commits intomasterfrom
issue-1156
Mar 17, 2025
Merged

JSpecify: properly handle lambdas in anonymous inner classes#1165
msridhar merged 7 commits intomasterfrom
issue-1156

Conversation

@msridhar
Copy link
Copy Markdown
Collaborator

@msridhar msridhar commented Mar 15, 2025

Fixes #1156

When checking correctness of lambda overrides we get the type from javac's inferred type rather than using the enclosing class. Also, when getting the type of an anonymous class we add some extra assertions to ensure we find the right NewClassTree representing the anonymous class. I think we'll always get the right tree now, but the asserts give peace of mind.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.17%. Comparing base (8786e88) to head (ec227a4).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ava/com/uber/nullaway/generics/GenericsChecks.java 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1165   +/-   ##
=========================================
  Coverage     88.17%   88.17%           
- Complexity     2303     2305    +2     
=========================================
  Files            88       88           
  Lines          7533     7536    +3     
  Branches       1505     1506    +1     
=========================================
+ Hits           6642     6645    +3     
  Misses          448      448           
  Partials        443      443           

☔ 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 0161a80 into master Mar 17, 2025
@msridhar msridhar deleted the issue-1156 branch March 17, 2025 17:03
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.

NullAway crashes when encountering a lambda that takes an argument nested in an anonymous inner class

2 participants