[VTN-46] PathMap class handles mapIndex field incorrectly. Created: 22/Oct/14  Updated: 03/May/18  Resolved: 23/Oct/14

Status: Resolved
Project: vtn
Component/s: VTN Manager
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Shigeru Yasuda Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 2236

 Description   

mapIndex field in PathMap class keeps an Integer instance which represents
the path map index. But some methods treat it as int value incorrectly.

  • equals(Object) compares mapIndex values using == operator.
    Naturally mapIndex values need to be compared using equals(Object).
  • hashCode() dereferences mapIndex field without null check.
    So it causes NPE if mapIndex is null.

This issue was detected by FindBugs.



 Comments   
Comment by Shigeru Yasuda [ 22/Oct/14 ]

Patch for master: https://git.opendaylight.org/gerrit/12135

Comment by Shigeru Yasuda [ 23/Oct/14 ]

Patch for stable/helium: https://git.opendaylight.org/gerrit/12180

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