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

Properly handle override checks when the overridden method has a library model #637

Closed
msridhar opened this issue Aug 10, 2022 · 1 comment
Assignees

Comments

@msridhar
Copy link
Collaborator

See #636 (comment) and #636 (comment)

@msridhar
Copy link
Collaborator Author

FYI @lazaroclapp

@lazaroclapp lazaroclapp self-assigned this Aug 10, 2022
lazaroclapp added a commit that referenced this issue Aug 24, 2022
…de. (#639)

In particular, this allows library models to change the nullability of method
arguments in annotated code.

This change replaces two separate an overly specific `Handler` callbacks:

- `onUnannotatedInvocationGetExplicitlyNullablePositions`
- `onUnannotatedInvocationGetNonNullPositions`

With a single more general callback:

- `onOverrideMethodInvocationParametersNullability`

which is explicitly meant to handle overriding/changing method parameter 
nullability for both annotated and unannotated code (thus solving issue #637).

This requires some refactoring (mostly simplifying logic) in the core NullAway 
class, as well as changes to the different handlers, which must now explicitly 
skip annotated code if they aren't designed to work with it (e.g. 
`RestrictiveAnnotationHandler`).
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

No branches or pull requests

2 participants