/*
First check in the map of regular stores. If not present, check in the
system stores map.
437831
@SuppressWarnings("unchecked")
    public RoutingStrategy getRoutingStrategy(String storeName) {
        // acquire read lock
        readLock.lock();
        try {
            Map<String, RoutingStrategy> routingStrategyMap = (Map<String, RoutingStrategy>) metadataCache.get(ROUTING_STRATEGY_KEY)
                                                                                                          .getValue();
            RoutingStrategy strategy = routingStrategyMap.get(storeName);
            if(strategy == null) {
                Map<String, RoutingStrategy> systemRoutingStrategyMap = (Map<String, RoutingStrategy>) metadataCache.get(SYSTEM_ROUTING_STRATEGY_KEY)
                                                                                                                    .getValue();
                strategy = systemRoutingStrategyMap.get(storeName);
            }
            return strategy;
        } finally {
            readLock.unlock();
        }
    }
825738
private boolean spaceExists(final StorageProvider store,
                                final String spaceId)
        throws TaskExecutionFailedException {
        try {
            return new Retrier().execute(new Retriable() {
                @Override
                public Boolean retry() throws Exception {
                    // The actual method being executed
                    store.getSpaceProperties(spaceId);
                    return true;
                }
            });
        } catch (NotFoundException nfe) {
            return false;
        } catch (Exception e) {
            String msg = "Error attempting to check if space exists: " +
                         e.getMessage();
            throw new DuplicationTaskExecutionFailedException(
                buildFailureMessage(msg), e);
        }
    }
839272
public Store getStore(StoreConfiguration storeConfiguration, List<Class<?>> types) {
        StoreKey key = StoreKey.builder().uri(storeConfiguration.getUri().normalize()).username(storeConfiguration.getUsername()).build();
        Store store = storesByKey.get(key);
        if (store == null) {
            store = StoreFactory.getStore(storeConfiguration);
            store.start(types);
            storesByKey.put(key, store);
            keysByStore.put(store, key);
        }
        return store;
    }
404052
@CanIgnoreReturnValue
  public Ordered containsExactlyEntriesIn(Map<?, ?> expectedMap) {
    if (expectedMap.isEmpty()) {
      if (actual().isEmpty()) {
        return IN_ORDER;
      } else {
        isEmpty(); // fails
        return ALREADY_FAILED;
      }
    }
    boolean containsAnyOrder =
        containsEntriesInAnyOrder(expectedMap, "contains exactly", /* allowUnexpected= */ false);
    if (containsAnyOrder) {
      return new MapInOrder(expectedMap, "contains exactly these entries in order");
    } else {
      return ALREADY_FAILED;
    }
  }
510560
def getStore(self) :
        """"""
        res = {}
        res.update(self.store)
        for k, v in self.subStores.items() :
            res[k] = v.getStore()
        
        return res
964485
function() {
    const Utils = this.definition.store.utils
    const self = this.chain()

    const includes = Utils.toIncludesList(Utils.args(arguments))
    const existingIncludes = self.getInternal('includes') || []
    const existingMap = {}

    existingIncludes.forEach(function(inc) {
      existingMap[inc.relation] = inc
    })

    includes.forEach(function(inc) {
      const relation = self.definition.relations[inc.relation]
      if (relation) {
        if (relation.through) inc.through = true
        if (existingMap[inc.relation]) return // ignore duplicated includes

        self.addInternal('includes', inc)
      } else {
        throw new Error(
          'Can\'t find relation "' +
            inc.relation +
            '" for ' +
            self.definition.modelName
        )
      }
    })

    return self
  }
814322
function checkContainingStores(objStoreNames) {
    return objStoreNames.every(function (storeName) {
        return (indexOf.call(this.database.objectStoreNames, storeName) !== -1);
    }, this);
}
602651
function _addStore(app, item) {
  if (!item.name || item.name === '') {
    try {
      if (typeof item.fn.publicName === 'string') item.name = item.fn.publicName;
    } catch (e) {
    }
  }
  if (item.name.indexOf('thorin-store-') === 0) {  // we trim it.
    item.name = item.name.substr(13);
  }
  if (typeof app[stores][item.name] !== 'undefined') {
    throw new Error('Thorin.addStore: store ' + item.name + " is already registered. Please use a different name.");
  }
  let storeObj = new item.fn(app);
  storeObj.setName(item.name);
  app[stores][item.name] = storeObj;
}
6524
protected function validateDataMapStore()
    {
        $field = 'data.map';
        $value = $this->getSubmitted($field);

        if (empty($value)) {
            return null;
        }

        $label = $this->translation->text('Map');

        if (!is_array($value) || count($value) != 2) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        if (count($value) != count(array_filter($value, 'is_numeric'))) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
647302
private Map findProviders() {
        Map providers = getContainer().getComponentDescriptorMap(Provider.class.getName());
        if (providers == null) {
            throw new Error("No providers discovered");
        }

        Set keys = providers.keySet();
        Map found = null;

        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            String key = (String)iter.next();

            Provider provider;

            try {
                provider = (Provider) getContainer().lookup(Provider.class.getName(), key);
            }
            catch (Exception e) {
                log.warn("Failed to lookup provider for key: {}", key, e);
                continue;
            }

            if (provider != null) {
                if (found == null) {
                    found = new HashMap();
                }

                found.put(key, provider);
            }
        }

        return found;
    }
201712
function(req, res) {
            var store = onmStoreDictionary[req.query.store];
            if ((store == null) || !store) {
                res.send(404, "Data store '" + req.query.store + "' does not exist.");
            } else {
                var addressHash = req.query.address || store.model.jsonTag;
                address = undefined
                try {
                    address = store.model.createAddressFromHashString(addressHash);
                    var namespace = store.openNamespace(address);
            
                    var addresses = [];

                    var processNamespace = function (address_) {
                        addresses.push(address_.getHashString());
                        var model = address_.getModel();
                        if (model.namespaceType === "extensionPoint") {
                            var namespace = store.openNamespace(address_);
                            namespace.visitExtensionPointSubcomponents( function(address_) {
                                processNamespace(address_);
                            });
                        } else {
                            address_.visitChildAddresses( function(address_) {
                                processNamespace(address_);
                            });
                        }
                    };

                    processNamespace(address);
                    var result = {};
                    result[req.query.store] = addresses;
                    res.send(200, result);
                } catch (exception) {
                    res.send(412, exception);
                }
           }
        }
146447
function isStore(object) {
    if (!object || typeof object !== 'object') {
        return false;
    }
    else if ('isStore' in object) {
        diag.debug.assert(function () { return object.isStore === Store.prototype.isPrototypeOf(object); });
        return object.isStore;
    }
    else {
        return Store.prototype.isPrototypeOf(object);
    }
}
451912
public static <K, V> MapDataStore<K, V> emptyStore() {
        return (MapDataStore<K, V>) EMPTY_MAP_DATA_STORE;
    }
505419
public BinaryStore findBinaryStoreContainingKey( BinaryKey key ) {
        Iterator<Map.Entry<String, BinaryStore>> binaryStoreIterator = getNamedStoreIterator();

        while (binaryStoreIterator.hasNext()) {
            BinaryStore bs = binaryStoreIterator.next().getValue();
            if (bs.hasBinary(key)) {
                return bs;
            }
        }

        return null;
    }
1100041
public boolean requiredPropertiesArePresent() {
        // trust store specified OR key store specified OR both -> valid
        boolean valid = (
        // explicit keystore and truststore exists
        (propertyExists(Constants.SSLPROP_KEY_STORE)
         && propertyExists(Constants.SSLPROP_TRUST_STORE)));
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "requiredPropertiesArePresent -> " + valid);
        return valid;
    }
671947
function hasLocalStorage() {
  if (!localstorage) {
    return false;
  }

  try {
    localstorage.setItem('0', '');
    localstorage.removeItem('0');
    return true;
  } catch (error) {
    return false;
  }
}
720369
private void checkAndStore(int bondToStore, IBond.Order bondOrder, ArrayList<Integer> singleVec,
            ArrayList<Integer> doubleVec, ArrayList<Integer> cycloexVec, int a1, ArrayList<Integer> atomVec,
            int sphere, boolean isBondInCycloex) {
        if (!atomVec.contains(Integer.valueOf(a1))) {
            if (sphere < 6) atomVec.add(Integer.valueOf(a1));
        }
        if (!cycloexVec.contains(Integer.valueOf(bondToStore))) {
            if (isBondInCycloex) {
                cycloexVec.add(bondToStore);
            }
        }
        if (bondOrder == IBond.Order.DOUBLE) {
            if (!doubleVec.contains(bondToStore)) doubleVec.add(bondToStore);
        }
        if (bondOrder == IBond.Order.SINGLE) {
            if (!singleVec.contains(Integer.valueOf(bondToStore))) singleVec.add(bondToStore);
        }
    }