ctubbsii opened a new issue, #3404:
URL: https://github.com/apache/accumulo/issues/3404
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:
```diff
--- 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
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]