mirror of
				https://github.com/opennetworkinglab/onos.git
				synced 2025-11-04 02:01:11 +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
 | 
					    @Override
 | 
				
			||||||
    public boolean validate(Path path, LinkResourceService resourceService) {
 | 
					    public boolean validate(Path path, LinkResourceService resourceService) {
 | 
				
			||||||
        for (Link link : path.links()) {
 | 
					        for (Link link : path.links()) {
 | 
				
			||||||
            if (isValid(link, resourceService)) {
 | 
					            if (!isValid(link, resourceService)) {
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,6 @@ import com.google.common.base.MoreObjects;
 | 
				
			|||||||
import com.google.common.collect.ImmutableSet;
 | 
					import com.google.common.collect.ImmutableSet;
 | 
				
			||||||
import org.onlab.onos.net.DeviceId;
 | 
					import org.onlab.onos.net.DeviceId;
 | 
				
			||||||
import org.onlab.onos.net.Link;
 | 
					import org.onlab.onos.net.Link;
 | 
				
			||||||
import org.onlab.onos.net.Path;
 | 
					 | 
				
			||||||
import org.onlab.onos.net.resource.LinkResourceService;
 | 
					import org.onlab.onos.net.resource.LinkResourceService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.Objects;
 | 
					import java.util.Objects;
 | 
				
			||||||
@ -48,17 +47,6 @@ public class ObstacleConstraint extends BooleanConstraint {
 | 
				
			|||||||
        return !(obstacles.contains(src) || obstacles.contains(dst));
 | 
					        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
 | 
					    @Override
 | 
				
			||||||
    public int hashCode() {
 | 
					    public int hashCode() {
 | 
				
			||||||
        return Objects.hash(obstacles);
 | 
					        return Objects.hash(obstacles);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user