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

Support methods taking compile-time constant fields in Access Paths. #504

Merged
merged 1 commit into from Oct 15, 2021

Conversation

lazaroclapp
Copy link
Collaborator

This builds upon PR #285 by adding support to code like:

if (x.get(ZERO) != null && x.get(ZERO).foo() != null) {
   return x.get(ZERO).foo().bar();
}

Where ZERO is a compile-time evaluated constant. That is,
a static final variable or field of primitive or string type.

This builds upon PR #285 by adding support to code like:

```
if (x.get(ZERO) != null && x.get(ZERO).foo() != null) {
   return x.get(ZERO).foo().bar();
}
```

Where `ZERO` is a compile-time evaluated constant. That is,
a `static final` variable or field of primitive or string type.
@lazaroclapp
Copy link
Collaborator Author

Trivia: As might be inferred from the branch name, this is some intermediate work I ran into while trying to support treating io.grpc.Metadata as if it were a Map (even though it doesn't implement the map interface, it has a similar containsKey(...) and get(...) logic). This patch is not needed for that change, but it seems useful enough in general.

@coveralls
Copy link

Pull Request Test Coverage Report for Build #580

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 10 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 89.186%

Files with Coverage Reduction New Missed Lines %
src/main/java/com/uber/nullaway/dataflow/AccessPath.java 10 94.65%
Totals Coverage Status
Change from base Build #579: 0.02%
Covered Lines: 3505
Relevant Lines: 3930

💛 - Coveralls

Copy link
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.

LGTM!

@lazaroclapp lazaroclapp merged commit 39a92c6 into master Oct 15, 2021
@lazaroclapp lazaroclapp deleted the support_grpc_metadata branch October 15, 2021 16:23
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.

None yet

3 participants