Remove trailing whitespace
[openflowjava.git] / simple-client / src / main / java / org / opendaylight / openflowjava / protocol / impl / clients / WaitForMessageEvent.java
index 1ad9b9441cfffdca618e7acc3425a247aee94049..bcf696e95b6e3b96d5ae60dca71e2e0be6d2dabe 100644 (file)
@@ -1,9 +1,16 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.clients;
 
 import java.util.Arrays;
 
-import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -12,7 +19,7 @@ import org.slf4j.LoggerFactory;
  * @author michal.polkorab
  */
 public class WaitForMessageEvent implements ClientEvent {
-    
+
     private static final Logger LOGGER = LoggerFactory.getLogger(WaitForMessageEvent.class);
     private byte[] headerExpected;
     private byte[] headerReceived;
@@ -21,7 +28,10 @@ public class WaitForMessageEvent implements ClientEvent {
      * @param headerExpected header (first 8 bytes) of expected message
      */
     public WaitForMessageEvent(byte[] headerExpected) {
-        this.headerExpected = headerExpected;
+        this.headerExpected = new byte[headerExpected.length];
+        for (int i = 0; i < headerExpected.length; i++) {
+            this.headerExpected[i] = headerExpected[i];
+        }
     }
 
     @Override
@@ -34,7 +44,7 @@ public class WaitForMessageEvent implements ClientEvent {
             LOGGER.debug("received msg: " + ByteBufUtils.bytesToHexString(headerReceived));
             return false;
         }
-        LOGGER.info("Headers OK");
+        LOGGER.debug("Headers OK");
         return true;
     }
 
@@ -42,8 +52,9 @@ public class WaitForMessageEvent implements ClientEvent {
      * @param headerReceived header (first 8 bytes) of expected message
      */
     public void setHeaderReceived(byte[] headerReceived) {
-        this.headerReceived = headerReceived;
+        this.headerReceived = new byte[headerReceived.length];
+        for (int i = 0; i < headerReceived.length; i++) {
+            this.headerReceived[i] = headerReceived[i];
+        }
     }
-
-    
 }