Fix L2ModificationInstructions
- PopVlanInstruction
- type mismatch in #equals()
- StripVlanInstruction
- hide default constructor
- align #toString() format
- fix #equals()
Change-Id: Ifb14866df19cc32dcb9cc28ab473de5ca45d8e41
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 e29ffb9..dcb137e 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
@@ -285,6 +285,8 @@
public static final class StripVlanInstruction extends L2ModificationInstruction {
+ StripVlanInstruction() {}
+
@Override
public L2SubType subtype() {
return L2SubType.STRIP_VLAN;
@@ -292,7 +294,8 @@
@Override
public String toString() {
- return subtype().toString();
+ return toStringHelper(subtype().toString())
+ .toString();
}
@Override
@@ -305,7 +308,9 @@
if (this == obj) {
return true;
}
-
+ if (obj instanceof StripVlanInstruction) {
+ return true;
+ }
return false;
}
}
@@ -341,8 +346,8 @@
if (this == obj) {
return true;
}
- if (obj instanceof PushHeaderInstructions) {
- PushHeaderInstructions that = (PushHeaderInstructions) obj;
+ if (obj instanceof PopVlanInstruction) {
+ PopVlanInstruction that = (PopVlanInstruction) obj;
return Objects.equals(subtype, that.subtype);
}
return false;