diff options
author | jaceksur <39417826+jaceksur@users.noreply.github.com> | 2019-09-10 10:01:27 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-09-10 10:01:27 -0700 |
commit | 782b865c5533ad020a61ae79ec8a658acfa96861 (patch) | |
tree | 6b55f80fad5904b550fbac3abaa9981d002cc8d8 /include/flatbuffers/idl.h | |
parent | 3bfc86eaff10b26cb6507c904ad74ecd9e72f80b (diff) | |
download | flatbuffers-782b865c5533ad020a61ae79ec8a658acfa96861.tar.gz |
Annotate getters with @Pure when --java-checkerframework is specified. (#5510)
Together with @Nullable, this allows users to use static analysis tools
like CheckerFramework to catch NPEs caused by unset fields.
Diffstat (limited to 'include/flatbuffers/idl.h')
-rw-r--r-- | include/flatbuffers/idl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index c3cec066..506a717d 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -514,6 +514,7 @@ struct IDLOptions { std::string cpp_object_api_string_type; bool cpp_object_api_string_flexible_constructor; bool gen_nullable; + bool java_checkerframework; bool gen_generated; std::string object_prefix; std::string object_suffix; @@ -594,6 +595,7 @@ struct IDLOptions { cpp_object_api_pointer_type("std::unique_ptr"), cpp_object_api_string_flexible_constructor(false), gen_nullable(false), + java_checkerframework(false), gen_generated(false), object_suffix("T"), union_value_namespacing(true), |