@GenIgnore non-canonical getters/setters of Redis[Connect]Options.endpoints #439
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
RedisOptions
class has a fieldendpoints
of typeList<String>
for which multiple accessors and mutators exist:getEndpoints()
: the canonical gettersetEndpoints()
: the canonical settergetEndpoint()
: returns the first element of the listsetEndpoint()
: turns the list into a single-element listaddEndpoint()
: adds one element to the listsetConnectionString()
: same assetEndpoint()
addConnectionString()
: same asaddEndpoint()
The
RedisConnectOptions
class, which ispublic
but is only used internally, has the same problem.All these methods are treated as individual properties by the code generator that produces the JSON serialization/deserialization classes, even though they are all backed by a single field. Since the code generator considers properties in declaration order (in upcoming Vert.x 5; it is lexicographic order in Vert.x 4), we had to reorder the methods so that serialization and deserialization does not lose information.
That is arguably a provisional solution, as it is very much not obvious that declaration order matters. This commit provides a permanent solution: all the non-canonical methods are marked as
@GenIgnore
. Only thegetEndpoints()
andsetEndpoints()
methods are used for serialization/deserialization.This is a breaking change, so it shall not be backported to Vert.x 4 and shall be documented as such.