Fix 'critical' severity issues in Sonar 75/15075/1
authorLorand Jakab <lojakab@cisco.com>
Mon, 9 Feb 2015 14:29:59 +0000 (16:29 +0200)
committerLorand Jakab <lojakab@cisco.com>
Mon, 9 Feb 2015 14:29:59 +0000 (16:29 +0200)
Change-Id: Iac42897d1aec5d9da09e975d829bdd6fcae88c50
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
commons/unittest_tools/src/main/java/org/opendaylight/lispflowmapping/tools/junit/BaseExpectations.java
mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/type/lisp/MapRegister.java
mappingservice/api/src/main/java/org/opendaylight/lispflowmapping/type/lisp/address/LispAddressGeneric.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/inventory/XtrIdNodeProperty.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java

index e998bee9891f76ade395a83a1754cf689ae081b8..26562a48fd0906ad5ca4c3d77b0bb664fb1af1bc 100644 (file)
@@ -162,7 +162,6 @@ public class BaseExpectations extends Expectations {
                 e = se;
             } catch (IllegalAccessException iae) {
                 e = iae;
-                iae.printStackTrace();
             } catch (InvocationTargetException ite) {
                 throw ite.getTargetException();
             }
index 1c734ba3411ff6d043459d3bc49bf02d0b45ca14..87fa2a8ad800dc98b9096acadb16f13a58daaf89 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.lispflowmapping.type.lisp;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlAccessType;
@@ -183,7 +184,7 @@ public class MapRegister {
     }
 
     public MapRegister setMapRegisterBytes(byte[] mapRegisterBytes) {
-        this.mapRegisterBytes = mapRegisterBytes;
+        this.mapRegisterBytes = Arrays.copyOf(mapRegisterBytes, mapRegisterBytes.length);
         return this;
     }
 
index 55bb48ec731b16c0aa6beac6cff63a963ae39068..7adf2f9632a7eba9c2981b27a1417924842d87f3 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.lispflowmapping.type.lisp.address;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlAccessType;
@@ -254,7 +255,7 @@ public class LispAddressGeneric{
        }
 
        public void setMac(byte[] mac) {
-               this.mac = mac;
+               this.mac = Arrays.copyOf(mac, mac.length);
        }
 
        public int getAsNum() {
index debbf478a6b711df9497e1c5eae3ace329a326ea..7b00840e46e4b899812102df88a1796393d851bd 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.lispflowmapping.implementation.inventory;
 
+import java.util.Arrays;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -34,7 +36,7 @@ public class XtrIdNodeProperty extends Property implements Cloneable {
 
     public XtrIdNodeProperty(byte[] xtrId) {
         super(name);
-        this.xtrId = xtrId;
+        this.xtrId = Arrays.copyOf(xtrId, xtrId.length);
     }
 
     @Override
index e26ffb4f53bf784f3a75dc893415089b82900a43..0a691479483c5d641c15346b5e91f8f8fca6ca2f 100644 (file)
@@ -179,7 +179,6 @@ public class LispSouthboundPlugin extends AbstractBindingAwareProvider implement
             }
         } catch (SocketException e) {
             logger.error("couldn't start socket {}", e.getMessage());
-            e.printStackTrace();
         }
     }