General Sonar clean-up
Return simplification in a number of places:
* drop useless return at the end of void methods (unless it comes before
commented code)
* simplify return ... ? true : false
* simplify variable declaration immediately followed by return
Drop unused local variables, and move some declarations closer to first
use (in particular when there's a redundant initialisation value).
Drop unused fields where it's safe to do so; in particular,
OvsdbClientImpl's exceptions were never initialised so we can even drop
the corresponding getter.
Drop unnecessary casts and use the Java 7 <> operator as appropriate.
Use primary types instead of wrappers where appropriate (dpid,
openFlowPort).
Drop redundant final modifiers on static methods.
Drop redundant .toString() calls.
Use .parseInt(), .parseShort() etc. instead of .decode().
Drop a few dead methods.
Avoid calling new String() explicitly.
Drive-by cleaning:
* AbstractHandler:
- switch instead of multiple ifs
* BridgeConfigurationManagerImpl, ConfigurationServiceImpl:
- rework getControllerIPAddress() to loop over the configuration
properties
- in getNormalizedRow(), avoid rebuilding the array every time we go
through the loop
* ConfigurationServiceImpl:
- in getTunnelEndPoint(), trace the tunnel endpoint only if we get
one (avoids a NPE)
* EgressAclService, IngressAclService:
- srcIpPrefix only makes sense if securityRuleIpPrefix != null, so
move into the corresponding block
Change-Id: I7ca2a1a37f4795b3c0141b2b3a00977a15ffa5dd
Signed-off-by: Stephen Kitt <skitt@redhat.com>
27 files changed: