You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a comment on #3403 about how some of our Thrift problems where we see a default value of 0 for primitive types that aren't explicitly set, and how those are indistinguishable from the way we're setting them to 0 explicitly, because we're using the public fields to access them directly, instead of the setter/getter methods.
I believe Thrift has the ability to generate Java code with private members, which would force us to use the setters/getters, but this would be a large, tedious change. We could switch over to the setters/getters incrementally, before switching to force the code to use private members, or just switch to using private members, and force all the changes to happen to fix all the compilation issues.
To use private members, it's a simple matter of editing our script, but the tedious part is fixing all the compilation issues that would result:
--- a/core/src/main/scripts/generate-thrift.sh+++ b/core/src/main/scripts/generate-thrift.sh@@ -69,3 +69,3 @@ rm -rf "$BUILD_DIR"/gen-java
for f in src/main/thrift/*.thrift; do
- thrift "${THRIFT_ARGS[@]}" --gen java:generated_annotations=suppress "$f" || fail unable to generate java thrift classes+ thrift "${THRIFT_ARGS[@]}" --gen java:generated_annotations=suppress,private-members "$f" || fail unable to generate java thrift classes
thrift "${THRIFT_ARGS[@]}" --gen py "$f" || fail unable to generate python thrift classes
The text was updated successfully, but these errors were encountered:
I made a comment on #3403 about how some of our Thrift problems where we see a default value of
0
for primitive types that aren't explicitly set, and how those are indistinguishable from the way we're setting them to0
explicitly, because we're using the public fields to access them directly, instead of the setter/getter methods.I believe Thrift has the ability to generate Java code with private members, which would force us to use the setters/getters, but this would be a large, tedious change. We could switch over to the setters/getters incrementally, before switching to force the code to use private members, or just switch to using private members, and force all the changes to happen to fix all the compilation issues.
To use private members, it's a simple matter of editing our script, but the tedious part is fixing all the compilation issues that would result:
The text was updated successfully, but these errors were encountered: