@Override protected Set<Tool> getExtensionConflictToolSet(Tool tool, Tool[] tools) { String exts[] = tool.getPrimaryInputExtensions(); Set<String> extsSet = new HashSet<String>(Arrays.asList(exts)); Set<Tool> conflictsSet = null; for (int i = 0; i < tools.length; i++) { Tool t = tools[i]; if (t == tool) continue; if (TcModificationUtil.containCommonEntries(extsSet, t.getPrimaryInputExtensions())) { if (conflictsSet == null) conflictsSet = new HashSet<Tool>(); conflictsSet.add(t); } } if (conflictsSet == null) conflictsSet = Collections.emptySet(); return conflictsSet; }
@Override protected boolean canAdd(Tool tool) { return !TcModificationUtil.containCommonEntries( getInputExtsSet(), tool.getPrimaryInputExtensions()); }