Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-37

Implement correct equals for array fields

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: Linux
      Platform: PC

    • 103
    • Normal

    Description

      Having a field, that is an array in a generated DTO. Equals method looks like this:
      ...
      else if(!_value.equals(other._value)) {
      return false;
      }
      ...

      That will always return false even if both objects are equal. Replace equals with:

      ...
      else if (!Arrays.equals(this._value, other._value)) {
      return false;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            dkutenicsova Dana Kutenicsova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: