Skip to content

Conversation

@mdumandag
Copy link
Contributor

With this change, add_xxx_field methods of the ClassDefinitionBuilder
checks the class name first, and if it already registered, raises
HazelcastSerializationError.

Also, missing docstrings for the add_xxx_field methods are added.

Closes #330

With this change, `add_xxx_field` methods of the ClassDefinitionBuilder
checks the class name first, and if it already registered, raises
HazelcastSerializationError.

Also, missing docstrings for the `add_xxx_field` methods are added.
@mdumandag mdumandag added this to the 4.1 milestone Apr 2, 2021
@mdumandag mdumandag self-assigned this Apr 2, 2021
@yemreinci yemreinci self-requested a review April 5, 2021 11:05
Copy link
Contributor

@yemreinci yemreinci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK.

"""
return self.add_string_array_field(field_name)

def add_field_def(self, field_def):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is public by accident as it is in java. Can we add documentation to tell the users that this is private(I am assuming we can not delete it anymore)

Can we add a documentation about the order that fields added should be consistent across all languages and also it should be consistent with write order in writePortable on ClassDefinitionBuilder ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a warning to this method and a note about the field order in the ClassDefinitionBuilder docstring

@mdumandag mdumandag merged commit 6de68cb into hazelcast:master Apr 6, 2021
@mdumandag mdumandag deleted the fix-duplicate-names-on-cd branch April 6, 2021 07:37
@degerhz degerhz changed the title Do not allow using duplicate field names in ClassDefinitionBuilder Do not allow using duplicate field names in ClassDefinitionBuilder [API-391] Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRACKING ISSUE] Check duplicate fields when building class definition

3 participants