Sho SHIMIZU

Fix bug in validate() in BooleanConstraint

- Flip the branch condition in validate()

Change-Id: I7bafb710440513d3ccce8178c1bd6bb30ed06d4f
......@@ -52,7 +52,7 @@ public abstract class BooleanConstraint implements Constraint {
@Override
public boolean validate(Path path, LinkResourceService resourceService) {
for (Link link : path.links()) {
if (isValid(link, resourceService)) {
if (!isValid(link, resourceService)) {
return false;
}
}
......
......@@ -19,7 +19,6 @@ import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.Link;
import org.onlab.onos.net.Path;
import org.onlab.onos.net.resource.LinkResourceService;
import java.util.Objects;
......@@ -49,17 +48,6 @@ public class ObstacleConstraint extends BooleanConstraint {
}
@Override
public boolean validate(Path path, LinkResourceService resourceService) {
for (Link link : path.links()) {
if (!isValid(link, resourceService)) {
return false;
}
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(obstacles);
}
......