Uploaded image for project: 'netvirt'
  1. netvirt
  2. NETVIRT-1028

Fix unrelated types for equals in HwvtepPhysicalSwitchListener

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • Oxygen, Fluorine
    • Magnesium
    • None
    • None

    Description

      Findbugs reports a "Call to equals() comparing different types" violation in HwvtepPhysicalSwitchListener for:

        Objects.equals(l2GwDevice.getHwvtepNodeId(), globalIid)
      

      because the first parameter is a String and the second an InstanceIdentifier. The call will always return false. This occurs in 2 places. The calls were commented out by https://git.opendaylight.org/gerrit/#/c/65520/ to avoid the FB violation.

      Another part of the class does this:

        Objects.equals(l2GatewayDevice.getHwvtepNodeId(),
                                  globalIid.firstKeyOf(Node.class).getNodeId().getValue())
      

      and it seems the 2 violators should do the same. This should be analyzed by someone who knows the code to confirm this would be correct and wouldn't break anything or if the equals check is even necessary (you'd think something else would be broken by now).

      Attachments

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

        Activity

          People

            Karthikeyan Karthikeyan Krishnan
            tpantelis Tom Pantelis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: