1 6 package fr.jayasoft.ivy.conflict; 7 8 import java.util.Collection ; 9 import java.util.Collections ; 10 import java.util.Iterator ; 11 12 import fr.jayasoft.ivy.IvyNode; 13 import fr.jayasoft.ivy.conflict.AbstractConflictManager; 14 import fr.jayasoft.ivy.util.Message; 15 16 17 public class StrictConflictManager extends AbstractConflictManager 18 { 19 20 public StrictConflictManager() { 21 } 22 23 24 public Collection resolveConflicts(IvyNode parent, Collection conflicts) 25 { 26 IvyNode lastNode = null; 27 for (Iterator iter = conflicts.iterator(); iter.hasNext();) { 28 IvyNode node = (IvyNode)iter.next(); 29 30 if (lastNode != null && !lastNode.equals(node)) { 31 String msg = lastNode + " (needed by " + lastNode.getParent() + ") conflicts with " + node + " (needed by " + node.getParent() + ")"; 32 Message.error(msg); 33 Message.sumupProblems(); 34 throw new StrictConflictException(msg); 35 } 36 lastNode = node; 37 } 38 39 return Collections.singleton(lastNode); 40 } 41 42 } 43 | Popular Tags |