Minor refactoring due to change in the library model
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / translator / ErrorTranslator.java
index bec562615df38ce94a9cbed97c1660314e1e8e96..8a26264fbe2e9bbd04a01feb6f5cc51a67ea5b03 100644 (file)
@@ -1,6 +1,14 @@
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.openflowplugin.openflow.md.core.translator;
 
 import java.math.BigInteger;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -27,8 +35,8 @@ public class ErrorTranslator implements IMDMessageTranslator<OfHeader, List<Data
         if (msg instanceof ErrorMessage) {
             ErrorMessage message = (ErrorMessage) msg;
             List<DataObject> list = new CopyOnWriteArrayList<DataObject>();
-            LOG.error(" Error Message received: type={}[{}], code={}[{}], data={}[{}] ", message.getType(),
-                    message.getTypeString(), message.getCode(), message.getCodeString(), new String(message.getData()),
+            LOG.debug(" Error Message received: type={}[{}], code={}[{}], data=[{}] ", message.getType(),
+                    message.getTypeString(), message.getCode(), message.getCodeString(),
                     ByteUtil.bytesToHexstring(message.getData(), " "));
 
             // create a Node Error Notification event builder
@@ -54,7 +62,7 @@ public class ErrorTranslator implements IMDMessageTranslator<OfHeader, List<Data
             return list;
         } else {
             LOG.error("Message is not of Error Message ");
-            return null;
+            return Collections.emptyList();
         }
     }