Committed by
Gerrit Code Review
Merge "Fix bug in validate() in BooleanConstraint"
Showing
2 changed files
with
1 additions
and
13 deletions
... | @@ -52,7 +52,7 @@ public abstract class BooleanConstraint implements Constraint { | ... | @@ -52,7 +52,7 @@ public abstract class BooleanConstraint implements Constraint { |
52 | @Override | 52 | @Override |
53 | public boolean validate(Path path, LinkResourceService resourceService) { | 53 | public boolean validate(Path path, LinkResourceService resourceService) { |
54 | for (Link link : path.links()) { | 54 | for (Link link : path.links()) { |
55 | - if (isValid(link, resourceService)) { | 55 | + if (!isValid(link, resourceService)) { |
56 | return false; | 56 | return false; |
57 | } | 57 | } |
58 | } | 58 | } | ... | ... |
... | @@ -19,7 +19,6 @@ import com.google.common.base.MoreObjects; | ... | @@ -19,7 +19,6 @@ import com.google.common.base.MoreObjects; |
19 | import com.google.common.collect.ImmutableSet; | 19 | import com.google.common.collect.ImmutableSet; |
20 | import org.onlab.onos.net.DeviceId; | 20 | import org.onlab.onos.net.DeviceId; |
21 | import org.onlab.onos.net.Link; | 21 | import org.onlab.onos.net.Link; |
22 | -import org.onlab.onos.net.Path; | ||
23 | import org.onlab.onos.net.resource.LinkResourceService; | 22 | import org.onlab.onos.net.resource.LinkResourceService; |
24 | 23 | ||
25 | import java.util.Objects; | 24 | import java.util.Objects; |
... | @@ -49,17 +48,6 @@ public class ObstacleConstraint extends BooleanConstraint { | ... | @@ -49,17 +48,6 @@ public class ObstacleConstraint extends BooleanConstraint { |
49 | } | 48 | } |
50 | 49 | ||
51 | @Override | 50 | @Override |
52 | - public boolean validate(Path path, LinkResourceService resourceService) { | ||
53 | - for (Link link : path.links()) { | ||
54 | - if (!isValid(link, resourceService)) { | ||
55 | - return false; | ||
56 | - } | ||
57 | - } | ||
58 | - | ||
59 | - return true; | ||
60 | - } | ||
61 | - | ||
62 | - @Override | ||
63 | public int hashCode() { | 51 | public int hashCode() { |
64 | return Objects.hash(obstacles); | 52 | return Objects.hash(obstacles); |
65 | } | 53 | } | ... | ... |
-
Please register or login to post a comment