Sonar: Method params shouldn't be reassigned 63/31063/1
authorLorand Jakab <lojakab@cisco.com>
Wed, 9 Dec 2015 10:41:05 +0000 (12:41 +0200)
committerLorand Jakab <lojakab@cisco.com>
Wed, 9 Dec 2015 10:41:05 +0000 (12:41 +0200)
commitc366d24384d304b99c44967e9d4335b3e4c5a26c
treee13da78a85db6a73831a5bbe5fbc5f77b6eb2353
parent4bfc22fd32e64931f8f9fbaa7ef9eb0d86390403
Sonar: Method params shouldn't be reassigned

Fix 14 instances of Sonar issue "Method parameters, caught exceptions
and foreach variables should not be reassigned" labeled as Major. The
rule description says: "While it is technically correct to assign to
parameters from within method bodies, it is better to use temporary
variables to store intermediate results. This rule will typically detect
cases where a constructor parameter is assigned to itself instead of a
field of the same name, i.e. when this was forgotten. Allowing
parameters to be assigned to also reduces the code readability as
developers will not be able to know whether the original parameter or
some temporary variable is being accessed without going through the
whole method. Moreover, some developers might also expect assignments of
method parameters to be visible from callers, which is not the case and
can confuse them. All parameters should be treated as final."

Change-Id: I488d2c3fbaf28814f207f65027f80d4b7d0e622e
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/MultiTableMapCache.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/SimpleMapCache.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/serializer/address/AfiListSerializer.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/serializer/address/ExplicitLocatorPathSerializer.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/util/MaskUtil.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundStats.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/util/LispNotificationHelper.java