Thomas Vachuska
Committed by Gerrit Code Review

Merge "Fix bug in validate() in BooleanConstraint"

......@@ -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);
}
......