Verifies this library is loaded properly.

@throws UnsatisfiedLinkError if the library failed to load properly.
326168
public static void checkLoaded() {
    if (LOAD_ERROR != null) {
      throw LOAD_ERROR;
    }
    // Make a test call, sometimes the error won't occur until you try the native method.
    // 2 ^ 3 = 8, 8 mod 5 = 3
    BigInteger two = BigInteger.valueOf(2);
    BigInteger three = BigInteger.valueOf(3);
    BigInteger four = BigInteger.valueOf(4);
    BigInteger five = BigInteger.valueOf(5);
    BigInteger answer;

    answer = modPowInsecure(two, three, five);
    if (!three.equals(answer)) {
      throw new AssertionError("libgmp is loaded but modPowInsecure returned the wrong answer");
    }

    answer = modPowSecure(two, three, five);
    if (!three.equals(answer)) {
      throw new AssertionError("libgmp is loaded but modPowSecure returned the wrong answer");
    }

    int answr = kronecker(four, five);
    if (answr != 1) {
      throw new AssertionError("libgmp is loaded but kronecker returned the wrong answer");
    }
  }
645644
private void validate() throws IOException {
        if (null != _error) {
            throw _error;
        }
        
        if(!_isReadLine && !_isReady){
            //If there is no data available then isReady will have returned false and this throw an IllegalStateException
            if (TraceComponent.isAnyTracingEnabled() && tc.isErrorEnabled())
                Tr.error(tc, "read.failed.isReady.false");
            throw new IllegalStateException(Tr.formatMessage(tc, "read.failed.isReady.false"));
        }
    }
1022621
@Nullable
  public boolean loadLibraries() {
    synchronized (mLock) {
      if (mLoadLibraries == false) {
        return mLibrariesLoaded;
      }
      try {
        if (mLibraryNames != null) {
          for (String name : mLibraryNames) {
            SoLoader.loadLibrary(name);
          }
        }
        initialNativeCheck();
        mLibrariesLoaded = true;
        mLibraryNames = null;
      } catch (UnsatisfiedLinkError error) {
        Log.e(TAG, "Failed to load native lib (initial check): ", error);
        mLinkError = error;
        mLibrariesLoaded = false;
      } catch (Throwable other) {
        Log.e(TAG, "Failed to load native lib (other error): ", other);
        mLinkError = new UnsatisfiedLinkError("Failed loading libraries");
        mLinkError.initCause(other);
        mLibrariesLoaded = false;
      }
      mLoadLibraries = false;
      return mLibrariesLoaded;
    }
  }
120445
private void ensureRocksDBIsLoaded(String tempDirectory) throws IOException {
		synchronized (RocksDBStateBackend.class) {
			if (!rocksDbInitialized) {

				final File tempDirParent = new File(tempDirectory).getAbsoluteFile();
				LOG.info("Attempting to load RocksDB native library and store it under '{}'", tempDirParent);

				Throwable lastException = null;
				for (int attempt = 1; attempt <= ROCKSDB_LIB_LOADING_ATTEMPTS; attempt++) {
					try {
						// when multiple instances of this class and RocksDB exist in different
						// class loaders, then we can see the following exception:
						// "java.lang.UnsatisfiedLinkError: Native Library /path/to/temp/dir/librocksdbjni-linux64.so
						// already loaded in another class loader"

						// to avoid that, we need to add a random element to the library file path
						// (I know, seems like an unnecessary hack, since the JVM obviously can handle multiple
						//  instances of the same JNI library being loaded in different class loaders, but
						//  apparently not when coming from the same file path, so there we go)

						final File rocksLibFolder = new File(tempDirParent, "rocksdb-lib-" + new AbstractID());

						// make sure the temp path exists
						LOG.debug("Attempting to create RocksDB native library folder {}", rocksLibFolder);
						// noinspection ResultOfMethodCallIgnored
						rocksLibFolder.mkdirs();

						// explicitly load the JNI dependency if it has not been loaded before
						NativeLibraryLoader.getInstance().loadLibrary(rocksLibFolder.getAbsolutePath());

						// this initialization here should validate that the loading succeeded
						RocksDB.loadLibrary();

						// seems to have worked
						LOG.info("Successfully loaded RocksDB native library");
						rocksDbInitialized = true;
						return;
					}
					catch (Throwable t) {
						lastException = t;
						LOG.debug("RocksDB JNI library loading attempt {} failed", attempt, t);

						// try to force RocksDB to attempt reloading the library
						try {
							resetRocksDBLoadedFlag();
						} catch (Throwable tt) {
							LOG.debug("Failed to reset 'initialized' flag in RocksDB native code loader", tt);
						}
					}
				}

				throw new IOException("Could not load the native RocksDB library", lastException);
			}
		}
	}
958123
private void validate() {
        LibraryUtils.checkArgumentNotNull(config, "configuration is null");
        LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
        LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
        LibraryUtils.checkArgumentNotNull(s3Client, "s3Client is null");
    }
56570
public boolean validateJdbc() {

        boolean result = false;
        String libFolder = getLibFolder();
        Iterator<String> it = getDatabaseLibs(getDatabase()).iterator();
        while (it.hasNext()) {
            String libName = it.next();
            File libFile = new File(libFolder, libName);
            if (libFile.exists()) {
                result = true;
            }
        }
        return result;
    }
105994
@SuppressLint("NewApi")
	protected boolean isActivitiyDestroyed() {

		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
			return mActivity.isFinishing() || mActivity.isDestroyed();
		} else {
			return mActivity.isFinishing();
		}

	}
788665
public final boolean loadOwnedLinks() throws SevereMessageStoreException
    {
        boolean loaded = false;
        if (null == _references)
        {
            _references();
            loaded = true;
        }
        return loaded;
    }
874796
def is_prelinked_bytecode(bytecode: bytes, link_refs: List[Dict[str, Any]]) -> bool:
    
    for link_ref in link_refs:
        for offset in link_ref["offsets"]:
            try:
                validate_empty_bytes(offset, link_ref["length"], bytecode)
            except ValidationError:
                return True
    return False
1065428
private void validate() {
        List<String> missingElements = new LinkedList<>();
        if (host == null) {
            missingElements.add("host");
        }

        if (protocol != null
            && !protocol.equalsIgnoreCase("noop")
            && !protocol.equalsIgnoreCase("out")) {

            if (publicKey == null) {
                missingElements.add("public key");
            }
            if (projectId == null || projectId.isEmpty()) {
                missingElements.add("project ID");
            }
        }

        if (!missingElements.isEmpty()) {
            throw new InvalidDsnException("Invalid DSN, the following properties aren't set '" + missingElements + "'");
        }
    }
1268620
def _verify_download_complete(self):
        
        if self.actual_bytes_read > self.bytes_to_read:
            raise TooLargeChunkDownloadError(self.actual_bytes_read, self.bytes_to_read, self.local_path)
        elif self.actual_bytes_read < self.bytes_to_read:
            raise PartialChunkDownloadError(self.actual_bytes_read, self.bytes_to_read, self.local_path)
492727
protected final void verify() {
        collectInitialisers();
        verifyCandidates();
        verifyInitialisers();
        collectPossibleInitialValues();
        verifyPossibleInitialValues();
        collectEffectiveAssignmentInstructions();
        verifyEffectiveAssignmentInstructions();
        collectAssignmentGuards();
        verifyAssignmentGuards();
        end();
    }
727141
@Override
    public Boolean isReady() {
        try {
            validateInitialization();
            validateActivation();
            validateMiddleware();
            return true;
        } catch (InvalidStateException e) {
            return false;
        }
    }
121723
private void verify() {
		if (!this.encoded) {
			return;
		}
		verifyUriComponent(getScheme(), Type.SCHEME);
		verifyUriComponent(this.userInfo, Type.USER_INFO);
		verifyUriComponent(this.host, getHostType());
		this.path.verify();
		for (Map.Entry<String, List<String>> entry : queryParams.entrySet()) {
			verifyUriComponent(entry.getKey(), Type.QUERY_PARAM);
			for (String value : entry.getValue()) {
				verifyUriComponent(value, Type.QUERY_PARAM);
			}
		}
		verifyUriComponent(getFragment(), Type.FRAGMENT);
	}
1194748
private void validate() throws MojoExecutionException {
		if ((file == null && libId == null) || (file != null && libId != null)) {
			getLog()
					.warn(
							"You specified <file> and <libId>.  The <libId> always wins.");
		}

		// check that COM target exists
		if (file != null && !file.exists()) {
			getLog().warn("Can't find file: " + file);
			throw new MojoExecutionException(
					"The native COM target file couldn't be found: " + file);
		}
	}
902694
private void verifyLink(TableDefinition tableDef, FieldDefinition linkDef) {
        String extent = linkDef.getLinkExtent();
        TableDefinition extentTableDef = getTableDef(extent);
        if (extentTableDef == null) {
            extentTableDef = new TableDefinition();
            extentTableDef.setTableName(extent);
            tableDef.getAppDef().addTable(extentTableDef);
        }
        
        String inverse = linkDef.getLinkInverse();
        FieldDefinition inverseLinkDef = extentTableDef.getFieldDef(inverse);
        if (inverseLinkDef == null) {
            inverseLinkDef = new FieldDefinition(inverse);
            inverseLinkDef.setType(linkDef.getType());
            inverseLinkDef.setLinkInverse(linkDef.getName());
            inverseLinkDef.setLinkExtent(tableDef.getTableName());
            extentTableDef.addFieldDefinition(inverseLinkDef);
        } else {
            Utils.require(inverseLinkDef.getType() == linkDef.getType() &&  // both link or xlink
                          inverseLinkDef.getLinkExtent().equals(tableDef.getTableName()) &&
                          inverseLinkDef.getLinkInverse().equals(linkDef.getName()),
                          "Link '%s' in table '%s' conflicts with inverse field '%s' in table '%s'",
                          linkDef.getName(), tableDef.getTableName(),
                          inverseLinkDef.getName(), extentTableDef.getTableName());
        }
    }
291238
private void verify() {
        Utils.require(!Utils.isEmpty(m_name), "Field name is required");
        Utils.require(m_type != null, "Field type is required");
        
        // If an 'inverse' or 'table' was specified, type must be LINK or XLINK.
        Utils.require(m_linkInverse == null || m_type.isLinkType(),
                      "'inverse' not allowed for this field type: " + m_name);
        Utils.require(m_linkExtent == null || m_type.isLinkType(),
                      "'table' not allowed for this field type: " + m_name);
        
        // LINK and XLINK require an 'inverse'.
        Utils.require(!m_type.isLinkType() || m_linkInverse != null,
                      "Missing 'inverse' option: " + m_name);
        
        // XLINK requires a junction field: default is "_ID".
        if (!Utils.isEmpty(m_junctionField)) {
            Utils.require(m_type == FieldType.XLINK, "'junction' is only allowed for xlinks");
        } else if (m_type == FieldType.XLINK) {
            m_junctionField = "_ID";
        }
        
        // If collection was not explicitly set, set to true for links and false for scalars
        if (!m_bIsCollection && m_type.isLinkType()) {
            m_bIsCollection = true;
        }
        
        // 'analyzer' can only be set for scalar field types, but don't verify value here.
        Utils.require(m_analyzerName == null || m_type.isScalarType(),
                      "'analyzer' can only be specified for scalar field types: " + m_analyzerName);
        
        // If this is a binary field, ensure "encoding" is set.
        if (m_encoding != null) {
            Utils.require(m_type == FieldType.BINARY, "'encoding' is only valid for binary fields");
        } else if (m_type == FieldType.BINARY) {
            m_encoding = EncodingType.getDefaultEncoding();
        }
        
        // Binary fields cannot be collections.
        Utils.require(m_type != FieldType.BINARY || !m_bIsCollection,
                      "Binary fields cannot be collections (multi-valued)");
    }