Remove deprecated instructions() method in the traffic treatment class
Change-Id: I739b35bdcbf9867c639c7b6ca4006f3eeafbb055
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
index 5b2343e..da3cac6 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
@@ -32,6 +32,8 @@
import java.util.List;
import java.util.Objects;
+import static com.google.common.base.Preconditions.checkNotNull;
+
/**
* Default traffic treatment implementation.
*/
@@ -52,7 +54,7 @@
* @param instructions treatment instructions
*/
private DefaultTrafficTreatment(List<Instruction> instructions) {
- this.immediate = ImmutableList.copyOf(instructions);
+ this.immediate = ImmutableList.copyOf(checkNotNull(instructions));
this.deferred = ImmutableList.of();
this.hasClear = false;
this.table = null;
@@ -62,19 +64,14 @@
List<Instruction> immediate,
Instructions.TableTypeTransition table,
boolean clear) {
- this.immediate = ImmutableList.copyOf(immediate);
- this.deferred = ImmutableList.copyOf(deferred);
+ this.immediate = ImmutableList.copyOf(checkNotNull(immediate));
+ this.deferred = ImmutableList.copyOf(checkNotNull(deferred));
this.table = table;
this.hasClear = clear;
}
@Override
- public List<Instruction> instructions() {
- return immediate;
- }
-
- @Override
public List<Instruction> deferred() {
return deferred;
}
@@ -184,7 +181,7 @@
// Creates a new builder based off an existing treatment
//FIXME only works for immediate instruction sets.
private Builder(TrafficTreatment treatment) {
- for (Instruction instruction : treatment.instructions()) {
+ for (Instruction instruction : treatment.immediate()) {
add(instruction);
}
}