Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JarInfer parameter indexes for instance methods #1071

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

msridhar
Copy link
Collaborator

@msridhar msridhar commented Nov 11, 2024

Previously, when JarInfer wrote an astubx file, it treated the receiver parameter of an instance method as being at parameter index 0. In other places we do library modeling, the receiver parameter is ignored and the next parameter is treated as being at index 0. The latter handling is more sensible for NullAway, as we have not needed to do any kind of library modeling of receiver parameters yet.

This PR switches the JarInfer logic to ignore the receiver parameter like in other places. This breaks pre-existing astubx files, so we disable an integration test for now. We will bump the astubx version and fix up existing files in a later PR as part of an overall fix to #1072 (fixing in multiple PRs to ease reviewing).

@msridhar msridhar marked this pull request as ready for review November 11, 2024 22:57
@msridhar msridhar changed the title [WIP] Fix JarInfer parameter indexes for instance methods Fix JarInfer parameter indexes for instance methods Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.87%. Comparing base (0a5fa0f) to head (e0ef4c7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1071   +/-   ##
=========================================
  Coverage     87.86%   87.87%           
+ Complexity     2211     2210    -1     
=========================================
  Files            85       85           
  Lines          7188     7190    +2     
  Branches       1425     1423    -2     
=========================================
+ Hits           6316     6318    +2     
  Misses          438      438           
  Partials        434      434           

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

Copy link
Collaborator

@yuxincs yuxincs left a comment

Choose a reason for hiding this comment

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

Awesome, and thanks for splitting up the PRs!

@msridhar msridhar merged commit 3d1eb3c into uber:master Nov 12, 2024
11 checks passed
@msridhar msridhar deleted the fix-jarinfer-param-index branch November 12, 2024 16:12
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.

2 participants