[MDSAL-88] Binding DTOs: improve equals() implementation Created: 09/Jun/15  Updated: 20/Jul/20  Resolved: 20/Jul/20

Status: Resolved
Project: mdsal
Component/s: Binding codegen
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Improvement
Reporter: Robert Varga Assignee: Vladyslav Marchenko
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by MDSAL-473 Add DataObject.bindingEquals(Object) Resolved
Duplicate
is duplicated by MDSAL-149 Binding DTOs: improve equals() implem... Resolved

 Description   

Our current equals() implementation visits each child node in alphabetical order. While this is correct, finding inequalities may take significant time, as we bore recursively into objects.

Since the order of comparison does not determine the result of equality comparison, we can speed up detecting degatives if we employ some smarts. Those smarts is that some types can be compared more quickly than others, simply because they are terminal nodes.

Teach the DTO generator code to recognize the types being compared and perform the following ordering:

1) numeric types (boolean, byte, short, int, long, biginteger, bigdecimal), identityrefs
2) string, binary, bits
3) instance identifier
4) all other (e.g. composite) types


Generated at Wed Feb 07 20:08:36 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.