Add any new {@link ArtifactoryRepo}s.

@param repos         list of {@link ArtifactoryRepo}s
@param existingRepos list of existing {@link ArtifactoryRepo}s
@param collector     the {@link ArtifactoryCollector}
548922
private void addNewRepos(List<ArtifactoryRepo> repos, List<ArtifactoryRepo> existingRepos, ArtifactoryCollector collector) {
        long start = System.currentTimeMillis();
        int count = 0;

        List<ArtifactoryRepo> newRepos = new ArrayList<>();
        for (ArtifactoryRepo repo : repos) {
            ArtifactoryRepo existing = null;
            if (!CollectionUtils.isEmpty(existingRepos) && (existingRepos.contains(repo))) {
                existing = existingRepos.get(existingRepos.indexOf(repo));
            }

            if (existing == null) {
                repo.setCollectorId(collector.getId());
                repo.setEnabled(false); // Do not enable for collection. Will be enabled later
                repo.setDescription(repo.getRepoName());
                newRepos.add(repo);
                count++;
            }
        }
        //save all in one shot
        if (!CollectionUtils.isEmpty(newRepos)) {
            artifactoryRepoRepository.save(newRepos);
        }
        log("New repos", start, count);
    }
776897
def setCollectors(self, collectors):
        
        self.__collectors = {}
        for name, collector in collectors.items():
            self.__collectors[name] = collector
            collector.setSchema(self)
1326850
public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
    {
        try {
            if (repository != null)
            {
                boolean duplicate = false;
                for (Repository repo : repositoryAdmin.listRepositories())
                {
                    if (repository.equalsIgnoreCase(repo.getURI()))
                        duplicate = true;
                }
                if (!duplicate)
                {
                    Repository repo = repositoryAdmin.addRepository(repository);
                    if (repo == null)
                        repositoryAdmin.removeRepository(repository);   // Ignore repos not found
                }
            }
        } catch (Exception e) {
            // Ignore exception e.printStackTrace();
        }
    }
426775
@Override
    public void collect(FeatureCollector collector) {
        LOGGER.info("Starting Feature collection...");

        try {
            TeamDataClient teamData = new TeamDataClient(this.featureCollectorRepository,
                    this.featureSettings, this.teamRepository, this.v1Connection);

            teamData.updateTeamInformation();

            ProjectDataClient projectData = new ProjectDataClient(this.featureSettings,
                    this.projectRepository, this.featureCollectorRepository, this.v1Connection);
            projectData.updateProjectInformation();

            StoryDataClient storyData = new StoryDataClient(this.featureSettings,
                    this.featureRepository, this.featureCollectorRepository, this.v1Connection);
            storyData.updateStoryInformation();
        } catch (HygieiaException he) {
            LOGGER.error("Error in collecting Version One Data: [" + he.getErrorCode() + "] "
                    + he.getMessage());
        }

        LOGGER.info("Feature Data Collection Finished");

    }
259442
def add_to_repos(self, repo):
        
        assert isinstance(repo, github.Repository.Repository), repo
        headers, data = self._requester.requestJsonAndCheck(
            "PUT",
            self.url + "/repos/" + repo._identity
        )
1334133
public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) {
    for (T item : items) {
      collection.add(item);
    }
  }
1087125
private function addRepositories(Pool $pool, array $repos)
    {
        foreach ($repos as $repo) {
            try {
                $pool->addRepository($repo);
            } catch (\Exception $exception) {
                if (!$this->skipErrors) {
                    throw $exception;
                }

                $this->output->writeln(sprintf("<error>Skipping Exception '%s'.</error>", $exception->getMessage()));
            }
        }
    }
604401
@Override
    public T addAsLibraries(final Archive<?>[]... archives) throws IllegalArgumentException {
        Validate.notNullAndNoNullValues(archives, "Archives must be specified");
        for (Archive<?>[] archiveArray : archives) {
            for (Archive<?> archive : archiveArray) {
                this.addAsLibraries(archive);
            }
        }
        return covarientReturn();
    }
302945
public void addCollectionColumnMetadata(CollectionColumnInfo collectionColumnMetadata)
    {
        if (this.collectionColumnMetadatas == null)
        {
            this.collectionColumnMetadatas = new ArrayList<CollectionColumnInfo>();
        }

        if (!collectionColumnMetadatas.contains(collectionColumnMetadata))
        {
            collectionColumnMetadatas.add(collectionColumnMetadata);
        }
    }
1142659
private function addResourceToRootCollectionIfNonExistant(&$collection, $resource)
    {
        $identifier = Utility::getProperty($resource, 'id');
        $exists = false;

        $copy = $collection instanceof Collection ? $collection->toArray() : $collection;

        foreach ($copy as $rootResource) {
            if ((int) Utility::getProperty($rootResource, 'id') === (int) $identifier) {
                $exists = true;
                break;
            }
        }

        if ($exists === false) {
            if (is_array($collection)) {
                $collection[] = $resource;
            } elseif ($collection instanceof Collection) {
                $collection->push($resource);
            }
        }
    }
1088831
@Override
	public void add(Collection<Object> values) {
		for(Object value : values)
			addOne(value);
	}
1138956
public static <T> Collection<T> addAll(Collection<T> collection, Iterable<T> iterable) {
		return addAll(collection, iterable.iterator());
	}
258612
def register(self, collector):
        
        if not isinstance(collector, Collector):
            raise TypeError(
                "Can't register instance, not a valid type of collector")

        if collector.name in self.collectors:
            raise ValueError("Collector already exists or name colision")

        with mutex:
            self.collectors[collector.name] = collector
1194719
@Override
    public <R, A> R collect(Collector<? super T, A, R> collector) {
        Predicate<A> finished = finished(collector);
        if (finished != null) {
            BiConsumer<A, ? super T> acc = collector.accumulator();
            BinaryOperator<A> combiner = collector.combiner();
            Spliterator<T> spliterator = spliterator();
            if (!isParallel()) {
                A a = collector.supplier().get();
                if (!finished.test(a)) {
                    try {
                        // forEachRemaining can be much faster
                        // and take much less memory than tryAdvance for certain
                        // spliterators
                        spliterator.forEachRemaining(e -> {
                            acc.accept(a, e);
                            if (finished.test(a))
                                throw new CancelException();
                        });
                    } catch (CancelException ex) {
                        // ignore
                    }
                }
                return collector.finisher().apply(a);
            }
            Spliterator<A> spltr;
            if (!spliterator.hasCharacteristics(Spliterator.ORDERED)
                || collector.characteristics().contains(Characteristics.UNORDERED)) {
                spltr = new UnorderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner,
                        finished);
            } else {
                spltr = new OrderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner, finished);
            }
            return collector.finisher().apply(
                new StreamEx<>(StreamSupport.stream(spltr, true), context).findFirst().get());
        }
        return rawCollect(collector);
    }
37614
public boolean addAll(Collection otherCollection,
                          Transaction transaction)
                    throws ObjectManagerException
    {
        boolean modified = false;
        try {
            for (Iterator iterator = otherCollection.iterator();;)
                modified = add((Token) iterator.next(transaction), transaction);
        } catch (java.util.NoSuchElementException exception) {
            // No FFDC code needed.
            // We have run off the end of the other collection.
        } // try.   
        return modified;
    }
617217
public void addCollection(Collection<? extends E> collection) {
		if (collection != null && !collection.isEmpty()) {
			this.collections.add(collection);
		}
	}
946707
public void setRepositories(java.util.Collection<RepositoryNameIdPair> repositories) {
        if (repositories == null) {
            this.repositories = null;
            return;
        }

        this.repositories = new java.util.ArrayList<RepositoryNameIdPair>(repositories);
    }