Add any new {@link ArtifactItem}s
556396
private void addNewArtifactsItems(List<BaseArtifact> baseArtifacts, List<ArtifactItem> existingArtifactItems, ArtifactoryCollector collector) {
        long start = System.currentTimeMillis();
        List<BinaryArtifact> binaryArtifacts = new ArrayList<>();
        int count = 0;
        Set<ArtifactItem> existingSet = new HashSet<>(existingArtifactItems);
        for (BaseArtifact baseArtifact : baseArtifacts) {
            ArtifactItem newArtifactItem = baseArtifact.getArtifactItem();
            if (newArtifactItem != null && !existingSet.contains(newArtifactItem)) {
                newArtifactItem.setLastUpdated(System.currentTimeMillis());
                newArtifactItem.setCollectorId(collector.getId());
                newArtifactItem = artifactItemRepository.save(newArtifactItem);
                existingSet.add(newArtifactItem);
                BinaryArtifact binaryArtifact = baseArtifact.getBinaryArtifact();
                if (binaryArtifact != null) {
                    binaryArtifact.setCollectorItemId(newArtifactItem.getId());
                    binaryArtifacts.add(binaryArtifact);
                }
                count++;
            }
        }
        if (!binaryArtifacts.isEmpty()) {
            binaryArtifacts.forEach(binaryArtifact -> binaryArtifactRepository.save(binaryArtifact));
        }
        log("New artifacts", start, count);
    }
1086532
private <ItemT> void addInternal(@Nonnull Iterable<ItemT> items) {
        // Note that items can be a large lazily evaluated collection,
        // so this method is optimized to only iterate through it as much as needed.

        if (!items.iterator().hasNext()) {
            return;
        }

        nextBuildNumber = getNextBuildNumber(items.iterator().next());

        if (newerThan == null && olderThan == null) {
            // Just return the first page of entries (newest)
            Iterator<ItemT> iter = items.iterator();
            while (iter.hasNext()) {
                add(iter.next());
                if (isFull()) {
                    break;
                }
            }
            hasDownPage = iter.hasNext();
        } else if (newerThan != null) {
            int toFillCount = getFillCount();
            if (toFillCount > 0) {
                // Walk through the items and keep track of the oldest
                // 'toFillCount' items until we reach an item older than
                // 'newerThan' or the end of the list.
                LinkedList<ItemT> itemsToAdd = new LinkedList<>();
                Iterator<ItemT> iter = items.iterator();
                while (iter.hasNext()) {
                    ItemT item = iter.next();
                    if (HistoryPageEntry.getEntryId(item) > newerThan) {
                        itemsToAdd.addLast(item);

                        // Discard an item off the front of the list if we have
                        // to (which means we would be able to page up).
                        if (itemsToAdd.size() > toFillCount) {
                            itemsToAdd.removeFirst();
                            hasUpPage = true;
                        }
                    } else {
                        break;
                    }
                }
                if (itemsToAdd.size() == 0) {
                    // All builds are older than newerThan ?
                    hasDownPage = true;
                } else {
                    // If there's less than a full page of items newer than
                    // 'newerThan', then it's ok to fill the page with older items.
                    if (itemsToAdd.size() < toFillCount) {
                        // We have to restart the iterator and skip the items that we added (because
                        // we may have popped an extra item off the iterator that did not get added).
                        Iterator<ItemT> skippedIter = items.iterator();
                        Iterators.skip(skippedIter, itemsToAdd.size());
                        for (int i = itemsToAdd.size(); i < toFillCount && skippedIter.hasNext(); i++) {
                            ItemT item = skippedIter.next();
                            itemsToAdd.addLast(item);
                        }
                    }
                    hasDownPage = iter.hasNext();
                    for (Object item : itemsToAdd) {
                        add(item);
                    }
                }
            }
        } else if (olderThan != null) {
            Iterator<ItemT> iter = items.iterator();
            while (iter.hasNext()) {
                Object item = iter.next();
                if (HistoryPageEntry.getEntryId(item) >= olderThan) {
                    hasUpPage = true;
                } else {
                    add(item);
                    if (isFull()) {
                        hasDownPage = iter.hasNext();
                        break;
                    }
                }
            }
        }
    }
499872
def _add_new_items(self, config, seen):
        ''''''
        for (key, value) in self.items():
            if key not in seen:
                self._set_value(config, key, value)
1176620
public void add(ArtifactInfo<BundleInfoContext> bundleInfo) {
        List<ArtifactInfo<BundleInfoContext>> list = artifacts.get(bundleInfo.getId());
        if (list == null) {
            list = new ArrayList<>();
            artifacts.put(bundleInfo.getId(), list);
        }
        list.add(bundleInfo);
        Collections.sort(list, Collections.reverseOrder());
    }
203667
public TableWriteItems addItemToPut(Item item) {
        if (item != null) {
            if (itemsToPut == null)
                itemsToPut = new ArrayList<Item>();
            this.itemsToPut.add(item);
        }
        return this;
    }
449328
public void addNewItem(M newItem) {
    if (this.items == null) {
      this.items = createEmptyList();
    }

    this.items.add(newItem);
  }
668260
@SafeVarargs
    public final FastItemAdapter<Item> add(int position, Item... items) {
        getItemAdapter().add(position, items);
        return this;
    }
166337
def _ReloadArtifacts(self):
    """"""
    self._artifacts = {}
    self._LoadArtifactsFromFiles(self._sources.GetAllFiles())
    self.ReloadDatastoreArtifacts()
1140957
public void addItem (@Nonnull final ReIndexWorkItem aItem) throws IllegalStateException
  {
    ValueEnforcer.notNull (aItem, "Item");
    m_aRWLock.writeLocked ( () -> {
      internalCreateItem (aItem);
    });
    LOGGER.info ("Added " + aItem.getLogText () + " to re-try list for retry #" + (aItem.getRetryCount () + 1));
  }
564622
private void addNewArtifacts(List<ArtifactoryRepo> enabledRepos) {
        long start = System.currentTimeMillis();

        int count = 0;
        for (ArtifactoryRepo repo : enabledRepos) {
            for (BinaryArtifact artifact : nullSafe(artifactoryClient.getArtifacts(repo.getInstanceUrl(), repo.getRepoName(), repo.getLastUpdated()))) {
                if (artifact != null && isNewArtifact(repo, artifact)) {
                    artifact.setCollectorItemId(repo.getId());
                    binaryArtifactRepository.save(artifact);
                    count++;
                }
            }
        }

        // Iterate through list of repos and update the lastUpdated timestamp
        for (ArtifactoryRepo repo : enabledRepos) {
            repo.setLastUpdated(start);
        }
        // We set the last update time so need to save it
        artifactoryRepoRepository.save(enabledRepos);
        log("New artifacts", start, count);
    }
88828
protected function wizardAddCollectionItem()
    {
        $this->validatePrompt('collection_id', $this->text('Collection ID'), 'collection_item');
        $this->validatePrompt('entity_id', $this->text('Entity ID'), 'collection_item');
        $this->validatePrompt('weight', $this->text('Weight'), 'collection_item', 0);
        $this->validatePrompt('status', $this->text('Status'), 'collection_item', 0);
        $this->validatePrompt('data', $this->text('Data'), 'collection_item');

        $this->validateComponent('collection_item');
        $this->addCollectionItem();
    }
533141
public DrawerView addItem(DrawerItem item) {
        if (item.getId() <= 0) {
            item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
        }
        for (DrawerItem oldItem : mAdapter.getItems()) {
            if (oldItem.getId() == item.getId()) {
                mAdapter.remove(oldItem);
                break;
            }
        }

        item.attachTo(mAdapter);
        mAdapter.add(item);
        updateList();
        return this;
    }
355823
def add_item(self, item):
        
        self.items.append(item)
        self.last_updated = datetime.datetime.now()
525958
@Override
    protected MavenFormatStage createFormatStage(final Collection<MavenResolvedArtifact> filteredArtifacts)
            throws IllegalArgumentException {
        assert filteredArtifacts != null : "filtered artifacts are required";
        return new MavenFormatStageImpl(filteredArtifacts);
    }
164613
function add(scope, element) {
        updateDelayed();

        items.push({
            element: element,
            scope:   scope
        });
    }
1358437
def addItem( self, item ):
        
        result = super(XNodeScene, self).addItem(item)
        self.setModified()
        self._cache.add(item)
        
        return result
1190690
@Override
  public PackageDescriptor add(String pm, String groupId, String artifactId, String version) {
    PackageCoordinate pkg = PackageCoordinate.newBuilder()
        .withFormat(pm)
        .withNamespace(groupId)
        .withName(artifactId)
        .withVersion(version)
        .build();
    return add(Collections.singletonList(pkg));
  }