[VTN-47] FindBugs detected bugs in manager.neutron bundle. 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: 2239

 Description   

FindBugs detected bugs in manager.neutron bundle.

1. OVSDBPluginEventHandler.getSwitchIdFromInterface() may cause NPE because it
dereferences Port instance before null check.

Port port = ovsdbConfigService.getTypedRow(node, Port.class, ovsdbConfigService.getRow(node, "Port", portId.toString()));
LOG.trace(" Node or Port getRow ={} ", port.getRow());

2. The following fields in OVSDBPluginEventHandler class should not be static
because they are handled by instance methods only.

  • integrationBridgeName
  • failmode
  • protocols
  • portname

3. OVSDBPluginEventHandler.getSystemProperties() should close FileInputStream.

try

{ File f = new File("configuration/vtn.ini"); String filepath = f.getAbsolutePath(); FileInputStream in = new FileInputStream(filepath); configProp.load(in); LOG.trace("loaded Integration bridge Configuartion details from vtn.ini"); }

catch (Exception e) {
LOG.trace("Exception {} occured while reading SystemProperties ", e);
}

4. PortHandler.canModifyInterface() uses "==" operator to compare Boolean
instances. Naturally it should be done by equals(Object) method.

Boolean portAdminState = port.getAdminStateUp();
if ((portAdminState != null) && (portAdminState != vIf.getEnabled()))

{ modify = true; }

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

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

Comment by Shigeru Yasuda [ 23/Oct/14 ]

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

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