Fixed validation bug of YANG import statement
[controller.git] / opendaylight / forwardingrulesmanager / src / main / java / org / opendaylight / controller / forwardingrulesmanager / FlowConfig.java
index f1217b534043b3ad64caec04f38fe0a5a57347dd..bf5062985dbcca8a0e5060f4a8243659edca6550 100644 (file)
@@ -10,7 +10,6 @@
 package org.opendaylight.controller.forwardingrulesmanager;
 
 import java.io.Serializable;
-import java.lang.reflect.Field;
 import java.net.Inet6Address;
 import java.net.InetAddress;
 import java.util.ArrayList;
@@ -64,7 +63,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Configuration Java Object which represents a flow configuration information
- * for Forwarding Rrules Manager.
+ * for Forwarding Rules Manager.
  */
 
 @XmlRootElement
@@ -224,9 +223,7 @@ public class FlowConfig implements Serializable {
 
     public boolean isInternalFlow() {
         // Controller generated static flows have name starting with "**"
-        if (this.name == null)
-            return false;
-        return this.name.startsWith("**");
+       return (this.name != null && this.name.startsWith("**"));
     }
 
     public String getName() {
@@ -415,18 +412,6 @@ public class FlowConfig implements Serializable {
         this.actions = actions;
     }
 
-    public static List<String> getFieldsNames() {
-        List<String> fieldList = new ArrayList<String>();
-        for (Field fld : FlowConfig.class.getDeclaredFields()) {
-            fieldList.add(fld.getName());
-        }
-        // Remove 4 static fields + 2 internal field
-        for (int i = 0; i < 6; i++)
-            fieldList.remove(0);
-
-        return fieldList;
-    }
-
     public boolean isPortGroupEnabled() {
         return (portGroup != null);
     }
@@ -623,15 +608,14 @@ public class FlowConfig implements Serializable {
                         }
                     }
 
-                    log.debug("Get Nexthop address = " + address + " Type = "
-                            + setNHType.toString());
+                    log.debug("Get Nexthop address = {} Type = {}", address, setNHType.toString());
                     if (setNHType == SetNextHopType.RESOLVE_L2RW) {
                         try {
                             return InetAddress.getByName(address);
                         } catch (Exception e) {
                             log
-                                    .debug("Exception during nextHopAddress resolution : "
-                                            + e.getMessage());
+                                    .debug("Exception during nextHopAddress resolution : ",
+                                            e);
                         }
                     }
                 }