[#34] Provide input parameters for all grpc methods #35

Merged
orikik merged 1 commit from orikik/frostfs-sdk-java:feature/input_params into master 2025-01-24 10:26:56 +00:00
Member
No description provided.
orikik added 1 commit 2025-01-23 12:31:11 +00:00
[#34] Provide input parameters for all grpc methods
All checks were successful
DCO / DCO (pull_request) Successful in 25s
Verify code phase / Verify code (pull_request) Successful in 1m37s
52abcc68fc
Signed-off-by: Ori Bruk <o.bruk@yadro.com>
requested reviews from pogpp, PavelGrossSpb 2025-01-23 12:31:26 +00:00
pogpp reviewed 2025-01-23 13:29:29 +00:00
@ -0,0 +12,4 @@
@Getter
@Builder
@AllArgsConstructor
@EqualsAndHashCode
Member

There are several disadvantages to using Lombok’s @EqualsAndHashCode annotation. First, it can generate unwanted hash code collisions when two objects have different field values but the same hash code.

Second, it may not be compatible with other libraries and frameworks that rely on traditional implementations of equals() and hashCode().

Lastly, it can reduce readability by generating methods that aren’t explicitly defined in the class, making it more difficult to understand the logic of the code.

There are several disadvantages to using Lombok’s @EqualsAndHashCode annotation. First, it can generate unwanted hash code collisions when two objects have different field values but the same hash code. Second, it may not be compatible with other libraries and frameworks that rely on traditional implementations of equals() and hashCode(). Lastly, it can reduce readability by generating methods that aren’t explicitly defined in the class, making it more difficult to understand the logic of the code.
Author
Member

Unfortunately, a collision cannot be avoided in principle, since the hash code is int and due to the birthday problem we only need 77,163 objects before we have a 50/50 chance of hashCode collision(lombok and Objects hashcode realization very similar, just different multiplier). But I agree about the second one, I’ll correct it.

Unfortunately, a collision cannot be avoided in principle, since the hash code is int and due to the [birthday problem](https://en.wikipedia.org/wiki/Birthday_problem) we only need 77,163 objects before we have a 50/50 chance of hashCode collision(lombok and Objects hashcode realization very similar, just different multiplier). But I agree about the second one, I’ll correct it.
orikik force-pushed feature/input_params from 52abcc68fc to 8990bd487d 2025-01-23 15:56:51 +00:00 Compare
orikik force-pushed feature/input_params from 8990bd487d to 1ccb1f2013 2025-01-23 16:23:22 +00:00 Compare
pogpp approved these changes 2025-01-24 10:16:33 +00:00
orikik merged commit 1ccb1f2013 into master 2025-01-24 10:26:56 +00:00
orikik deleted branch feature/input_params 2025-01-24 10:26:58 +00:00
Sign in to join this conversation.
No description provided.