Returns the lenient scanner provider.  If none was set, and lenient parse is
enabled, this will attempt to instantiate a default scanner, setting it if
it was successful.  Otherwise this returns false.

@see #setLenientScannerProvider
169802
public RbnfLenientScannerProvider getLenientScannerProvider() {
        // there's a potential race condition if two threads try to set/get the scanner at
        // the same time, but you get what you get, and you shouldn't be using this from
        // multiple threads anyway.
        if (scannerProvider == null && lenientParse && !lookedForScanner) {
            try {
                lookedForScanner = true;
                Class<?> cls = Class.forName("android.icu.impl.text.RbnfScannerProviderImpl");
                RbnfLenientScannerProvider provider = (RbnfLenientScannerProvider)cls.newInstance();
                setLenientScannerProvider(provider);
            }
            catch (Exception e) {
                // any failure, we just ignore and return null
            }
        }

        return scannerProvider;
    }
580630
public SessionProvider getSessionProvider(Object key)
   {
      if (providers.containsKey(key))
      {
         return providers.get(key);
      }
      else
      {
         throw new IllegalArgumentException("SessionProvider is not initialized");
      }
   }
193083
private static synchronized KeyManager[] getDefaultKeyManager() throws KeyStoreException, NoSuchProviderException,
    IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException {
    final String defaultKeyStore = System.getProperty("javax.net.ssl.keyStore", "");
    String defaultKeyStoreType = System.getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
    String defaultKeyStoreProvider = System.getProperty("javax.net.ssl.keyStoreProvider", "");

    logDebug("keyStore is : " + defaultKeyStore);
    logDebug("keyStore type is : " + defaultKeyStoreType);
    logDebug("keyStore provider is : " + defaultKeyStoreProvider);

    if (P11KEYSTORE.equals(defaultKeyStoreType) && !NONE.equals(defaultKeyStore)) {
      throw new IllegalArgumentException("if keyStoreType is " + P11KEYSTORE + ", then keyStore must be " + NONE);
    }

    KeyStore ks = null;
    String defaultKeyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword", "");
    char[] passwd = defaultKeyStorePassword.isEmpty() ? null : defaultKeyStorePassword.toCharArray();

    // Try to initialize key store.
    if (!defaultKeyStoreType.isEmpty()) {
      logDebug("init keystore");
      if (defaultKeyStoreProvider.isEmpty()) {
        ks = KeyStore.getInstance(defaultKeyStoreType);
      } else {
        ks = KeyStore.getInstance(defaultKeyStoreType, defaultKeyStoreProvider);
      }
      if (!defaultKeyStore.isEmpty() && !NONE.equals(defaultKeyStore)) {
        try (FileInputStream fs = new FileInputStream(defaultKeyStore)) {
          ks.load(fs, passwd);
        }
      } else {
        ks.load(null, passwd);
      }
    }

    // Try to initialize key manager.
    logDebug("init keymanager of type " + KeyManagerFactory.getDefaultAlgorithm());
    KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());

    if (P11KEYSTORE.equals(defaultKeyStoreType)) {
      // do not pass key passwd if using token
      kmf.init(ks, null);
    } else {
      kmf.init(ks, passwd);
    }

    return kmf.getKeyManagers();
  }
522861
public static LogWatchBuilder getDefault() {
        final ServiceLoader<LogWatchBuilder> ldr = ServiceLoader.load(LogWatchBuilder.class);
        if (!ldr.iterator().hasNext()) {
            throw new IllegalStateException("No LogWatchBuilder implementation registered.");
        }
        return ldr.iterator().next();
    }
1246776
private static ServiceProviderFinder _getServiceProviderFinderFromInitParam(ExternalContext context)
    {
        String initializerClassName = context.getInitParameter(SERVICE_PROVIDER_FINDER_PARAM);
        if (initializerClassName != null)
        {
            try
            {
                // get Class object
                Class<?> clazz = ClassUtils.classForName(initializerClassName);
                if (!ServiceProviderFinder.class.isAssignableFrom(clazz))
                {
                    throw new FacesException("Class " + clazz 
                            + " does not implement ServiceProviderFinder");
                }
                
                // create instance and return it
                return (ServiceProviderFinder) ClassUtils.newInstance(clazz);
            }
            catch (ClassNotFoundException cnfe)
            {
                throw new FacesException("Could not find class of specified ServiceProviderFinder", cnfe);
            }
        }
        return null;
    }
1009880
public java.lang.String getProviderId() {
    java.lang.Object ref = providerId_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      providerId_ = s;
      return s;
    }
  }
544363
public static ScannerFactory instance(Context context) {
        ScannerFactory instance = context.get(scannerFactoryKey);
        if (instance == null)
            instance = new ScannerFactory(context);
        return instance;
    }
708016
private List<ScannerPlugin<?, ?>> getScannerPluginsForType(final Class<?> type) {
        List<ScannerPlugin<?, ?>> plugins = scannerPluginsPerType.get(type);
        if (plugins == null) {
            // The list of all scanner plugins which accept the given type
            final List<ScannerPlugin<?, ?>> candidates = new LinkedList<>();
            // The map of scanner plugins which produce a descriptor type
            final Map<Class<? extends Descriptor>, Set<ScannerPlugin<?, ?>>> pluginsByDescriptor = new HashMap<>();
            for (ScannerPlugin<?, ?> scannerPlugin : scannerPlugins.values()) {
                Class<?> scannerPluginType = scannerPlugin.getType();
                if (scannerPluginType.isAssignableFrom(type)) {
                    Class<? extends Descriptor> descriptorType = scannerPlugin.getDescriptorType();
                    Set<ScannerPlugin<?, ?>> pluginsForDescriptorType = pluginsByDescriptor.get(descriptorType);
                    if (pluginsForDescriptorType == null) {
                        pluginsForDescriptorType = new HashSet<>();
                        pluginsByDescriptor.put(descriptorType, pluginsForDescriptorType);
                    }
                    pluginsForDescriptorType.add(scannerPlugin);
                    candidates.add(scannerPlugin);
                }
            }
            // Order plugins by the values of their optional @Requires
            // annotation
            plugins = DependencyResolver.newInstance(candidates, new DependencyProvider<ScannerPlugin<?, ?>>() {
                @Override
                public Set<ScannerPlugin<?, ?>> getDependencies(ScannerPlugin<?, ?> dependent) {
                    Set<ScannerPlugin<?, ?>> dependencies = new HashSet<>();
                    Requires annotation = dependent.getClass().getAnnotation(Requires.class);
                    if (annotation != null) {
                        for (Class<? extends Descriptor> descriptorType : annotation.value()) {
                            Set<ScannerPlugin<?, ?>> pluginsByDescriptorType = pluginsByDescriptor.get(descriptorType);
                            if (pluginsByDescriptorType != null) {
                                for (ScannerPlugin<?, ?> scannerPlugin : pluginsByDescriptorType) {
                                    if (!scannerPlugin.equals(dependent)) {
                                        dependencies.add(scannerPlugin);
                                    }
                                }
                            }
                        }
                    }
                    return dependencies;
                }
            }).resolve();
            scannerPluginsPerType.put(type, plugins);
        }
        return plugins;
    }
205184
public Set<Class<?>> scan() {
		for (URL url : ResourceUtil.getResourceIter(this.packagePath)) {
			switch (url.getProtocol()) {
			case "file":
				scanFile(new File(URLUtil.decode(url.getFile(), this.charset.name())), null);
				break;
			case "jar":
				scanJar(URLUtil.getJarFile(url));
				break;
			}
		}
		
		if(CollUtil.isEmpty(this.classes)) {
			scanJavaClassPaths();
		}
		
		return Collections.unmodifiableSet(this.classes);
	}
1149704
@Override
    @SuppressWarnings("unchecked")
    public Class<ValidationProvider<?>> getDefaultProviderClass() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "getDefaultProviderClass");
        }
        Class<ValidationProvider<?>> clazz = null;

        if (defaultProvider != null) {
            // default provider is specified so get a class to it.
            String provider = defaultProvider;
            // load the class for the provider
            try {
                clazz = (Class<ValidationProvider<?>>) loadClass(provider);
            } catch (Throwable t) {
                FFDCFilter.processException(t, CLASS_NAME + ".getDefaultProvider", "217");

                // message and exception printed out in previous method called.
                // however since we can not create a validation factory throw validationException
                ValidationException e = new ValidationException(t);
                throw e;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "getDefaultProviderClass", clazz);
        }
        return clazz;
    }
327957
@Override
    public IProvider getProviderFromProviderXML(eu.atos.sla.parser.data.Provider providerXML) {

        IProvider provider = new eu.atos.sla.datamodel.bean.Provider();

        if (providerXML.getUuid() != null) {

            provider.setUuid(providerXML.getUuid());
        } else {

            provider.setUuid(UUID.randomUUID().toString());
        }

        if (providerXML.getName() != null) {
            provider.setName(providerXML.getName());
        }

        return provider;
    }
1286066
def get(scanner_class, properties):
    
    assert issubclass(scanner_class, Scanner)
    assert is_iterable_typed(properties, basestring)
    scanner_name = str(scanner_class)

    if not registered(scanner_name):
        raise BaseException ("attempt to get unregisted scanner: %s" % scanner_name)

    relevant_properties = __scanners[scanner_name]
    r = property.select(relevant_properties, properties)

    scanner_id = scanner_name + '.' + '-'.join(r)

    if scanner_id not in __scanner_cache:
        __scanner_cache[scanner_id] = scanner_class(r)

    return __scanner_cache[scanner_id]
1282282
public AuthConfigProvider setProvider(ProviderService providerService) {
        AuthConfigProvider authConfigProvider = null;
        if (providerService != null) {
            authConfigProvider = providerService.getAuthConfigProvider(this);
            registerConfigProvider(authConfigProvider, null, null, null);
        } else {
            removeRegistration(defaultRegistrationID.toString());
        }
        return authConfigProvider;
    }
986409
protected function getScanner(): Scanner
    {
        if (null === $this->scanner) {
            $this->scanner = Scanner::factory();
        }
        return $this->scanner;
    }
768157
static Class findProviderClass(String className, ClassLoader cl,
                                           boolean doFallback)
        throws ClassNotFoundException, ConfigurationError
    {   
        //throw security exception if the calling thread is not allowed to access the
        //class. Restrict the access to the package classes as specified in java.security policy.
        SecurityManager security = System.getSecurityManager();
        try{
                if (security != null){
                    final int lastDot = className.lastIndexOf(".");
                    String packageName = className;
                    if (lastDot != -1) packageName = className.substring(0, lastDot);
                    security.checkPackageAccess(packageName);
                 }   
        }catch(SecurityException e){
            throw e;
        }
        
        Class providerClass;
        if (cl == null) {
            // XXX Use the bootstrap ClassLoader.  There is no way to
            // load a class using the bootstrap ClassLoader that works
            // in both JDK 1.1 and Java 2.  However, this should still
            // work b/c the following should be true:
            //
            // (cl == null) iff current ClassLoader == null
            //
            // Thus Class.forName(String) will use the current
            // ClassLoader which will be the bootstrap ClassLoader.
            providerClass = Class.forName(className);
        } else {
            try {
                providerClass = cl.loadClass(className);
            } catch (ClassNotFoundException x) {
                if (doFallback) {
                    // Fall back to current classloader
                    ClassLoader current = ObjectFactory.class.getClassLoader();
                    if (current == null) {
                        providerClass = Class.forName(className);
                    } else if (cl != current) {
                        cl = current;
                        providerClass = cl.loadClass(className);
                    } else {
                        throw x;
                    }
                } else {
                    throw x;
                }
            }
        }

        return providerClass;
    }
905071
public ScanListener getScanListener()
    {
    	if (m_listener == null)
    	{
    		String strClassName = this.getProperty(LISTENER_CLASS);
    		if (strClassName == null)
    			strClassName = ReplaceScanListener.class.getName();
			m_listener = (ScanListener)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
			if (m_listener != null)
				((BaseScanListener)m_listener).init(this, null);
			else
				System.exit(0);
    	}
    	return m_listener;
    }
834139
public static Provider getProviderForAlgorithm(String jceAlgorithm) {
		if (specficProviders.containsKey(jceAlgorithm)) {
			return (Provider) specficProviders.get(jceAlgorithm);
		}

		return defaultProvider;
	}