Fix for the ONOS-4836

Change-Id: Iedf597bb79f27ca7834e85fc445ebd5736c852a7
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java
index 673e4c8..c5b7462 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java
@@ -53,10 +53,6 @@
             " member is required in FilteringObjective";
     private static final String NOT_NULL_MESSAGE =
             "FilteringObjective cannot be null";
-    private static final String INVALID_TYPE_MESSAGE =
-            "The requested type {} is not defined in FilteringObjective.";
-    private static final String INVALID_OP_MESSAGE =
-            "The requested operation {} is not defined for FilteringObjective.";
 
     public static final String REST_APP_ID = "org.onosproject.rest";
 
@@ -136,8 +132,8 @@
                 builder.deny();
                 break;
             default:
-                log.warn(INVALID_TYPE_MESSAGE, typeStr);
-                return null;
+                throw new IllegalArgumentException("The requested type " + typeStr +
+                " is not defined for FilteringObjective.");
         }
 
         // decode key
@@ -176,8 +172,8 @@
                 filteringObjective = builder.remove();
                 break;
             default:
-                log.warn(INVALID_OP_MESSAGE, opStr);
-                return null;
+                throw new IllegalArgumentException("The requested operation " + opStr +
+                " is not defined for FilteringObjective.");
         }
 
         return filteringObjective;