[YANGTOOLS-37] Implement correct equals for array fields Created: 04/Oct/13 Updated: 10/Apr/22 Resolved: 10/Oct/13 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Dana Kutenicsova | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| External issue ID: | 103 |
| Priority: | Normal |
| Description |
|
Having a field, that is an array in a generated DTO. Equals method looks like this: That will always return false even if both objects are equal. Replace equals with: ... |
| Comments |
| Comment by Dana Kutenicsova [ 04/Oct/13 ] |
|
The same goes for hashcode: Use: result = prime * result + Arrays.hashCode(this._value); |
| Comment by Martin Vitez [ 10/Oct/13 ] |
|
Fixed in binding-generator version 0.6.0-SNAPSHOT. |