mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
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.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3bfc86eaff
commit
782b865c55
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user