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

Java, adds checker framework #342

Merged
merged 75 commits into from
Dec 24, 2023

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Dec 22, 2023

Java

  • adds and uses the checker framework
  • NullnessChecker added
  • Fixed errors indicated by NullnessChecker
  • Covariance used for collection (List/Map) inputs because those inputs are read from but not mutated

Some difficulties with Java Typing

  • If type is List<@Nullable List<@Nullable Object>>
  • then all allowed types should actually be the below ones because java treats Nullable T and T as separate classes, where T (NonNull) inherits from Nullable T
  • List<@Nullable List<@Nullable Object>>
  • List<@Nullable List<Object>>>
  • List<List<@Nullable Object>>
  • List<List<Object>>>
  • the covariant type List<? extends @Nullable List<? extends @Nullable Object>> is used to cover all 4 cases above

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    mvn clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/python*.
    For Windows users, please run the script in Git BASH.

@spacether spacether changed the title Java, adds checker framework, uses covariance for collection input Java, adds checker framework Dec 22, 2023
@spacether spacether force-pushed the feat_java_adds_checker_framework_covariant branch from 426d24e to 137b5b6 Compare December 22, 2023 05:39
@spacether spacether merged commit c52cb81 into master Dec 24, 2023
5 checks passed
@spacether spacether deleted the feat_java_adds_checker_framework_covariant branch December 24, 2023 19:41
@spacether spacether mentioned this pull request Jan 5, 2024
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

1 participant