Behaves like {@link #store(List)} except that duplicates do not throw an exception but are overwritten as
described in {@link #storeOverwriteExisting(Entry)}. Note that this action is not atomic.
173032
public void storeOverwriteExisting(List<Entry> entries) throws NoSuchNodeException, MissingParentException {
        for (Entry entry : entries) {
            try {
                store(entry);
            } catch (EntryAlreadyExistsException e) {
                deleteSubtreeIncludingRoot(e.getEntry().getDn());
                try {
                    store(entry);
                } catch (EntryAlreadyExistsException e1) {
                    LOGGER.debug("should never reach here");
                    throw new LdapDaoException(e1);
                }
            }
        }
    }
44360
protected void updateOverwriteExisting() {

        if (m_overwriteExisting != null) {
            boolean move = (m_dialogMode == DialogMode.move) || (m_actionCombo.getValue() == Action.move);
            if (move) {
                m_overwriteExisting.setValue(Boolean.FALSE);
                m_overwriteExisting.setVisible(false);
            } else {
                m_overwriteExisting.setVisible(true);
            }
        }
    }
177105
public final void overwrite(Map<Object, Object> data) {
        internalData.clear();
        internalData.putAll(data);
    }
648660
private boolean sortedAndUnique(String[] keyList, int size)
      throws IOException {
    if (!closed) {
      for (int i = 1; i < size; i++) {
        if (keyList[(i - 1)].compareTo(keyList[i]) >= 0) {
          return false;
        }
      }
      return true;
    } else {
      throw new IOException("already closed");
    }
  }
408213
@Override
    public void afterWrite(List<? extends SnapshotContentItem> items) {
        //be sure not to count snapshot prop file.
        int size = items.size();
        for (SnapshotContentItem item : items) {
            if (item.getContentId().equals(Constants.SNAPSHOT_PROPS_FILENAME)) {
                size -= 1;
            }
        }
        addToItemsRead(size);
    }
796116
@Override
  public WriteLockedOffHeapHashMap<K, V> newInstance() {
    StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance();
    try {
      return new WriteLockedOffHeapHashMap<>(tableSource, storageEngine, tableSize);
    } catch (RuntimeException e) {
      storageEngine.destroy();
      throw e;
    }
  }
984346
public static void compareAndCheck(String[] list, String[] original,
      String nameNew, String nameOriginal, Boolean unique) throws IOException {
    if (list != null) {
      if (list.length != original.length) {
        throw new IOException(
            "unequal size " + nameNew + " and " + nameOriginal);
      }
      if (unique) {
        Set<String> set = new HashSet<>();
        for (int i = 0; i < list.length; i++) {
          set.add(list[i]);
        }
        if (set.size() < list.length) {
          throw new IOException("duplicate " + nameNew);
        }
      }
    }
  }
8251
public boolean duplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) {
        Set<SchemaTable> alreadyVisited = new HashSet<>();
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (!alreadyVisited.contains(schemaTableTree.getSchemaTable())) {
                alreadyVisited.add(schemaTableTree.getSchemaTable());
            } else {
                return true;
            }
        }
        return false;
    }
975092
public boolean isRedundant() {
    if (isListChange()) {
      return Objects.equals(oldList.get(),newList.get());
    }
    return oldValue.get().equals(newValue.get());
  }
185168
private boolean insertIndexEntry(final S userStorable, final Storable indexEntry)
        throws PersistException
    {
        if (indexEntry.tryInsert()) {
            return true;
        }

        // If index entry already exists, then index might be corrupt.
        try {
            Storable freshIndexEntry = mIndexEntryStorage.prepare();
            mAccessor.copyFromMaster(freshIndexEntry, userStorable);
            freshIndexEntry.load();
            indexEntry.copyVersionProperty(freshIndexEntry);
            if (freshIndexEntry.equals(indexEntry)) {
                // Existing entry is fine.
                return true;

            } else {
                S freshMasterEntry = mMasterStorage.prepare();
                mAccessor.copyToMasterPrimaryKey(freshIndexEntry, freshMasterEntry);
                
                if (!freshMasterEntry.tryLoad()) {
                    // Existing entry for alternate key is bogus. Delete it.
                    freshIndexEntry.delete();
                    indexEntry.insert();
                    return true;
                }
            }

        } catch (FetchException e) {
            throw e.toPersistException();
        }

        return false;
    }
918748
public final boolean filestoreExists() {

        String thisMethodName = "filestoreExists";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, new Boolean(false));
        }

        return true;
    }
1158839
public void put(String key, ArrayList<String> value) {
    Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
    while (it.hasNext()) {
      Pair<String, ArrayList<String>> pair = it.next();
      if (key.equals(pair.first)) {
        pair.second = value;
        return;
      }
    }
    store.add(new Pair<>(key, value));
  }
1127102
public List<T> getPermutation(List<T> storage) {
		if( storage == null )
			storage = new ArrayList<T>();
		else
			storage.clear();

		for( int i = 0; i < list.size(); i++ ) {
			storage.add(get(i));
		}

		return storage;
	}
746861
List<JcError> store(Map<Long, Integer> elementVersionsMap) {
		List<JcError> ret = null;
		ITransaction txToClose = null;
		try {
			if (isModified()) {
				txToClose = this.resultHandler.createLockingTxIfNeeded();
				ret = this.resultHandler.store(elementVersionsMap);
			} else
				ret = Collections.emptyList();
		} finally {
			if (txToClose != null) { // we have created the transaction
				if (ret == null)
					ret = new ArrayList<JcError>();
				ret.addAll(txToClose.close());
			}
		}
		return ret;
	}
655685
private static void checkDuplicates(ImmutableList<SQLPPTriplesMap> mappings)
            throws DuplicateMappingException {

        Set<SQLPPTriplesMap> mappingSet = new HashSet<>(mappings);

        int duplicateCount = mappings.size() - mappingSet.size();

        /**
         * If there are some triplesMaps, finds them
         */
        if (duplicateCount > 0) {
            Set<String> duplicateIds = new HashSet<>();
            int remaining = duplicateCount;
            for (SQLPPTriplesMap mapping : mappings) {
                if (mappingSet.contains(mapping)) {
                    mappingSet.remove(mapping);
                }
                /**
                 * Duplicate
                 */
                else {
                    duplicateIds.add(mapping.getId());
                    if (--remaining == 0)
                        break;
                }
            }
            //TODO: indicate the source
            throw new DuplicateMappingException(String.format("Found %d duplicates in the following ids: %s",
                    duplicateCount, duplicateIds.toString()));
        }
    }
669702
public boolean copyChanges(final TreeRule rule, final boolean overwrite) {
    if (rule == null) {
      throw new IllegalArgumentException("Cannot copy a null rule");
    }
    if (tree_id != rule.tree_id) {
      throw new IllegalArgumentException("Tree IDs do not match");
    }
    if (level != rule.level) {
      throw new IllegalArgumentException("Levels do not match");
    }
    if (order != rule.order) {
      throw new IllegalArgumentException("Orders do not match");
    }
    
    if (overwrite || (rule.changed.get("type") && type != rule.type)) {
      type = rule.type;
      changed.put("type", true);
    }
    if (overwrite || (rule.changed.get("field") && !field.equals(rule.field))) {
      field = rule.field;
      changed.put("field", true);
    }
    if (overwrite || (rule.changed.get("custom_field") && 
        !custom_field.equals(rule.custom_field))) {
      custom_field = rule.custom_field;
      changed.put("custom_field", true);
    }
    if (overwrite || (rule.changed.get("regex") && !regex.equals(rule.regex))) {
      // validate and compile via the setter
      setRegex(rule.regex);
    }
    if (overwrite || (rule.changed.get("separator") && 
        !separator.equals(rule.separator))) {
      separator = rule.separator;
      changed.put("separator", true);
    }
    if (overwrite || (rule.changed.get("description") &&
        !description.equals(rule.description))) {
      description = rule.description;
      changed.put("description", true);
    }
    if (overwrite || (rule.changed.get("notes") && !notes.equals(rule.notes))) {
      notes = rule.notes;
      changed.put("notes", true);
    }
    if (overwrite || (rule.changed.get("regex_group_idx") && 
        regex_group_idx != rule.regex_group_idx)) {
      regex_group_idx = rule.regex_group_idx;
      changed.put("regex_group_idx", true);
    }
    if (overwrite || (rule.changed.get("display_format") && 
        !display_format.equals(rule.display_format))) {
      display_format = rule.display_format;
      changed.put("display_format", true);
    }
    for (boolean has_changes : changed.values()) {
      if (has_changes) {
        return true;
      }
    }
    return false;
  }
730949
@Override
	protected void save(List<Counter> counters) {
		if (_logger == null)
			return;
		if (counters.size() == 0)
			return;

		Collections.sort(counters, (c1, c2) -> c1.getName().compareTo(c2.getName()));

		for (Counter counter : counters) {
			_logger.info("counters", counterToString(counter));
		}
	}