L2/L3 modification instruction bug fixes

- Fixed instanceOf with wrong type (ONOS-974)
- Aligned #toString() format to be the same as other instructions

Change-Id: I526c2ef8d92660e0b821a10f0cf87ee72a84cdf3
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
index b005bfc..c6dd282 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
@@ -304,13 +304,13 @@
 
         @Override
         public String toString() {
-            return toStringHelper(type().toString())
+            return toStringHelper(subtype().toString())
                     .add("mpls", mplsLabel.intValue()).toString();
         }
 
         @Override
         public int hashCode() {
-            return Objects.hash(mplsLabel);
+            return Objects.hash(type(), subtype(), mplsLabel);
         }
 
         @Override
@@ -330,7 +330,7 @@
     }
 
     /**
-     * Represents a MPLS label modification.
+     * Represents a MPLS TTL modification.
      */
     public static final class ModMplsTtlInstruction extends
             L2ModificationInstruction {
@@ -345,12 +345,13 @@
 
         @Override
         public String toString() {
-            return type().toString();
+            return toStringHelper(subtype().toString())
+                    .toString();
         }
 
         @Override
         public int hashCode() {
-            return Objects.hash(type(), L2SubType.DEC_MPLS_TTL);
+            return Objects.hash(type(), subtype());
         }
 
         @Override
@@ -358,9 +359,8 @@
             if (this == obj) {
                 return true;
             }
-            if (obj instanceof ModMplsLabelInstruction) {
-                ModMplsTtlInstruction that = (ModMplsTtlInstruction) obj;
-                return Objects.equals(this.type(), that.type());
+            if (obj instanceof ModMplsTtlInstruction) {
+                return true;
             }
             return false;
         }