mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-11-02 17:21:05 +01:00
Merge "Fix bug in validate() in BooleanConstraint"
This commit is contained in:
commit
361bc539ea
@ -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;
|
||||
@ -48,17 +47,6 @@ public class ObstacleConstraint extends BooleanConstraint {
|
||||
return !(obstacles.contains(src) || obstacles.contains(dst));
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user