Skip to content

Fix JarInfer parameter indexes for instance methods#1071

Merged
msridhar merged 6 commits intouber:masterfrom
msridhar:fix-jarinfer-param-index
Nov 12, 2024
Merged

Fix JarInfer parameter indexes for instance methods#1071
msridhar merged 6 commits intouber:masterfrom
msridhar:fix-jarinfer-param-index

Conversation

@msridhar
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@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